Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
bizarre vsync issue maybe?   Message List  
Reply | Forward Message #6729 of 15019 |
Re: [gbadev] bizarre vsync issue maybe?

Hello alex,

Saturday, September 01, 2001, 5:14:12 PM, you wrote:

am> hiya :)

am> just started on this whole gba thing, but it feels a lot like good old mode
13h (ahh- nostalgia!).

am> so, anyway, i'm in gfx mode 3. i've been coding a simple little demo
involving a bunch of vertical lines.

am> if it was mode 13h, i'd do it like this:

am> main_loop:
am> update positions of lines
am> draw new lines
am> wait for vsync
am> erase old lines
am> goto main_loop

am> 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
am> should be. I've changed my drawVLine routine so much, and i am now simply
plotting individual pixels (euch!).

am> i think it's connected with the vsync, because moving the waitNextVSync()
changes the effect.

am> again, i've used several routines for waiting for the vsync, and i'm
currently using:

am> void waitNextVBlank ()
am> {
am> while((*((volatile u16 *)0x04000004) & (1<<0)));
am> while(!(*((volatile u16 *)0x04000004) & (1<<0)));
am> }


am> does anyone have any ideas?


maybe what you are seeing isnt related to vsync at all, but the effect
that you get when doing not 16-bit aligned writes to vram ? (read/write
16bit aligned words to vram only!)

--
Best regards,
groepaz mailto:groepaz@...





Sat Sep 1, 2001 3:20 pm

groepaz@...
Send Email Send Email

Forward
Message #6729 of 15019 |
Expand Messages Author Sort by Date

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...
alex mole
nal@...
Send Email
Sep 1, 2001
3:15 pm

Hello alex, Saturday, September 01, 2001, 5:14:12 PM, you wrote: am> hiya :) am> just started on this whole gba thing, but it feels a lot like good old mode...
groepaz
groepaz@...
Send Email
Sep 1, 2001
3:22 pm

... effect ... (read/write ... don't think so- the screen buffer is cast as a u16*, so i don't think C would even let me not write 16bit aligned... alex :)...
nal@...
Send Email
Sep 1, 2001
6:24 pm

ok- so i've worked out the problem: bits from several frames are being shown at the same time. after some optimisation and cleaning up, i discovered that...
nal@...
Send Email
Sep 1, 2001
11:02 pm

... effect ... (read/write ... Yup, this question has been asked/answered over and over and over... Maybe it's about time someone makes a Top Ten Tips...
dbrioso@...
Send Email
Sep 2, 2001
3:01 pm

... actually, that wasn't the problem ;-P. what was happening was a combination of a bug in mappy (the top line being updated a frame early), and the fact that...
alex mole
nal@...
Send Email
Sep 3, 2001
12:07 pm

... I've seen similar results on Mappy with various of my own projects. I always just assumed it was a problem with the emulator though since the same code...
Aaron R Leiby
aleiby@...
Send Email
Sep 1, 2001
11:03 pm

Actually, the effect I was seeing was in tile mode. The top row of tiles (when I pan the background around) was being updated a frame ahead of all the rest....
Aaron R Leiby
aleiby@...
Send Email
Sep 2, 2001
11:12 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help