1

GTIA: An Illustrated Overview

titlebar.gif

Louis and Helen Markoya


Type in these graphics demonstrations and see the startling displays made possible with the GTIA chip.

Have you ever seen computer-generated graphic displays that seem truly 3-D? The ones of landscapes or the ones of molecular structures? Have you ever wished you could generate similar graphics on your own machine? If so, and you own a 400 or 800, with the GTIA chip you're halfway there.

Modes 9, 10, and 11 are far from ordinary. They are called from BASIC by typing GRAPHICS 9, 10, or 11. They all offer the same screen resolution, 80 horizontal x 192 vertical, but different color selection.

GRAPHICS 9 offers 16 shades of any of the 16 colors, thus raising the machine's color capabilities to 256. GRAPHICS 10 offers the programmer a choice of 9 of any of the 128 colors normally offered by the Atari, and GRAPHICS 11 gives the ability to present 16 different colors in any of the 8 luminances (shades). For those who had the machine before this new addition, the authorized Atari service center nearest you should be stocking this part.

GTIA is Atari's television Interface Chip. It is completely compatible with the hardware and software previously available. The only problem arises when software relying on the GTIA modes is run on a computer without this chip. Something will go to the screen, but not the desired effect.

GTIA is controlled for the most part by ANTIC, a microprocessor dedicated to the screen display. The GTIA processes digital commands from ANTIC or the 6502 (in the case of an interrupt) into the signal that goes to the television. GTIA also handles the tasks of color, player/missile graphics, and collision detection.

GTIA adds powerful capabilities in graphics modes 9, 10, and 11. All modes are extensions of graphics mode 8 + 16, ANTIC Mode 15. The display list remains the same, and the new modes are selected by the Priority Register. This Operating System Shadow Register, called PRIOR, is located at decimal 623, hex 26E. Bits 6 and 7 control the GTIA modes. When both are zero, GTIA works exactly the same as CTIA. When only bit 6 is set, GRAPHICS 9 is called; when only bit 7 is set, GRAPHICS 10 is called; and when both bits 6 and 7 are set, GRAPHICS 11 is called.


GRAPHICS 9

Setting bit 6 of PRIOR produces GRAPHICS 9, giving 16 luminances of one color. ANTIC provides the pixel data, and the background register, 712, is used to select your color (POKE 712, Color * 16 or SETCOLOR 4, Color,0). Each screen byte is broken in half for screen formatting. A display block is four pixels across by one pixel down. Each four bits represents 16 color choices. The number you choose (0-15) in your COLOR statement equates the luminance value you wish to use. Here's a simple BASIC program used to demonstrate this:

10 GRAPHICS 9:REM GRAPHICS MODE 9 (16 SHADES OF ONE COLOR)
20 SETCOLOR 4,6,0:REM SET BACKGROUND REGISTER TO COLOR DESIRED (PURPLE)
30 FOR I=0 TO 15:REM SET UP VARIABLE FOR BOTH COLOR (SHADE) AND POSITION
40 COLOR I:REM SHADE OF COLOR
50 PLOT I,0:REM PLOT FROM UPPER LEFT CORNER
60 DRAWTO I,191:REM DRAWTO LOWER LEFT CORNER
70 NEXT I:REM NEXT SHADE AND NEXT LINE
80 GOTO 80:REM HOLD SCREEN

The wide choice of luminances or shades available here will be particularly useful for shading objects to give the impression of bas-relief or the third dimension. With some background in perspective and lighting, a person could create scenes with a great illusion of depth, realistic or contrived.


GRAPHICS 10

GRAPHICS 10 is called when bit 7 of PRIOR is set to one and bit 6 to zero. This mode uses all nine of the Atari's color registers found at decimal 704-712 (hex 2C0 through 2C8). Any 9 of the 128 colors normally available to your computer could be used in this mode by simply POKEing the desired color (remember, 16 * Color + luminance) into each register or POKEing the desired color into the player/missile registers (704 through 707), using SETCOLOR statements for the playfield and background registers.

COLOR 0 represents the background and is located at decimal register 704, colors (for COLOR statements) 1-8 follow in order from 705-712. The big advantage to mode 10 is that any of the colors you choose can be changed independently of the others. For example, once a scene is created, you could change the color of the sky from dark to light blue very easily (FOR I = 128 TO 144: POKE 704,1: NEXT I). This will rotate the background color smoothly through its eight shades. You may wish to add a loop to delay the color change. Playfield or player/missile colors can be changed at any time. Also, special effects and animation could be achieved by rotating the values in all these registers.

Program 1 draws a border around the screen in eight colors (first register is used for background) and then rotates the colors to give a theater marquee effect. To display even more of this mode's capabilities, add the following lines:

185 A=96:REM SETS A VARIABLE FOR THE BACKGROUD 
272 A=A+1:POKE 704,A:REM CHANGES BACKGROUND COLOR 
275 IF A=255 THEN A=1:REM ALLOWS ONLY GOOD COLOR VALUES

These additional lines will rotate the background color through all its possibilities while the border is rotating.


GRAPHICS 11

Mode 11 operates similarly to mode 9. The difference is that only one luminance or shade is used, and a choice of all 16 colors is given. Bits 6 and 7 are set to one for this mode. Again, the background register is used for the colors, with ANTIC supplying the data. COLOR 0-15 relates exactly to the COLOR segment in the SETCOLOR command. To initiate this mode, you must choose the luminance or shade you want. The color would be set by your COLOR statement (SE. 4,0,0-15 Lum choice). The background is always COLOR 0 (black). This mode allows fine color blending to produce rainbow effects and therefore a wider color choice for picture making.

Program 2 draws a cross in 16 colors, again using a 1 x 1 display block, and then draws an ellipse in 16 colors around the center of the cross. This program shows the versatility of color use in mode 11. No longer are we restricted to horizontal screen architecture for extra color with Display List Interrupts.


GRAPHICS 9

Program 3 draws a landscape and a simple molecular structure floating high above it. This display truly gives the impression of depth and shows what can be done using light and shadow in Graphics mode 9.

These demos are only an introductory hint of the spectacular effects possible via GTIA. You could add more color to modes 9 and 11 by using players and missiles or create dramatic effects by switching between these modes (or with GRAPHICS 8) by POKEing PRIOR with the desired value.


Program 1. GRAPHICS 10 Demonstration

Download P023L1.BAS (Saved BASIC)
Download / View P023L1.LST (Listed BASIC)

Program 2. GRAPHICS 11 Demonstration

Download P023L2.BAS (Saved BASIC)
Download / View P023L2.LST (Listed BASIC)

Program 3. GRAPHICS 9 Demonstration

Download P023L3.BAS (Saved BASIC)
Download / View P023L3.LST (Listed BASIC)

Return to Table of Contents | Previous Section | Next Section