I would like to add to this topic a little bit of technical information. As you already know, PPU has no any palette, it generate NTSC or PAL signal natively. It is possible because of the fundamentals of coding those color systems. PPU generate 12 different subcarrier phases for color range (color number from x1 to xC). All next info will refer to the following picture (NES palette ROM) and PAL PPU (basically clone):
I would like to remind you that video DAC is resistor chain. It can generate only 11 voltage levels (include 0V), so luma variants are very limited. You can search this research in this forum, I don't remember what that thread was.
Code:
LEVEL : SYNC : BURST : LUMA0 : LUMA1 : LUMA2 : LUMA3 :
VCC : : : : : : :
L10 : : : : : : :
L09 : : : : : H : H :
L08 : : : : : | : L :
L07 : : : : H : | : :
L06 : : : H : | : | : :
L05 : : : | : | : L : :
L04 : : H : | : | : : :
L03 : - H - : - | - : - | - : - L - : - - - : - - - : < BLACK LEVEL
L02 : | : | : L : : : :
L01 : | : L : : : : :
GND : L : : : : : :
As you can see, there is only 6 types of signal. Each type has High and Low level. All except SYNC can oscillate between those levels. L10 connected to emphasise logic and don't will discussed here. So, I've look at oscilloscope and what I was discovered.
This is one screen capture. Legend:
Channel 1 (yellow) is composite signal.
Channel 2 (cyan) is -(B-Y) signal form PAL decoder, based on TDA3510.
Channel 3 (magenta) is -(R-Y) signal from PAL decoder.
So, each color row (for each luma) starts with H level (index x0), goes through 12 hues by oscillating between H and L (indexes x1 - xC) and ends with L level (index xD). 0x row has L level lower than black level, so you notice it on the screen (for example in Super Robin Hood game from Codemasters).
Important thing: oscillating between two levels creates new luma value, which is always average for H and L levels. It noticeable with notch subcarrier filter turned on or on the eye from a distance from TV. Since, subcarrier always has duty cycle 50% average level is (H+L)/2. This level will used for RGB calculating.
I has made many measurement of absolute levels by scope and got this preliminary results:
Code:
0: R-Y +0.25V +0.04V -0.17V -0.29V -0.37V -0.35V -0.19V -0.18V +0.09V +0.21V +0.36V +0.38V amplitude -0.35V ... +0.38V delta 0.73
0: B-Y -0.52V -0.65V -0.59V -0.40V -0.05V +0.22V +0.55V +0.60V +0.65V +0.54V +0.22V -0.07V amplitude -0.59V ... +0.65V delta 1.24
1: R-Y +0.48V +0.25V -0.07V -0.34V -0.53V -0.57V -0.43V -0.26V +0.13V +0.32V +0.55V +0.59V amplitude -0.57V ... +0.59V delta 1.16
1: B-Y -0.61V -0.93V -0.98V -0.76V -0.30V +0.11V +0.70V +0.92V +0.98V +0.82V +0.32V -0.13V amplitude -0.93V ... +0.98V delta 1.91
2: R-Y +0.56V +0.27V -0.07V -0.37V -0.60V -0.65V -0.50V -0.13V +0.32V +0.53V +0.67V +0.62V amplitude -0.65V ... +0.67V delta 1.32
2: B-Y -0.68V -1.04V -1.10V -0.87V -0.34V +0.14V +0.80V +1.15V +1.05V +0.77V +0.14V -0.39V amplitude -1.10V ... +1.15V delta 2.25
3: R-Y +0.27V +0.15V -0.03V -0.18V -0.29V -0.31V -0.23V -0.07V +0.16V +0.25V +0.32V +0.31V amplitude -0.31V ... +0.32V delta 0.63
3: B-Y -0.34V -0.50V -0.53V -0.41V -0.15V +0.09V +0.41V +0.57V +0.52V +0.38V +0.07V -0.19V amplitude -0.53V ... +0.57V delta 1.10
LEVE L : SYNC : BURST : LUMA0 : LUMA1 : LUMA2 : LUMA3 :
VCC ????? : : : : : : :
L10 ????? : : : : : : : FULL CLAMP
L09 1.20V : : : : : H : H : 100% 100%
L08 0.87V : : : : : | : L : 72% 88%
L07 0.84V : : : : H : | : : 70% 85%
L06 0.54V : : : H : | : | : : 45% 55%
L05 0.48V : : : | : | : L : : 40% 48%
L04 0.41V : : H : | : | : : : 34% 41%
L03 0.22V : - H - : - | - : - | - : - L - : - - - : - - - : 18% 0% < BLACK LEVEL
L02 0.16V : | : | : L : : : : 13%
L01 0.15V : | : L : : : : : 12%
GND 0.00V : L : : : : : : 0%
In order to facilitate the perception of the data I have built a graph:
Very noticeable that fact what
luma0 very similar to
luma3 and
luma1 very similar to
luma2. If I eliminate some possible measurement errors I've got this kind of graph:
So, it's a sine shaped signal. that is true: 12 phase is 30 degrees vectors. And also very noticeable that fact what R-Y shifted by 90 degrees to the B-Y. This is normal for PAL when you make linear shift subcarrier phase by 30 degrees.
In the end I able to measure phase of each color but I don't see meaning in it. You can synthesize any of R-Y/B-Y and luma levels, scale them (R-Y/B-Y scaling is saturation control and luma scaling is contrast control) and mix them up to result RGB values, with the simple addition and subtraction, as is done by electronics devices.
Discuss.