[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

System Specification for C65Fred BowenMarch 1, 1991

Color Palette

The C4567R6, allows the programmer to use the sixteen standard "C64" colors, or define up to 256 custom colors and/or use the palette to perform boolean operations on the bitplane data. The C4567R6 incorporates a 16 word palette ROM and a has a 256 word palette RAM. Each palette location is an index, which can specify one of sixtten possible intensity values (4 bits) each, of Red, Green, and Blue primary colors, plus a single control bit (FGBG) which can be used for foreground/background control for video mixing applications, or to drive a separate monochrome screen.

The first 16 locations of the palette default to the C64 colors in ROM. The remaining 240 locations are programmable RAM. The first 16 locations can also be replaced with RAM, however, by setting the PAL bit in control register "B". All old video modes, including sprites and exterior, can only access the lowest 16 palette locations (except hilite cells), so you may want to reserve these indices for such features.

Only bitplane mode can make full use of all palette locations. Even when less than eight bitplanes are used, the bitplane complement bits of the unused bitplanes can be used to specify which part of the palette is to be used. This feature allows the programmer to define multiple sub-palettes, which can be switched between quicklyr or to specify an offset in the color table for the bitplanes, allowing separate colors for exterior and sprites.

To set the color palette, the user must simply write to the color palette RAM. Addresses D100-DlFF (hex) program the 256 Red values, addresses D200-D2FF (hex) program the 256 Green values, and addresses D300-D3FF (hex) program the 256 Blue values. All 256 locations of both the blue and green palettes are only 4 bits wide, so the upper four data bits do nothing. Bit 4 of every red palette location is the FGBG programming bit, the remaining 3 bits are not used. The palette locations are not readable by the CPU.



[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated March 24, 2003.