Extended color mode

Extended color mode is a special feature of the VIC-II's text screen: By setting bit 6 (weight 64) in 53265/$D011, each individual character on the text screen may have one of four different background colors. The "trade-off" is that the character set is limited to the first 64 out of normally 256 available characters. Colors are selected by POKEing the color values into four bytes, 53281-53284.

The two most significant bits in the character code for each position on the screen determines which of the four background colors applies to that character:

The remaining six bits indicate which of the first 64 characters in the current character set should appear at that position. Due to the layout of the character set, bit six is set by holding the SHIFT key while typing, and bit seven is set by turning on reverse text. Therefore:

53281 is invoked by typing normally

53282 is invoked by typing with the SHIFT key

53283 is invoked by turning on reverse mode

53284 is invoked by using SHIFT with reverse mode

After extended color mode is enabled, typing with the SHIFT key down will cause the characters to appear in the alternate background color, rather than upper-case or as glyphs. Conversely, most characters without a shifted version (numbers and punctuation, PETSCII characters 32-63) can only appear with background colors 53281 and 53283, and five graphical characters (PETSCII characters 123-127) are replaced by copies of the characters 32 spaces lower (91-95) appearing in the "shifted" colors.

The first four lines set up the four background colors; white, red, green, and blue, in their respective registers. Line 50 engages the extended color mode, and line 60 prints the example text. Note that CHR$(18) is the control character for "reverse on", and the letters shown as lowercase would actually be shifted (capital letters in the big/small character set, or graphics in the big/graphics character set).

Extended color mode should not be used simultaneously with multicolor mode for the text screen: The VIC-II seems to "lock up" if both modes are engaged, showing a blank, black screen. The problem clears as soon as either multicolor or extended color mode is disabled.