3 unsigned int *framebuffer
= NULL
;
5 void getFramebuffer(void) {
6 struct memoryRegionInfo info
;
7 struct otherMemoryRegionInfo otherInfo
;
12 for(i
= 0; i
< 16; i
++) {
13 // Find base of next mapping
14 getOtherMemoryInfo(m
, 1, &otherInfo
);
16 // Get more info about this mapping
17 getMemoryInfo(otherInfo
.base
, &info
);
19 // Search mappings 14 and 15 if they are readable
20 if((i
== 14 || i
== 15) && (info
.flags
& PROT_CPU_READ
)) {
21 framebuffer
= info
.base
;
23 // Search for the colour we filled the framebuffer with
24 while(framebuffer
< (unsigned int *)info
.end
) {
26 framebuffer
[0] == 0xffc2c2c2 &&
27 framebuffer
[1] == 0xffc2c2c2
38 void *canvasRenderer(void *arg
) {
41 unsigned int colour
= RED
;
45 for(x
= 0; x
< 160; x
++) {
46 for(y
= 0; y
< 144 + 16; y
++) {
47 framebuffer
[x
+ y
* 144] = colour
;
49 colour
= ((colour
+ 1) & 0x00ffffff) | (0xff << 24);
58 // Init and resolve libraries
64 // Create our canvas rendering thread
66 scePthreadCreate(&thread
, NULL
, canvasRenderer
, NULL
, "canvasRenderer");
69 // Let this thread get back to updating the JS engine