Problem with palette discoloration when PPU is turned off during rendering.

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

User avatar
N·K
Posts: 15
Joined: Mon May 11, 2020 2:45 am
Location: Japan

Re: Problem with palette discoloration when PPU is turned off during rendering.

Post by N·K »

My AV Famicom serial number was HN10804140.
I checked again the type of stickers and the arrangement of parts visible from the back, and I still think it's the HVCN-CPU-02.

However, the conditions for this phenomenon to occur seem to be quite unstable.
The probability of the phenomenon occurring on my Famicom seemed to be roughly 25%, but there were times when it occurred continuously every time the power was turned on again, and times when it did not occur more than 30 times.
It was also not uncommon for discoloration to gradually (or quickly) stop occurring over time, even if discoloration was present immediately after startup.
Drag
Posts: 1615
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: Problem with palette discoloration when PPU is turned off during rendering.

Post by Drag »

It's been a while, but I can confirm that I've gotten a palette glitch from the test rom. If I boot up and simply press left once, I get the following glitch:
(B=0)
3F00 = 3F0E
3F04 = 3F06
3F08 = ? (it changes slightly but I can't tell what it changes to)
3F0C = 3F0F

If I hold B to scroll 3 pixels, I get the above glitch, and then maybe 15 frames later:
B=3
3F04 = 3F07

If I hold B until I scroll 8 pixels, I then get:
B=8
3F01 = 3F03
3F05 = 3F07
3F09 = 3F0B
3F0D = 3F0F

After another 8 pixels of B:
B=16
3F02 = 3F00, all other palettes unaffected

After another 8 pixels of B:
B=24
3F03 = 3F00
3F07 = 3F06, but this seems to depend on the contents of the palette: if I refresh the palette with "start", this glitch occurs. If I move to B=0, and keep the palette unrefreshed all the way to B=24, 3F07 stays its current color, but 3F04 and 3F05 will both have the same color as 3F07 too.

B=32
3F00 = 3F01
3F04 = 3F05
3F08 = 3F09
3F0C = 3F0D

B=40, B=48, no glitch

B=56
3F0F = 3F0E

B=64
3F00 = #01 (not from existing palette)
3F04 = 3F07
3F08 = 3F0A
3F0C = 3F0F

B=72, same as B=8

B=80
3F0A = 3F08

B=88
3F0B = 3F08
3F0F = 3F0E

B=96
3F00 = 3F01
3F04 = 3F05
3F08 = 3F09
3F0C = 3F0D

All of the above was gathered by using "start" to refresh the palette, then observe how the values change from the initialized palette. I get different behavior (palette entries changing when they didn't before) if I leave the palette alone and hold A:

Code: Select all

       x    96   88   80   72   64
3F00 | 0F | 00 | 00 | 00 | 00 | 00
3F01 | 00 | 00 | 00 | 00 | 20 | 20
3F02 | 10 | 10 | 10 | 10 | 10 | 10
3F03 | 20 | 20 | 20 | 20 | 20 | 20

3F04 | 0F | 11 | 11 | 11 | 11 | 31
3F05 | 11 | 11 | 11 | 11 | 31 | 31
3F06 | 21 | 21 | 21 | 21 | 21 | 21
3F07 | 31 | 31 | 31 | 31 | 31 | 31

3F08 | 0F | 13 | 13 | 13 | 13 | 13
3F09 | 13 | 13 | 13 | 13 | 13 | 13
3F0A | 23 | 23 | 23 | 03 | 03 | 03
3F0B | 33 | 33 | 13 | 13 | 13 | 13

3F0C | 0F | 15 | 15 | 15 | 15 | 35
3F0D | 15 | 15 | 15 | 15 | 35 | 35
3F0E | 25 | 25 | 25 | 35 | 35 | 35
3F0F | 35 | 35 | 35 | 35 | 35 | 35
So, it doesn't seem to always be just a flat copy from one palette entry to another, it seems that sometimes, individual bits are copied but others aren't (like, why does color 03 appear?)

Anyway, continuing:
B=104, B=112, no glitch (edited, forgot this)

B=120
3F07 = 3F06
3F0F = 3F0E

B=128
3F00 = 3F06
3F04 = 3F06
3F08 = hard to tell but I'm guessing color 01 or 03 again
3F0C = 3F0F

B=130 (2 pixels)
Same as B=128, but 3F08 = 3F09

B=136
Same as B=8

B=144
3F02 = 3F00

B=152
3F03 = 3F00
3F07 = 3F06 (but if I did B=160 right before and didn't refresh, 3F07 remains unaffected)

B=160
3F00 = 3F01
3F04 = 3F0D? (might actually be color 16)
3F08 = 3F09
3F0C = Almost 3F0D, but slightly darker, I'm guessing color 16 instead of 15.

B=168, B=176, no glitch

B=184
3F07 = 3F06
3F0F = 3F0E

B=192
3F00 = 3F01
3F04 = 3F07
3F08 = 3F0B
3F0C = 3F0F

B=200
Same as B=8

B=208
3F0A = 3F08 (seems to just be lower 4 bits, if I do B=192, B=200, then B=208, this color doesn't change)

B=216
3F0B = 3F08 (full 6 bits this time)
3F0F = 3F0E

B=224
3F00 = 3F01
3F04 = 3F05
3F08 = 3F09
3F0C = 3F0D

B=232, B=240, no glitch

B=248
3F07 = 3F06
3F0F = 3F0E

and then we've wrapped back around to B=0.

Edit: And as reported before, when I press the RESET button, I don't always get the glitch. If I can get the glitch to happen, all I need to do is press LEFT on the d-pad once after booting, and I get all of the palette glitching mentioned above. While glitching, if I press SELECT, the glitch stops happening until I've pressed it 4 times, so I'm guessing the lower left nametable is the one we're interested in.

Edit 2: I can press RIGHT twice to trigger the glitch too. If I press LEFT once, I get a glitch that alternates every other frame. If I press RIGHT twice, I get a stable glitch that happens on each frame.

Edit 3: Sometimes when I don't have the glitch, there's still a strange artifact: after pressing LEFT once, the pixel where rendering is disabled is stable and black, but if I press SELECT 1, 2, or 3 times, the pixel is wiggly instead, until I press SELECT a fourth time to get back to the nametable the rom starts up with, and the pixel goes back to stable and black again.
User avatar
N·K
Posts: 15
Joined: Mon May 11, 2020 2:45 am
Location: Japan

Re: Problem with palette discoloration when PPU is turned off during rendering.

Post by N·K »

I got a Famicom with 2C02E today and tested it immediately.
As a result, the test results were roughly the same as Drag's, although some of the discolored palettes were different. (The glitch in Edit3 has not been confirmed yet.)
We also confirmed that glitches occur in the lower right nametable $2C00. (Press left 11 times from the initial position)
In addition, I feel that the scanlines where glitches occur exist every 4 lines.

When we checked again with the AV Famicom, the rendering stop position where the glitch occurs differs from the 2C02E Famicom, and it seems to occur in more places. Also, the glitching occurs at any nametable.
Post Reply