hiya :)
just started on this whole gba thing, but it feels a lot like good old mode 13h
(ahh- nostalgia!).
so, anyway, i'm in gfx mode 3. i've been coding a simple little demo involving a
bunch of vertical lines.
if it was mode 13h, i'd do it like this:
main_loop:
update positions of lines
draw new lines
wait for vsync
erase old lines
goto main_loop
but this doesn't work on the GBA. i get all kinds of wierd things happening to
my lines (on both Mappy and iGBA). It seems to be that the tops of the lines are
1 pixel further along than they should be. I've changed my drawVLine routine so
much, and i am now simply plotting individual pixels (euch!).
i think it's connected with the vsync, because moving the waitNextVSync()
changes the effect.
again, i've used several routines for waiting for the vsync, and i'm currently
using:
void waitNextVBlank ()
{
while((*((volatile u16 *)0x04000004) & (1<<0)));
while(!(*((volatile u16 *)0x04000004) & (1<<0)));
}
does anyone have any ideas?
cheers-
alex :)