Atari Custom Characters
I know how to use CALL CHAR on the TI-99/4A computer to create custom characters, but how is this done on the Atari?
Atari BASIC lacks a command such as CALL CHAR to redefine characters in a single step, so you have to build a routine with PEEKs and POKEs instead. There are four steps involved, as demonstrated by the following program, which changes the exclamation point into an alien shape.
First, line 10 lowers the top of memory to reserve a protected area for the new character set. This example lowers the top of memory by 2,048 (8*256) bytes, enough room for a full character set. You must declare a graphics mode after doing this to make the computer relocate screen memory just below the protected area. Next, line 20 copies the part of the original character set you'll need from ROM (Read Only Memory) into the protected memory. The ROM characters start at location 57344. Line 30 then POKEs the data for the new characters into memory. Finally, line 40 tells the computer where to find the new character set by POKEing the high byte of the new character set's address into location 756.
Numerous articles describing these techniques in more detail have appeared in past issues of COMPUTE!'s First Book of Atari Graphics and Second Book of Atari Graphics.
10 A = PEEK (106) - 8 : POKE 106, A : GRAPHICS 0: CHBAS = 256 * A : REM PROTECT 1024 BYTES OF MEMORY 20 FOR A = 0 TO 2047 : POKE C HBAS + A, PEEK (57344 + A) : NEXT A : REM COPY NORMAL CHARACTER SET TO RAM 30 FOR A = CHBAS + 8 TO CHBAS + 15 : READ B : POKE A, B: NEXT A : REM PUT NEW CHARACTER DEFINITION AT EXCLAMATION POINT 40 POKE 756, A : REM CHANGE CHARACTER POINTER 50 DATA 60, 126, 90, 126, 60, 36, 66, 129