Random Terrain, on Thu Sep 16, 2010 6:00 AM, said:
For a full game, isn't vblank useless?
No!
I mean, it depends on what you put in there, how you structure your code, etc. But I've never had trouble with it, including in games that have multiple screens/segments or whatever you want to call them. For instance, I used it to crunch almost 1000 machine cycles in Circus Galacticus, and that had several screens with unique functions (including making use of RevEng's brilliant title screen kernel).
I guess everyone codes differently, but I try to use it exclusively for longer math, bounding box detection and multiple-case trees (such as AI decision trees), and keep those operations separate from the "daily grind" of animation routines, sprite positioning, sound effects, etc. In other words, I shove the boring stuff in there that is helpful during the program's highest activity (the main game loop, usually) but that doesn't *directly* affect screen updates. Sure, you could spend RAM on avoiding certain routines within the statement, but if the stuff going on in there isn't A/V related, then who cares if it's running in the background of a "Character Selection" screen or something?
Edited by jrok, Mon Aug 1, 2011 9:03 PM.