Three-Color Demo

Type
Graphics
Category
GRAPHICS 7 line-art demo
Author
Masahiro Mori
Published in
Antic, September 1984 (Vol. 3, No. 5), I/O Board letters page ("More from Mori")
Year
1984
Language
Atari BASIC
Requirements
Any Atari 8-bit, Atari BASIC
A GRAPHICS 7 screen: the top half already flooded with solid green, the bottom half still showing the dark blue moire of fanned lines, red and black dotted interference patterns and a green diamond lattice in the centre

About the program

Masahiro Mori of Taichung, Taiwan, was a regular contributor to Antic in 1984. His "Colors From Taiwan" demos had appeared in March, and his educational game Mole Attack followed in October. In between, the magazine's letters page printed this short note: "I have written a graphics program in mode 7, called 'Three-Color Demo.' I hope you enjoy this." It is a nice example of how much a few loops of PLOT and DRAWTO can do.

What you need

Any Atari with Atari BASIC. No GTIA needed.

Typing it in

Plain ASCII, 26 lines. Line 180 says PLOT O,I with the letter O instead of zero. O is never set, so it is 0 and the line works, but type it as shown if you want the exact listing. The program ends in an endless loop at line 260. Press BREAK to stop.

How to use it

RUN it and watch. It draws in four stages on a full-screen GRAPHICS 7 display (GRAPHICS 7+16, 160×96 with no text window):

  1. Colour 1 (lines 20–40): two sets of lines fan out from the left and right edges to the middle of the opposite side, every 5 pixels. Where they cross they make moiré patterns.
  2. Colour 2 (lines 60–90): nested diamonds around the centre, plus cross-hairs.
  3. Colour 3 (lines 110–140): two families of tilted squares, each corner sliding along an edge, which weave a woven-looking border.
  4. The Atari logo (lines 150–250): the whole screen is filled with colour 2 line by line. Then, drawing in colour 0 (the background), the program "cuts" the three-pronged Atari symbol out of the middle: two curved outer bars (stepped outward by Q in lines 230–250) and a straight centre bar.

How it works

GRAPHICS 7 is a four-colour mode: the background plus colour registers 0–2, selected with COLOR 1, COLOR 2 and COLOR 3. Each new colour is drawn over the last, so the order of the stages decides what shows through. Drawing in COLOR 0 erases to the background colour, which is how the logo is cut out rather than drawn. Every shape comes from a single loop variable used in a few coordinate formulas. Try changing the STEP values to see very different patterns.

Listing

10 GRAPHICS 7+16:COLOR 1
20 FOR T=1 TO 159 STEP 5
30 PLOT T,0:DRAWTO 159,44:DRAWTO T,89:PLOT 159-T,0:DRAWTO 0,44:DRAWTO 159-T,89
40 NEXT T
50 COLOR 2
60 FOR I=1 TO 30 STEP 3
70 PLOT 79+I,44:DRAWTO 79,74-I:DRAWTO 79-I,44:DRAWTO 79,14+I:DRAWTO 79+I,44
80 NEXT I
90 PLOT 79,0:DRAWTO 79,14:PLOT 79,89:DRAWTO 79,74:PLOT 0,44:DRAWTO 79,44:PLOT 159,44:DRAWTO 79,44
100 COLOR 3
110 FOR I=1 TO 89 STEP 2
120 PLOT I,0:DRAWTO 159,I:DRAWTO 159-I,89:DRAWTO 0,89-I:DRAWTO I,0
130 PLOT 159-I,0:DRAWTO 0,I:DRAWTO I,89:DRAWTO 159,89-I:DRAWTO 159-I,0
140 NEXT I
150 REM ATARI LOGO MARK
160 COLOR 2
170 FOR I=0 TO 89
180 PLOT O,I:DRAWTO 159,I
190 NEXT I:COLOR 0
200 FOR I=30 TO 60 STEP 2
210 PLOT 68,I:DRAWTO 72,I:PLOT 76,I:DRAWTO 78,I:PLOT 82,I:DRAWTO 86,I
220 NEXT I
230 FOR I=60 TO 70 STEP 2:Q=Q+2
240 PLOT 68-Q,I:DRAWTO 72-Q,I:PLOT 76,I:DRAWTO 78,I:PLOT 82+Q,I:DRAWTO 86+Q,I
250 NEXT I
260 GOTO 260

Download

The original program from the Antic disk, to LOAD or ENTER instead of typing it: THREECOL.BAS.

Credits