THE CHARACTER SET

The data for the regular Atari character set is stored in locations 57344 through 58367 ($E000 to $E3FF). There are eight bytes for each character and 128 characters in all (for a grand total of 1024 bytes). But wait a minute. Doesn't the Atari have 256 characters? Yes, but the information for the regular characters is all the Atari needs to know to print inverse characters, so that's why there are only 128 character descriptions.

For lots of information on how the bytes are used to describe a character, and on the order of the characters within the character set, see CHBAS at location 756. For information on how to design your own character set, see the Appendix One, which is on that very topic.

The following program will use the character descriptions to put text on the screen in graphics mode eight:

100 GRAPHICS 8
105 SCRMEM=PEEK(88)+PEEK(89)*256
110 DIM TEXT$(120)
120 PRINT "Start text in what column (0-39)";
130 INPUT COL
140 PRINT "In what row (0-152)";
150 INPUT ROW
160 PRINT "Type in the text you want to print:"
170 INPUT TEXT$
180 CHSET=PEEK(756)*256
190 FOR CHAR=1 TO LEN(TEXT$)
200 ATASC=ASC(TEXT$(CHAR,CHAR))
210 NOINV=ATASC-128*(ATASC>127)
220 INTRNL=NOINV-32*(NOINV<96)+96*(NOINV<32)
230 FOR BYTE=CHSET+INTRNL*8 TO CHSET+INTRNL*8+7
240 POKE SCRMEM+ROW*40+COL,ABS(255*(ATASC>127)-PEEK(BYTE))
250 ROW=ROW+1
260 NEXT BYTE
270 ROW=ROW-8
280 COL=COL+1
290 IF COL=40 THEN COL=0:ROW=ROW+8
300 NEXT CHAR
310 PRINT
320 GOTO 120


Return to Table of Contents | Previous Chapter | Next Chapter