To that end, I obtained two identical 7" displays that could take composite NTSC/PAL input, two VIC-20s, one with a real 6560, one with the Victor FPGA, and some user-palette reprogramming BASIC. With a bit of twiddling to set the hue/saturation/intensity of each palette entry, I now have the palette entries that I will use for the default NTSC palette. If anybody cares, here are the numbers I obtained:
Code: Select all
<colour> <idx> <hue> <sat> <int>
Black 0 00 0 0
White 1 00 0 32
Red 2 21 3 08
Cyan 3 55 2 32
Purple 4 19 3 16
Green 5 50 3 16
Blue 6 62 2 08
Yellow 7 33 2 32
Orange 8 25 3 08
Lt Orange 9 21 2 32
Pink 10 19 3 32
Lt Cyan 11 55 2 32
Lt Purple 12 17 2 32
Lt Green 13 49 3 32
Lt Blue 14 61 1 16
Lt Yellow 15 29 1 32
The <sat> value, the saturation, is how much of that hue is present and has a range from 0 (none) through 3 (full force).
The <int> intensity value sets how bright the colour is overall - if you turn off the colour part of the signal, the intensity (luma) gives the grey-scale level that would be used. The encoding is one-hot, as that is how this DAC is constructed. A value of '1' outputs an HSYNC level, '2' is BLANK/BLACK/0%/SETUP level (cue conversation about how SETUP is supposed to be higher output than BLANK and how that's not what Commodore did), '4', '8', '16', and '32' produce 25%, 50%, 75% and 100% luma intensity. Combinations with multiple bits set don't do anything interesting - the lowest voltage output is the one selected, so '8' overrides '32', for example.
Currently, the chroma colour carrier is generated as a "sine wave" with only 8 sample points per cycle, so pretty sloppy and not as smooth as it could be: 0.0, 0.7, 1.0, 0.7, 0.0, -0.7, -1.0, -0.7, (0.0) While this works, I'm relatively sure it is one of the noise contributors, so I'll be experimenting with a larger number of samples per cycle, provided the PLL in the FPGA can double the current fast_clk frequencies.
How about PAL? Did I manage to get the PAL palettes assigned as well?
Unfortunately, the two PAL-compatible displays I bought are not PAL-compatible - or even match each other. Using the same VIC-20 with the same 6561, one display would display every second colour as festering green, whereas the other would display everything as a random brown.
I need another two displays that can cope with the mangled mess that is VIC-20 composite PAL. My original idea was picture-in-picture, so I'll go back to that idea and see what I can manage to come up with.