Reply 20 of 25, by mkarcher
superfury wrote on 2020-12-14, 11:48:One thing I still see happening, though, is that when scrolling the display left/right, the display jerks left/right for 1 frame every few frames somehow?
If the jerking is by 8 pixels, it looks like the timing for either latching the start address or evaluating the pixel panning register is off. The working approach I got from my VGA book is to update the start address during the display period (because it is latched at display end), and update the pixel panning register during the subsequent blanking period (I assume it's unlatched, didn't test that yet). So horizontal soft-scrolling should look like this
- frame 0, during display: do nothing
- frame 0, during blanking: set pixel panning to 6 (applies to frame 1)
- frame 1, during display: do nothing
- frame 1, during blanking: set pixel panning to 7 (applies to frame 2)
- frame 2, during display: increase start address (applies to frame 3)
- frame 2, during blanking: set pixel panning to 0 (applies to frame 3, too)
- frame 3, during display: do nothing
- frame 3, during blanking: set pixel panning to 1
You get the effect you describe if only one of the two register changes performed during frame 2 is applied to frame 3. This could happen if you latch pixel panning at the beginning of the blanking period. In that case, frame 3 would be drawn with the new start address, but still the old panning value (7 = maximal panning). I got a similar effect (on actual hardware) when I treated byte panning as unlatched and updated it during the blanking period while the correct point in time to update byte panning is in the preceding display period, just like the start address.