atari2600land, on Wed Oct 1, 2008 10:13 PM, said:
How do you get the "scanline" counter above 262 in bB, and how can you prevent this from happening?
That means your "overscan" routine/s is/are too long. The "overscan" is what most Atari programmers call the part of the screen that comes below the game screen, and it's one of two periods when you get to do your stuff between drawing one frame of the screen and drawing the next frame of the screen. The other period when you can do stuff is what most Atari programmers call the "vertical blank" (or "vblank" for short), which is above the game screen. (These usages of the terms are technically wrong, but what the hey.) It sort of looks like the following:
draw a frame of the game screen
do stuff during the "overscan"
do the vertical sync
do stuff during the "vblank"
draw the next frame of the game screen
do stuff during the "overscan"
do the vertical sync
do stuff during the "vblank"
draw the next frame of the game screen
do stuff during the "overscan"
do the vertical sync
do stuff during the "vblank"
draw the next frame of the game screen
etc.
In bB, all of your code normally executes during the "overscan," so you need to be careful that it doesn't take too long to do the stuff you want to do, otherwise the vertical sync doesn't occur when it needs to, causing the screen to have too many lines on it, and it will roll.
There are three options for fixing this:
(1) Move some of your routines into the "vblank" period, instead of trying to do everything during "overscan."
(2) If it's feasible, see if you can divide the routines up so they don't all get performed during the same frame-- i.e., some routines would be performed during one frame, then the remaining routines would be performed during the next frame.
(3) Try to tighten up your routines so they take less time, or remove any routines that you might not need to do at all.
Michael