gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > Background Artifacts...

#77788 - The_Perfection - Mon Apr 03, 2006 12:15 am

'Sup all!

I'm having a bit of a problem with my BGs. I am using Mode 1, and I have the affine BG able to move around the screen. (Just testing still, new to tiled BGs.) The problem is when it gets within the upper 18 pixels. It draws the part of the BG that is inside the 18 pixels but below 9 pixels into the top 9 pixels.

Side Note: I've also had this on another little test demo (Mode 0), and it happened on top first, and then my friend messed with it and it now happens on the bottom.

My thought is that I'm not updating it at the right time, but I have it updating just under the Vsync command.

What in the world is going on here???

All responses appreciated.

#78816 - Natso - Mon Apr 10, 2006 12:09 am

being just under the vsync would make my suggestion seem obsolete, however I too have had this experience, and my draw update call was also located directly under the vsync call.
You have loops within the drawing update that are unnecesarily large, or simply large enough to require a second vsync to be called halfway through your drawing update(this will half your frames-per-second though).
What solved my problem was reducing a code I got from an example from looping 256 times to about 30(cause thats all the sprites I used) and it worked like a charm. My code was taking more time to execute than it took for the GBA to draw from the bottom of the screen(found by the vsync) to the top of the screen. Also, see if you can pre-calculate some of your math-related background stuff right before the vsync, so that when the vsync happens and you do your updates, they will be as fast as possible.

Hope some random sentence from my rant helps...

- Natso
_________________
I'm a bomb technitian. If you see me running, try to keep up ;)