Classic Computer Magazine Archive COMPUTE! ISSUE 49 / JUNE 1984 / PAGE 126

Graphics 0 Text In Four Colors

Ted Baldwin

Add four-color text to your Atari screen displays. These five programs demonstrate the ANTIC 4 display mode and allow you to save redefined characters for use in other programs.

ANTIC 4 is a little-known Atari display mode. Similar to GRAPHICS 0, it is a character mode, with 40 columns and 24 lines per screen, and uses all 256 characters. However, it also has the capability to display characters in four colors.

This is a result of the way ANTIC 4 interprets the character pattern. GRAPHICS 0, for instance, reads the character pattern one bit at a time. Each bit corresponds to one pixel of the character on the screen. The 1 bits are displayed at a different brightness than the 0 bits. ANTIC 4, on the other hand, reads the pattern two bits at a time. Each bit-pair corresponds to one pixel of the character. There are four possible combinations of two bits: 00, 01, 10, 11. Each combination represents a different color. The color corresponding to the bit-pair 00 is stored at location 712; the color for the bit-pair 01 is at location 708; the color for bit-pair 10 is at 709; the color for bit-pair 11 is at 710.

Redefined Characters

Program 1 converts the display to ANTIC 4. Running the program will reveal one of the drawbacks of ANTIC 4: The normal character set is useless. The characters on the screen are garbled because the normal character patterns are not designed to be read in bit-pairs. In order to make any practical use of ANTIC 4, you must redefine the character set.

Program 2 does that. The bit pattern for each character is designed so that the characters will appear in different colors. Specifically, typing lowercase letters will display light blue uppercase letters; typing uppercase letters will display gray uppercase letters; typing a number will display that number in gray; typing a shifted number will display that number in blue-green.

Program 3 demonstrates the use of these characters in ANTIC 4. Be sure to run Program 2 before running Program 3. The program first displays normal GRAPHICS 0 text. Then it switches to ANTIC 4 and displays four-color text using the redefined character set. The colors are changed to orange, green, and blue-green on a pink background.

Program 4 saves the redefined character set to disk and should be run after Program 2. Program 5 loads the character set back in. Your own filename can be substituted in line 140 of both programs.

You can add four-color text to your own programs by using Program 5 to load the character set and Program 1 to switch to ANTIC 4. Besides making your programs more colorful, these routines enable you to highlight important messages.

Refer to the "Automatic Proofreader" article before typing these programs in.