I've been pointed to this forum by Andrew Davie who shares an interest with me in the Atari 2600. This question is about PAL TV and the Atari 2600. I'm hoping there is a television engineer here who can help.
First of all, I've been working on NTSC colour generation for an Atari 2600 emulator. I've been succesful in this and now want to move onto PAL. I'll describe my process for NTSC to give some context.
The 2600 specifies colour with a HUE value and a LUM value. To generate the YIQ signal the 2600 converts the LUM value to a suitable Y value and converts the HUE value to I and Q values.
To convert the HUE a position on the colour wheel is found like so (dividing by 15 because there are 15 possible hues)
- Code: Select all
phi = hue * 360 / 15
This is adjusted by the colour burst value, which is a fixed value
- Code: Select all
phi = phi + colourBurst
The I and Q values can then be derived:
- Code: Select all
I = Y * Cos(phi * pi/180)
Q = Y * Sin(phi * pi/180)
In the emulator, the RGB values can then be extracted from the YIQ information in the normal way.
This generates the correct NTSC palette used by the console, created without ever explicitely specifying the RGB values, which is what I want.
My question and confusion is over PAL colour generation for PAL Atari 2600s.
I understand the PAL uses YUV rather than YIQ but I figured I could still begin the process by dividing the colour wheel by the HUE value, like I did with NTSC.
U and V can then be created from this position on the colour wheel and then the RGB values extracted from the YUV information. This is how I think U and V can be found from the position on the colour wheel
U = Y * Cos(phi * pi/180)
V = Y * Sin(phi * pi/180)
However, conversion to RGB use the YUV method does not reproduce the expected PAL palette. It's close but not it's right.
Is there a gap in my understanding of how PAL encodes colour? Is it likely that the HUE value does not indicate an equal division of the colour wheel?
This may turn out to be more of a question about the Atari 2600 but any information about PAL colour encoding will be very useful.
Thanks in advance
Stephen