Quote:
I don't believe that doing so would make the emulator inaccurate.
If no actual NES ever power-up with the proposed palette values, then it is inaccurate, since code can be written which behaves differently in an emulator, but consistently on all NES units (assuming that palette entry 0 is never black on any NES unit).
Quote:
Waiting for a game to write to Colour 0 would be inaccurate, but setting all Palette values to a black colour would not effect any games (or is highly unlikely).
That seems backwards to me. You're proposing to use palette values that can be detected by code running on the emulator. My proposed solution (and tepples') have no effect on accuracy as code cannot detect it, short of asking the player whether the screen flashed a color at power-up.
My idea is to keep a boolean flag for palette entry 0 (or one for each entry, if you want to be thorough) that is clear at power-up and set the first time a write to that entry occurs. Then in your "PPU rendering off" code you use black in place of palette entry 0 if this flag is false.
As to the likelihood of a game relying on power-up palette values, that can be replaced with certainty by either scanning all NES ROMs, or writing a ROM that specifically reads palette entry 0 at power-up and crashes if it's set to black (assuming that no actual NES powers up with that value). :)
Update: I wrote a tool and had it scan about 3400 ROMs for reads from a palette entry before it was written (stopping after one minute if none occurred). Only Bandai Golf read from a palette entry before writing to it, but it ignored the value. So, if you're emulating NES
games, it probably doesn't matter (but I don't have every ROM so I can't be sure). If you're emulating NES
hardware, the values at power-up matter.
In case the power-up palette test ROM I released is relevant here, that merely checks whether the palette matches that of my NES, which would obviously fail on NES units which have different power-up values. I personally don't think that all the test ROMs I've released (and am going to release) are worth making an emulator pass unless
the prime goal is accurate hardware emulation.