Games like Super Mario Bros. and Zelda 2 put sprite 0 at the bottom-center of their status bars and then test for sprite 0 hit to know when to set a non-zero xScroll in $2005, right? In my emulator, the right half of that scanline is glitched, messing with the bottom pixels of the count counters and level numbers in SMB1, and the white bottom border of the life and magic bars in Zelda 2. The rest of the picture is fine, since I reload the X scroll values from the temp register at the end of the scanline.
I must be misunderstanding something about either the fineX register, sprite 0 hit, or both. I know that the first write to $2005 immediately overwrites fineX, and writes the new coarse X to the temp register.
1. Does fine X increment every dot, and then wrap from 7 to 0?
2. Wouldn't writing the fineX in the middle of a line make at least that line scroll unpredictably without very stringent timing?
3. If the fineX is 7 at the moment the CPU writes a 0 to the scroll register, does that cause the PPU to draw the current tile a second time, or does the coarse X increment on its own, regardless of what fineX is doing?
4. If I'm seeing a glitched half line in these games, is it because I'm somehow triggering sprite 0 hit an entire line early? If the sprite 0 hit registered one line later, then no visible glitch would occur, because the next line down is just the backdrop color from there to the right.
Thanks!
I must be misunderstanding something about either the fineX register, sprite 0 hit, or both. I know that the first write to $2005 immediately overwrites fineX, and writes the new coarse X to the temp register.
1. Does fine X increment every dot, and then wrap from 7 to 0?
2. Wouldn't writing the fineX in the middle of a line make at least that line scroll unpredictably without very stringent timing?
3. If the fineX is 7 at the moment the CPU writes a 0 to the scroll register, does that cause the PPU to draw the current tile a second time, or does the coarse X increment on its own, regardless of what fineX is doing?
4. If I'm seeing a glitched half line in these games, is it because I'm somehow triggering sprite 0 hit an entire line early? If the sprite 0 hit registered one line later, then no visible glitch would occur, because the next line down is just the backdrop color from there to the right.
Thanks!