Etch-Atari
Roy Glover
This brief review of Atari's GTIA graphics includes a joystick sketch program to draw on screen and examine the visual potential of this powerful computer.
After months of rumors about a display chip that would "someday replace the present one" in the Atari 400 and 800 computers, Atari introduced the GTIA.
CTIA And ANTIC
Before taking a close look at the GTIA itself, let's review Atari's graphics and display system. There are two integrated circuits in the Atari which generate the television display: the CTIA and the ANTIC. The CTIA contains the circuitry which actually displays the data according to the information given to it by the ANTIC, which is a microprocessor dedicated to interpreting the video instructions of the computer program. In other words, your program tells ANTIC what to display, and ANTIC tells CTIA how to display it on the screen.
CTIA offers 14 display modes. Nine of these modes are directly accessible from BASIC, the other five only from machine language. Of the nine BASIC modes, there are three character (text) modes and six graphics (plotted point) modes. GRAPHICS 8, the highest resolution graphics mode, is made up of 320 pixels (picture elements) horizontally and 192 pixels vertically. That is, a GRAPHICS 8 display is composed of 61,440 plotted points (pixels), all restricted to one color and to one of two luminances. Each pixel is either on or off.
Additional Graphics Modes With GTIA
Early in 1982, Atari began replacing the CTIA in 400 and 800 computers with the GTIA chip. The two perform the same tasks and are identical, except that the GTIA offers three additional graphics modes: BASIC modes GRAPHICS 9, 10, and 11.
All three new graphics modes have the same resolution: 80 pixels horizontally and 192 pixels vertically. The pixels are the same height, but four times as wide as pixels in GRAPHICS 8.
GRAPHICS 9 allows each pixel to be displayed with any one of 16 luminances, while all pixels displayed are restricted to the same hue.
GRAPHICS 11 allows each pixel to be displayed with any one of 16 hues, while all pixels displayed are restricted to the same luminance.
GRAPHICS 10 allows each pixel to be displayed with any one of nine hue and luminance combinations.
Using GRAPHICS 9 and 11 is similar to using GRAPHICS 3, 5, and 7. In GRAPHICS 9 the luminance of each pixel displayed can be changed by specifying COLOR 0 through COLOR.15. Using SETCOLOR 4,H,0, where H is a number from 0 to 15, the hue of all pixels plotted will be changed.
In GRAPHICS 11, COLOR 0 through COLOR 15 specify the hue of each pixel displayed, while SETCOLOR 4,0,L, with L being from 0 to 15, changes the luminance of all pixels plotted. GRAPHICS 10 requires POKEing values of hue and luminance directly into the nine color registers.
Joystick Sketching
Try the program "Etch-Atari," which enables you to draw on the screen using a joystick. When the program is run, a prompt asks you to select GRAPHICS 9 or 11 and a hue or luminance, respectively. Then a bar appears across the bottom of the screen showing the color you will be drawing with. To change color, press the SELECT key. If you hold it down, the bar will step through the colors. The OPTION key turns the bar off or on. If the bar is off and the SELECT key is pressed, the bar will be turned back on so you can see which color is selected. To clear the screen and start over without returning to the menu, simply press START.
The drawing point starts at the center of the screen. To reposition the point without drawing, press the trigger button while moving the joystick. This also allows you to trace over and erase points already drawn.
A Sample drawing for "Etch-Atari"If the joystick is not moved for more than nine minutes, the computer will go into the attract mode (the screen will start changing colors). As long as you are drawing, the attract mode will be defeated.
If you run into the border, a thumping sound will be heard, letting you know that you cannot go any further in that direction. If you feel that the drawing speed is too slow, remove the sound statement at line 90.
If you would like the program to start automatically after loading, save it with SAVE "C:" and reload-it with RUN "C:". If you choose CSAVE and CLOAD, line 1000 can be omitted.
Etch-Atari
5 GOTO 800 10 GRAPHICS G:SETCDLOR 4,H,L 15 C=1 : COLOR C 20 GOSUB 620 30 X=40:Y=96 40 S=STICK(0):IF S=15 THEN SOUND 0,0,0,0 : SOUND 1,0,0,0 50 IF S<15 THEN POKE 77,0 : REM Defeat attract mode while drawing 60 IF PEEK(53279)=6 THEN GOTO 10:REM Check START 70 IF PEEK(53279)=5 THEN GOSUB 600:REM Check SELECT 80 IF PEEK(53279)=3 THEN GOSUB 700:REM Check OPTION 90 SOUND 0, X*RND(0), 12, 2 : SOUND 1,Y*R ND(0), 12, 2 100 IF S=14 THEN Y=Y-1 : N=Y+1 : M=X 110 IF S=6 THEN X=X+1 : Y=Y-1 : M=X-1 : N=Y+1 120 IF S=7 THEN X=X+1 : M=X-1 : N=Y 130 IF S=5 THEN X=X+1 : Y=Y+1 : M=X-1 : N=Y-1 140 IF S=13 THEN Y=Y+1 : N=Y-1 : M=X 150 IF S=9 THEN X=X-1 : Y=Y+1 : M-X+1 : N=Y-1 160 IF S=11 THEN X=X-1 : M=X+1 : N=Y 170 IF S=10 THEN, X=X-1 : Y=Y-1 : M=X+1 : N=Y+1 200 IF X>78 THEN X=78 : GOSUB 400 : REM Set plot limits-Sound warning 210 IF X<1 THEN X=1 : GOSUB 400 220 IF Y>187 THEN Y=187 : GOSUB 400 230 IF Y<1 THEN Y=1 : GOSUB 400 240 COLOR C : PLOT X, Y 250 IF STRIG (0)=0 THEN COLOR 0 : PLOT M, N 260 GOTO 40 400 FOR F=10 TO 0 STEP -1 405 SOUND 2, 20*F, 12, F 410 NEXT F 415 RETURN 600 C=C+1 610 IF C>15 THEN C=1 620 Z=C 630 COLOR Z 640 PLOT 1, 189: DRAWTO 78, 189:PLOT 1, 190: DRAWTO 78, 190: PLOT 1, 191 : DRAWTO 78, 191 650 FOR W=1 TO 20 : NEXT W 660 RETURN 700 IF Z> THEN Z=0 : GOTO 630 710 IF Z=0 THEN Z=C : GOTO 630 800 GRAPHICS 0 805 POKE 752, 1 : REM Disable cursor 810 POKE 710, 2 : REM Background grey 815 ? : ? 820 ? "{13 SPACES} " 825 ? : ? 830 ? " : Clears screen and postions" 835 ? "{8 SPACES} cursor at center." : ? 840 ? " : Selects color of next" 845 ? "{8 SPACES} point drawn (color of bar" 850 ? "{8 SPACES} at bottom of screen).":? 855 ? " : Turns color bar off or on." :? 860 ? "Press Trigger button to re-position" 865 ? "cursor without drawing, and to erase" 870 ? "over points already drawn." :? 875 ? "Select GRAPHICS or " 880 ? "and " : TRAP 885 : INPUT G : TRAP 40000 885 IF G<>9 AND G<>11 THEN ? "{3 UP} (3 DEL LINE}" : GOTO 875 : REEM (3 ESC CTRL UP) (3 ESC SHFT DEL) 890 ? 895 IF G=9 THEN ? "Select Hue to " : ? "and " : TRAP 900 : INPUT H : L=0 : TRAP 40000 900 IF H>0 OR H>15 THEN ? "{3 UP} {3 DEL LINE}" : GOTO 895 905 IF G=11 THEN ? "Select Luminance to "; :? " and " :TRAP 910: INPUT L : H=0 : TRAP 40000 910 IF L<0 OR L>15 THEN ? "{3 UP} {3 DEL LINE}" : GOTO 905 915 ? "{CLEAR}" : POSITION 15, 11 920 ? " Press " 925 IF PEEK (53279)=6 THEN GOTO 10 : REM Check START 930 GOTO 825 1000 RUN "C:"