Classic Computer Magazine Archive ANTIC VOL. 3, NO. 5 / SEPTEMBER 1984

STARTING OUT

UNLOCKING THE 56 GRAPHIC MODES

Instant exploration of Atari's display styles

By PAUL CHABOT

SYNOPSIS
Introducing Atari's full range of graphics modes.  With accompanying BASIC program that gives you instant display of all 56 modes.  Runs on all Atari computers of all memory configurations.  For Antic Disk subscribers: Type RUN"D:ALLMODES.BAS"

Why did you buy an Atari computer?  The chances are good that, in addition to its other fine qualities, you were attracted by the unmatched ability to create computer color graphics.
   Atari home computers are outstanding for graphics because they all feature, in addition to the 6502 central microprocessor, another chip called ANTIC (sound familiar?) that's dedicated solely to handling the Atari's video screen display.
   The ANTIC chip can display data in 14 different formats, called graphics modes.  The accompanying chart lists all 14, along with information about each.  Some of these, such as Graphics 0, are text modes, which means that the data in memory must be represented as characters (numbers, letters, and symbols).  Others, such as Graphics 7, tell the computer to display memory data as a picture.
   In addition to the 14 ANTIC modes, there are three additional graphics modes that are controlled by yet another special chip, GTIA (George's Television Interface Adaptor).  These are Graphics 9, 10, and 11.  Here is what happens when you call up one of these GTIA modes in a program.  The Atari first sets up a full screen display of Graphics 8, then alters memory location 623.  If you call Graphics 9, then 64 is added to the contents of location 623.  If you call Graphics 10, then 128 is added to this location.  Calling Graphics 11 adds 192.  The accompanying chart provides more details.
   Thus, you see that GTIA has four states controlled by location 623, and accessible by the values 0, 64, 128, and 192.  Each of ANTIC's 14 graphics modes can be altered by GTIA's four states for a grand total of 56 modes.  Of course, some of these modes are ugly and others are are simply useless.  There are, however, many valuable modes.
   The accompanying program sets up a sample text display, then allows you to view it in all 56 graphics modes.  The display won't be recognizable in every graphics mode, but you'll get an instant demonstration of how the same data is interpreted in the different modes.

HOW TO USE THE PROGRAM
Type in the BASIC listing and test it with TYPO.  SAVE an extra backup copy, then RUN it.  It will produce a Graphics 2 screen display with a menu in the text window.  Use the number keys [0]-[8] to change the display mode.  Keys [A]-[E] produce additional modes that are supported directly by the XL series, but that require special programming to be used by 400/800 computers (see accompanying chart).
   Press [G] to cycle GTIA through its four states.  The [S] key changes the memory area that gets mapped to the screen.  Feel free to roam around and watch your Atari think by typing in addresses such as 1536, 53760, 53960, 0, and 40520.  The [R] key gets you home again.
   ALLMODES was created to demonstrate and explore the graphics capabilities of the Atari.  Feel free to hit [BREAK] at any time and enter immediate-mode commands.  For example, try POKEing various values directly into the color registers 704-712.  If the GTIA isn't in its initial state, you'll have difficulty reading the text window.  After using the immediate mode, type CONT [RETURN] to resume program execution.  Typing [R] returns you to the menu.

SIZE CHANGES
Notice that besides changing the display, your selections cause the display area to shrink or expand.  This is why it happens:
   When you look at your video display, you're actually seeing a beam of electrons sweeping across the screen, left to right.  Every time the beam reaches the right edge of the screen, it is turned off and moved down slightly, where it will sweep across the screen again.  The result of each sweep on the screen is called a scan line.  The standard Atari full-screen display holds 192 scan lines and is re-drawn every 1/60 of a second.
   An Atari display combines scan lines into mode lines, units of one to 16 scan lines - depending on which graphics modes you're using.
   Graphics 2, the mode we started with, has 10 mode lines.  Each of its mode lines contains 16 scan lines, for a total of 160 scan lines, which results in a fairly full screen.  ALLMODES retains this format of 10 mode lines when it displays any of the 56 graphics modes.  However, a graphics mode might contain as few as one scan line per mode line.
   For more information on how to control the Atari video display, see "Display Lists Simplified" (Antic, Feb/Mar 1983).

GTIA
When called from BASIC, GTIA modes 9,10, and 11 use a configuration similar to Graphics 8 and use the same amount of screen memory.  Because of the difference in pixel shape, however, there are 80 pixels per row in GTIA.  These three GTIA modes can be combined with the other modes by POKEing location 623 as follows:
GTIA  9 - POKE 623,64
GTIA 10 - POKE 623,128
GTIA 11 - POKE 623,192

COLOR ACCESS:
GTIA  9 - POKE hue into 712
          Use BASIC COLOR command
          0-15 for the shade
GTIA 10 - POKE hues and intensities
          into 704-712 Use BASIC COLOR
          command 0-15 for the color
GTIA 11 - POKE 712,0-14 for luminance.
          Use BASIC COLOR command 0-15
          for hue.
 

ATARI GRAPHICS MODES AND SCREEN FORMATS

ANTIC  BASIC    MODE  BYTES/  COLUMNS  ROWS  ROWS   SCAN LINES/  # OF   SCREEN RAM
MODE   MODE     TYPE   LINE          (SPLIT) (FULL) MODE LINE   COLORS   REQUIRED

2     GR.0      TEXT    40      40      -      24       8          1*     960
3     NONE      TEXT    40      40      -       +      10          1*       +
4     GR.12(XL) TEXT    40      40     20      24       8          5      960
5     GR.13(XL) TEXT    40      40     10      12      16          5      480
6     GR.1      TEXT    20      20     20      24       8          5      480
7     GR.2      TEXT    20      20     10      12      16          5      240
8     GR.3      GRAPH   10      40     20      24       8          4      240
9     GR.4      GRAPH   10      80     40      48       4          2      480
A     GR.5      GRAPH   20      80     40      48       4          4      960
B     GR.6      GRAPH   20     160     80      96       2          2     1920
C     GR.14(XL) GRAPH   20     160    160     192       1          2     3840
D     GR.7      GRAPH   40     160     80      96       2          4     3840
E     GR.15(XL) GRAPH   40     160    160     192       1          4     7680
F     GR.8      GRAPH   40     320    160     192       1          1*    7680

NOTES:
* One color, two luminances
+ User determined.  Please see the article in this issue "ANTIC'S MODE 3."

Paul Chabot is a professor of mathematics and computer science at California State University in Los Angeles.

Listing: ALLMODES.BAS Download