#44403 - Shade - Wed Jun 01, 2005 11:55 am
Hi, sorry for posting, but I've read through the FAQ and had no luck so far.
I'm using devkitpro (as per instructions). My make.bat:
And this is my source file:
Now, it was supposed to clear the screen with magenta and draw a single blue pixel on the corner, repeatedly. However, the "Screen[0]" attribution seems to affect the whole screen -- the effect is, the whole screen blinks magenta/blue/magenta/blue...
Note that I could only test it in Visual Boy Advance so far.
What is this? Some weird alignment issue? What am I missing?
Thanks in advance
I'm using devkitpro (as per instructions). My make.bat:
Code: |
PATH=C:\devkitpro\msys\bin;C:\devkitpro\devkitARM\bin;%PATH%;
arm-elf-gcc -mthumb -mthumb-interwork -c hello.c arm-elf-gcc -specs=gba_mb.specs -mthumb -mthumb-interwork hello.o -o hello.elf arm-elf-objcopy -O binary hello.elf hello.gba gbafix hello.gba |
And this is my source file:
Code: |
/* hello.c - Gameboy Advance Tutorial - Loirak Development */ #define RGB16(r,g,b) ((r)+(g<<5)+(b<<10)) int main() { char x,y; unsigned short* Screen = (unsigned short*)0x6000000; *(unsigned long*)0x4000000 = 0x403; // mode3, bg2 on while(1){ //loop forever // clear screen, and draw a magenta back ground for(x = 0; x<240;x++) //loop through all x { for(y = 0; y<160; y++) //loop through all y { Screen[x+y*240] = RGB16(30,0,31); } } Screen[0] = 0x7c00; // draw a single blue pixel } } |
Now, it was supposed to clear the screen with magenta and draw a single blue pixel on the corner, repeatedly. However, the "Screen[0]" attribution seems to affect the whole screen -- the effect is, the whole screen blinks magenta/blue/magenta/blue...
Note that I could only test it in Visual Boy Advance so far.
What is this? Some weird alignment issue? What am I missing?
Thanks in advance