Colors - rosco-pc/propeller-wiki GitHub Wiki

For the VGA output the number of colors is simply hardwired to 64 colors (2 bits per base color red, green and blue, six bits in total). But for composite video the situation is much more complex and depends on the software driver. Not all drivers are available for both PAL and NTSC and at the moment there are no TV drivers available for the French/Russian SECAM system.

In the standard propeller video configuration (e.g. The Hydra), for NTSC:

  • The hydra can produce 16 hues. Each hue can have 4 levels of brightness. = 64 colors.
  • Additionally there are 6 monochrome shades from black through white = 6 colors.
  • And then there is a set of 16 super saturated colors which overdrive the TV brightness signal and don't play well with the other colors, but can be useful for special effects. = 16 colors.
  • Total 86 colors maximum. (135, if all possible byte values are used, however some lower quality signal may result)
  • The number of colors you have available in a particular program depends on what [palette mode](Palette Mode) is used by your graphics driver.

Potatohead describes a way of using dithering to produce nearly 400 colors in NTSC. With custom video hardware, apparently 1.7. million colors are available. But as yet the details are a bit sketchy. It is safe to say the number of colors possible on the Propeller / HYDRA really depends on the display being generated, amount of RAM added to the on board 32kb, circuit used to interface with the display, and the driver code written.

Notes on High-Color mode

It is useful to know all the byte values, when passed to a WAITVID in high-color mode, that produce colors. There are 126 of these listed in the Color Lookup Table below:


$02, $03, $04, $05, $06, $07                      Six intensities
$19, $1a, $1b, $1c, $1d, $1e, $98, $af            15 Hues
$29, $2a, $2b, $2c, $2d, $2e, $a8, $bf
$39, $3a, $3b, $3c, $3d, $3e, $b8, $cf
$49, $4a, $4b, $4c, $4d, $4e, $c8, $df
$59, $5a, $5b, $5c, $5d, $5e, $d8, $ef            High saturation colors, placed
$69, $6a, $6b, $6c, $6d, $6e, $e8, $ff            in table by closest hue match.
$79, $7a, $7b, $7c, $7d, $7e, $f8, $0f
$89, $8a, $8b, $8c, $8d, $8e, $08, $1f            Hues are presented in this table
$99, $9a, $9b, $9c, $9d, $9e, $18, $2f            vertically, in sequence as shown
$a9, $aa, $ab, $ac, $ad, $ae, $28, $3f            in screenie below.
$b9, $ba, $bb, $bc, $bd, $be, $38, $4f
$c9, $ca, $cb, $cc, $cd, $ce, $48, $5f            Start with intensity on left, and
$d9, $da, $db, $dc, $dd, $de, $58, $6f            work to the right, starting at
$e9, $ea, $eb, $ec, $ed, $ee, $68, $7f            top of table.
$f9, $fa, $fb, $fc, $fd, $fe, $78, $8f

There are 6 additional useful (not high saturation) color values, not mapped into the color table above. (h/t to mpark for catching these!) They are: $0a, $0b, $0c, $0d, $0e, $0f The screen capture below has been updated to show these, and is now the correct phase. This brings the number of non-artifacted, unique colors produced by the Parallax reference video circuit to 135. These can optionally be mapped into the CLUT above, thus: 09, 0a, 0b, 0c, 0d, 0e, 88, 9f (These form the complete set of input values, some are high saturation and may not display well.) There are two sets of super saturated colors. On some TVs these appear slightly different, bringing the number of total Propeller colors, generated by the on-board video hardware, to 132 possible input values. As noted above, 86 of these are solid, useful colors. This data provided for completeness where feeding values to a WAITVID is concerned.

Artifacted Colors

The NTSC safe area has an effective resolution of 160 pixels horizontally. (Safe area, shown as lighter grey background in screen shot below.) Pixels clocked (or sized) faster (or smaller) than this, will produce color artifacts in the display. Older 8bit computers and game systems used this technique to obtain more colors than the video hardware was designed for. On the Propeller, it is possible to get a ~400 color display by placing two standard propeller colors together on a display with a pixel clock equal to 320 pixels, for the NTSC safe area. More color combinations, than the ones shown, are possible, using the high saturation color sets in the artifacting process, and the additional colors, not mapped into the CLUT above.

08_25_2007_10_03_02.jpg

The standard (non artifacted) colors in the table above are in line at the bottom of the image to the left, and in the strip to the right. This artifacting technique does deliver 12 grey scales as well, if a monochrome display is desired. For this to work, the color burst signal must not be present. For resolutions above 160 pixels, stable color can be achieved by placing two pixels together that have the same standard Propeller color. This allows for movement and positioning at resolutions above the 160 pixel limit without having to worry about heavy artifacting having an impact on the display. It is important that the left over scan be a multiple of the pixel clock for the above techniques to work.

Color Timing

Simple NTSC displays, similar to those of many older 8bit computers have the 160 pixel limit, and will do artifacting in a stable manner. More complex timing schemes involve interlacing the pixels horizontally, resulting in a 320 pixel NTSC display, or using clever color burst timing for a 224 pixel display.

Reference video output circuits -vs- others

The discussion above surrounds the possibilities presented by the reference Parallax video output circuits, and should be considered standard video output. The nature of the Propeller lends itself easily to other video output schemes as none of the 8 COGs or I/O pins are dedicated to this task in any way. It's a software driven design that makes other video output solutions a matter of code and appropriate output circuits. An 8 bit R2R ladder can be used to generate a ~160 grey scale display, for example. Because some of the 'colors' actually need to be used for the sync portion of a complete video signal, the actual number of colors, per number of bits applied to the task, will be less than one would otherwise expect from more mainstream graphics systems that perform signal generation in hardware. Other examples, some in progress, include driving the Propeller video generators in VGA mode to directly control color generation, produce more grey scales, etc...