Originally posted by: bunnyboyOriginally posted by: albailey
; FINE X scrolling updates right away, but I do not care so long as the status bar color is the same all the way through nametable $2000 and $2400. Otherwise I will see crawling.
LDA X_SCROLL
STA $2005 ; first write is X scrolling
LDA #$00
STA $2005 ; second write is Y scrolling
What I have done is timed loops starting when the sprite 0 hit happens. If you can get your $2005 writes to happen at the end of the scanline, when the PPU is fetching sprite data, you won't see any graphical glitches. Sprite fetching is long enough to account for the variable width crawl.
One other observation about crawling, but not directly pertaining to "fine X" scrolling.
I had a bug a while back where I was using a status area at the bottom of the screen, and was placing the sprite zero on the top row of that status area (around row 22).
My bug was that because I placed the sprite zero in the status area, a portion of that status area would scroll as part of the game scrolling region. This was noticeable because I made the status region not run the entire width of the screen. This meant I had not used a solid line at the top of my status area, and I could visually see it moving across the screen.
The bug was actually more serious than just a graphical glitch, because the crawling meant that when an all transparent background tile scrolled to the location of the sprite zero, I did not get my sprite zero collision, and therefore my NMI routine never returned properly, etc..
I would not have had this problem with a status region at the top of the screen, because the only "crawling" that would be seen is the fine X scroll that Brian alluded to in his post.
A possible work around would have been to locate sprite zero above the status area, but in my opinion that can also lead to trouble, since you need to remember to make sure you do not have fully transparent background blocks in the game area for that row, otherwise you can hit the same problem.
So in summary, if you are going to put a status area on the bottom of your screen, make sure you load it into both $2000 and $2400 nametables, and make sure that at least the top line of the status region runs continuously the entire width.
Al