mjboth / LightBike

A simple 2-Player action game for the NES
2 stars 0 forks source link

Screen flickering at the end of a round #19

Open mjboth opened 8 years ago

mjboth commented 8 years ago

The background will be misaligned for a single frame when a bike crashes into a wall.

mjboth commented 8 years ago

This is happening due to the 960 tiles I have to update in the Picture Processing Unit (PPU), it takes too much time to update all of the tiles and the PPU will begin to refresh the screen while I am in the middle of updating the background and both my code and the PPU are modifying the PPU address register at the same time. I plan to redraw the background 256 tiles at a time when the NMI interrupt is called (which happens 60 times a second), then set the PPU address register back to where it was before. This way the PPU will not start the redraw the screen when I am in the middle of messing with the PPU address register.