Classic Computer Magazine Archive COMPUTE! ISSUE 19 / DECEMBER 1981 / PAGE 104

Discovering Atari's "Hidden" Graphics

Gregory L. Kopp
Indianapolis, IN

If you were a stumbling, beginning BASIC programmer like I was, you probably tried to enter a few "improper" graphics commands which resulted in curious and unexpected displays on your television screen. Before I understood the function and proper use of POKE 756 (which allows one to display Atari lower case letters and special graphics characters in text modes 1 and 2, I stubbornly tried to put CONTROL characters on-screen without the requisite POKE, which produced only seemingly random keyboard characters and frustration instead.

Much later, the thought nevertheless occurred to me that I might have actually accidently discovered some "hidden" (or at least undocumented) graphics capability of my Atari. In the experimental binge to which owners of microcomputers are sometimes given, I used the PRINT #6; command to enter each keyboard character while pressing CTRL at the same time. Discovery! Although the Atari special graphics characters appeared in the PRINT #6; statement, the actual screen display consisted of keyboard characters, but not the characters for the keys I entered.

Dutifully noting the results (first chart below), I pondered the apparent micro-fluke, these "hidden" characters, then asked myself the inevitable scientific question: "So what?" Two uses came fairly quickly to mind — the first purely cosmetic, the second functional.

10 GR. 2 + 16
20 X = 0
30 FOR L = 1 TO 50
40 RC = INT(15 * RND(0)) : RS=(255 * RND(0))
50 SETCOLOR 0, RC, 6
60 SOUND 0, RS, 10, 4
70 POSITION 5, 4
80 PRINT #6; "1 " (use CTRL = Q)
90 FOR W = 1 TO 25 : NEXT W
100 X = X + 1 : IF X = 4 THEN X = 0
110 NEXT L
120 SOUND 0, 0, 0, 0
130 GR. 2 + 16
140 POSITION 5, 4
150 PRINT #6; "1 "
160 FOR W = 1 TO 500 : NEXT W
170 POSITION 2, 7
180 PRINT #6; "HIDDEN GRAPHICS!"
190 FOR W = 1 TO 1000 : NEXT W

If one could change these hidden characters from "default green" to other colors, one could eliminate the irksome problem encountered in modes 1 and 2 of having punctuation and numbers displayed in different colors than the text lettering. The INVERSE key! Sure enough, PRINTing the graphics characters in inverse changed my hidden green characters to red. Now I could choose from normal character (yellow), inverse normal (blue), CTRL character (green) and inverse CTRL (red). Experimenting further, I discovered one could achieve any Atari color by use of a SETCOLOR 0 to 3 or POKE 709 to 711 command to change each respective character. No more would I have to sheepishly explain to those not-of-the-computer-persuasion why my apostrophe or my "I" was blue while my text was red!

So much for cosmetics. If you are not bothered by the inconsistent color text problem, then use the last two paragraphs as speed-reading exercises. However, if you have purchased software such as Iridis 2 or Datasoft's Character Generator, you may already have thought of the second application. Instead of redefining one's lower case (and thereby "losing" it) to achieve new characters, one may use "hidden graphics" to redefine the number set, selected punctuation marks, or arithmetic signs. While this could be done normally, using "hidden graphics" allows one to display numbers, punctuation, or signs in four colors instead of only two! (If you have not run the above program yet, try it. Then try to produce four different color I's the conventional way.)

A Second Approach

Now enter and run the following program:

10 X = 0: Y = 0: Z = 65
20 GR. 2 + 16
30 FOR AZ = 0 TO 25
40 SOUND 0, 255-AZ * 10, AZ + 8,8
50 COLOR Z
60 PLOT X,Y:IF X = 18 THEN X = 0: Y = Y + 170 X = X + 1 : Z = Z + 1
80 FOR W = 1 TO 50 : NEXT W
90 NEXT AZ
100 IF Z = 91 THEN Z = 193 : X = 0 : Y = 2 : GOTO 30
110 IF Z = 219 THEN Z = 225 : X = 0 : Y = 4 : GOTO 30
120 IF Z = 219 THEN Z = 225 : X = 0 : Y = 6 : GOTO 30
130 FOR W = 1 TO 500 : NEXT W
140 POSITION 2,9 : PRINT #6; "COLOR
    STATEMENT"
150 PRINT #6; "GRAPHICS!"
160 FOR W = 1 TO 1000 : NEXT W

If you are trying to figure out how we got all those alphabet characters using PLOT and COLOR statements, read on.

As any intermediate programmer can tell you, one cannot plot points in modes 1 and 2. you get absolutely nothing displayed if you try it. Of course the stumbling beginner might think the reason one gets nothing is that one did not enter a COLOR statement. Sandwiching COLOR 1 between the lines and trying again, he discovers that he has plotted an "!" instead of a point. "Pixel-head!" he chides himself. "You can't use PLOT in modes 1 and 2!" He notes this in his reference manual and ranks himself a step closer to intermediate programmer, missing the opportunity to discover more hidden graphics.

The Atari will plot a character in modes 1 and 2 at whatever position the programmer commands. The nature and color of that character are determined by a single COLOR statement. Using the COLOR Statement Graphics Chart, you can display any Atari keyboard character (POKE 756 for lower case) by using the associated COLOR statement, then plotting X,Y coordinates to place it at the desired position on the screen.

Once again, SETCOLOR 0 to 3 or POKE 709 to 711 can be used to color each individual character, including lower case characters which are normally limited to only two colors. (Note: these SETCOLOR's and POKE's work only when using GR. 1 or 2 + 16.) Again, redefined characters may be used and this time manipulated arithmetically. Game-writers, rejoice!

While the PRINT #6; approach displays numbers, punctuation and arithmetic signs, the COLOR/PLOT technique allows access to upper and lower case letters as well. Preference for one method over the other will vary from user to user and application to application, as you will see once you have tried them a few times.

Table A. "HIDDEN GRAPHICS" CHART
To Get Character Press CTRL + Key Character (Default) SE. POKE
0 P normal yellow 0 708
1 Q "hidden" green 1 709
2 R inverse,
3 S normal blue 2 710
4 T inverse,
5 U "hidden" red 3 711
56 V
7 W
8 X
9 Y
: Z
! A
" B
# C
$ D
% E
& F
' G
( H
) I
* J
+ K
' L
- M
. N
/ O
[ ;
@ .
Other Color* Press Keys
^ green ESC then DELETE · BACKS
red ESC then CTRL + DELETE · BACKS
< green ESC then CTRL + | -
red ESC then SHIFT + DELETE · BACKS
> green ESC then CTRL + —
red ESC then CLR · SET · TAB
= green ESC then CTRL + | =
red ESC then SHIFT + INSERT · >
? green ESC then CTRL + —*
red ESC then SHIFT + CLR · SET · TAB
- green ESC then CLR · SET · TAB
red ESC then CTRL + INSERT · >
; green ESC then ESC
] red ESC then CTRL + ".2
* greens manipulated by SE.1 and POKE 709 reds manipulated by SE.3 and POKE 711
Table B. COLOR STATEMENT GRAPHICS CHART
Use Color Number
To Get SE. 0 1 2 3
Character POKE 708 709 710 711
green yellow red blue
! 1 33 129 161
" 2 34 130 162
# 3 35 131 163
! 4 36 132 164
% 5 37 133 165
& 6 38 134 166
' 7 39 135 167
( 8 40 136 168
) 9 41 137 169
* 10 42 138 170
+ 11 43 139 171
' 12 44 140 172
- 13 45 141 173
. 14 46 142 174
/ 15 47 143 175
0 16 48 144 176
1 17 49 145 177
2 18 50 146 178
3 19 51 147 179
4 20 52 148 180
5 21 53 149 181
6 22 54 150 182
7 23 55 151 183
8 24 56 152 184
9 25 57 153 185
: 26 58 154 186
; 27 59 * 187
< 28 60 * 188
= 29 61 157 189
> 30 62 158 190
? 31 63 159 191
@ 96 224 * 192
[ 91 123 219 251
] 93 * 221 253
\ 92 124 220 252
^ 94 126 222 254
- 95 127 223 255
A 97 65 225 193
B 98 66 226 194
C 99 67 227 195
D 100 68 228 196
E 101 69 229 197
Table C. COLOR STATEMENT GRAPHICS CHART (Cont.)
Character Color Number
green yellow red blue
F 102 70 230 198
G 103 71 231 199
H 104 72 232 200
I 105 73 233 201
J 106 74 234 202
K 107 75 235 203
L 108 76 236 204
M 109 77 237 205
N 110 78 238 206
O 111 79 239 207
P 112 80 240 208
Q 113 81 241 209
R 114 82 242 210
S 115 83 243 211
T 116 84 244 212
U 117 85 245 213
V 118 86 246 214
W 119 87 247 215
X 120 88 248 216
Y 121 89 249 217
Z 122 90 250 218
*Writing color statements that would logically appear in these positions displays nothing on the screen.

Atari Program Listings

COMPUTE! is starting a new, standardized Atari program listing format. All the editing and cursor-control characters are spelled out (e.g., CLEAR for clear screen) and surrounded by brackets.

Other characters, such as CTRL-T, the "ball" character, will be listed as the "normal" character within brackets: {T}. A series of identical control characters will be indicated by a number within the brackets, e.g. 5 DOWN for five cursor downs and 12 R for twelve CTRL-R's. Two control characters, {=} and {-} should be shifted. Any reverse-field text will be enclosed in vertical lines, | like this |. (Press the Atari logo key for each vertical line.) We expect that this convention will permit easy, unambiguous program typing.