BG color flashes.
- Dominant language
- JavaScript
- Stars
- 6.4k
- Forks
- 857
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the flash with the linked GernfherFgnpx.nes.gz ROM by reaching character select and pressing up or down. Start by tracing PPU mask/control writes, buffered palette changes, and background-color handling across NMI and vblank; done means the screen no longer flashes the previous background color after the PPU is disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100