jsnes icon indicating copy to clipboard operation
jsnes copied to clipboard

BG color flashes.

Open slembcke opened this issue 5 years ago • 0 comments

In my homebrew game, I disable the PPU during transitions. On a several of the screens, the BG color is not the predominant color, and so I have to swap it when disabling the PPU. It seems that jsnes is caching the BG color at the wrong time, and it's flashing the screen with the old BG color.

For example, hit start a couple times to get to the character select screen in the following ROM, then press up and down to select a character. The screen will flash blue while loading the next character sprite. In my NMI code, the first thing I do is set set the PPU mask/control registers, then copy any buffered data (such as palette changes) to the PPU. http://files.slembcke.net/temp/GernfherFgnpx.nes.gz

It's unclear if the problem is that it saves the BG color when rendering is disabled, or if it's sampling it too early. Either way, my palette changes should be finished long before vblank ends.

slembcke avatar Aug 28 '18 19:08 slembcke