This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

The truth about the black entries of the NTSC NES:

The truth about the black entries of the NTSC NES:
by on (#241856)
So after hearing of other palette makers deciding to increase entry 1D (and its mirrors) to a grey shade due to 0D being darker, I decided to use a test ROM on an umodded front-loader NTSC NES hooked into a 20M2U PVM with the brightness turned all the way up. I ended up discovering some things I never knew before, and apparently are not accurately reflected in online documentation as far as I could google for an hour. Here's what I found:

0E, 1E, 2E, 3E, 0F, 1F, 2F, 3F are all the same exact shade on the PVM even when brightness is cranked all the way up. There's no difference. They also do not respond to emphasis bit settings. This is known behavior.

1D with emphasis bits turned off is identical in shade to the E and F entries. Turning different emphasis bits on and off will actually change the hue of 1D. Turning on all emphasis bits turns 1D into the same shade as the default 0D. This last part I have not seen documented clearly anywhere.

0D by default is darker then 1D by default. 0D also responds to emphasis bits, where the hue is changed just like with 1D, only at a darker scale. Turning on all emphasis bits for 0D makes it an even darker black! Here again, I've not seen this documented.

I apologize ahead of time if I missed a page that explains all this as I have, but the pages and threads I've read about these black entries all seem to have missing information, wrong information, or conflicting information.
Re: The truth about the black entries of the NTSC NES:
by on (#241857)
Ah dammit, I found the related info that does match my findings in the NTSC video section (rather than the palette section):

https://wiki.nesdev.com/w/index.php/NTSC_video
Re: The truth about the black entries of the NTSC NES:
by on (#241858)
Everything you've stated is documented here, but not necessarily in the terms you've expressed: Wiki:NTSC video

$0D being darker when under emphasis it never calls out that specific colour but it's stated that the $D column is included in emphasis effects. I don't think there's really a need to say something special about that one particular entry? It works the same as the others in this respect.

1D + emphasis = 0D is not said anywhere, but how accurately is this measured? There are specific measurements given for the base voltages and an explicit formula given for emphasis attenuation, but what I'd gather from applying those is that they should be fairly close but not really the same?
Re: The truth about the black entries of the NTSC NES:
by on (#241859)
Just checking the wiki: It says that 0D = -0.117, and 1D with all emphasis on would be -0.0912. Pretty close, but 0D should be slightly darker.
Re: The truth about the black entries of the NTSC NES:
by on (#241910)
Dwedit wrote:
Just checking the wiki: It says that 0D = -0.117, and 1D with all emphasis on would be -0.0912. Pretty close, but 0D should be slightly darker.


Yeah the difference there is a small enough margin that my eyes couldn't pick up the difference on my PVM. I'm thinking about hooking my own NES up to my Rygol scope using 75-ohm termination and measuring the amplitude specific to my NES. If just to satisfy my OCD anyway.
Re: The truth about the black entries of the NTSC NES:
by on (#241933)
Thanks for this. I was going to make a post asking if all the black entries are different or the same. Now I don't have to.
Re: The truth about the black entries of the NTSC NES:
by on (#242222)
I too have been ignorant of this information until now, but one question remains for me about 1D. It's nice to have it affected by the emphasis bits, but is it "safe" on TVs when not all three bits are set at once?
Re: The truth about the black entries of the NTSC NES:
by on (#242285)
I'm not sure if $1D is unsafe with the emphasis bits set or not since it's so close to $0D when set? It should be safe when the bits are clear though. According to the wiki it's identically black to the $xE and $xF columns when emphasis isn't set. The only difference is that it's affected by the emphasis bits while the $xE/$xF columns aren't.

To be super safe you can just ignore the whole $xD column to avoid fading into $0D (in case a fading routine is used that just subtracts $10 from the palette entry). It only really has two useful colours, the two greys $2D and $3D, which aren't too much different from the two "safe" greys $00 and $10 anyway. $2D and $3D are black on RGB PPUs (2C03 and 2C05) so there are compatibility reasons to not use them as well.
Re: The truth about the black entries of the NTSC NES:
by on (#242322)
I like using the $XD column because it gives me more options in terms of shades of gray I can use. in my fade-out routine, I do it in 8 steps, alternating between setting all the color emphasis bits to slightly darken the screen, then dropping to the next palette row darker, and any value that becomes negative I set to $0F. I added a few instructions to also check if anything drops to $1D or $0D and reset those to $0F as well. I figure the chance of anybody ever playing my game on an RGB PPU is so slim, I'm not really concerned about it. out of curiosity, is there any way (in code) to determine what PPU it's running on?
Re: The truth about the black entries of the NTSC NES:
by on (#242323)
I have hypothesized that one could detect the RP2C03 PPU by the lack of skipped pixel in the pre-render scanline. I have not made, or seen somebody else make, a proof of concept however. One could take the respective part from blargg's PPU tests, which includes a detection of the skipped pixel, as a starting point.
Re: The truth about the black entries of the NTSC NES:
by on (#242327)
Forever ago, thefox wrote a demo that detected that the RGB PPU allowed 1/6 of one more instruction cycle to execute per vsync. When I asked them to repost it, they declined on the grounds of it being too fragile.

... although I can't find where I asked anymore.
Re: The truth about the black entries of the NTSC NES:
by on (#242328)
I would have written such a test except that I lack a device with an RGB PPU on which to run it.
Re: The truth about the black entries of the NTSC NES:
by on (#242331)
I assume we could cajole memblers or lupin3rd to run a test on their Vs. Systems.