Visions (Graphics 9 Demo)

Type
Graphics
Category
GTIA shaded line-art demo
Author
Michael Metz
Published in
Antic, October 1986 (Vol. 5, No. 6), Tech Tips
Year
1986
Language
Atari BASIC
Requirements
GTIA chip (any XL/XE, or a 400/800 with GTIA), 16K RAM, Atari BASIC
A GRAPHICS 9 pattern in shades of gold on a dark background: two bright diamond shapes stacked in the middle, framed by fans of lines that fade from bright to dark toward the corners

About the program

Antic's Tech Tips page for October 1986 opened with "two pleasing graphics demonstrations". The first, VISIONS.BAS, came from Michael Metz of St. Clair, Michigan, who was 17 and called himself a computer graphics "freak". He had been programming his Atari since he was 14. In twelve lines it fills a GRAPHICS 9 screen with mirrored fans of lines in sixteen shades, which meet as a pair of glowing diamonds. The whole picture keeps shifting colour as it's drawn. (The other demo on the page was the Salt Lake City ACE club's Rainbow Fan.)

What you need

A GTIA machine, which means any XL or XE, or a 400/800 fitted with the GTIA chip. GRAPHICS 9 doesn't work on the older CTIA chip.

Typing it in

It's plain text with no special characters. Press BREAK to stop. The program redraws for ever, starting a fresh screen after each pass.

How it works

  • GRAPHICS 9 gives 80 × 192 pixels with 16 brightness levels of a single hue, which is set by the background register (SETCOLOR 4,hue,0).
  • The loop runs I from 1 to 79 while X climbs by one each time. Lines 40–70 draw four lines per step: two horizontal ones mirrored top and bottom, and two diagonals crossing between them. Together they build the symmetrical fans.
  • COLOR I/2.5 sets the brightness. Only the low four bits of the colour number count, so the shade climbs from 0 to 15 twice across the screen. That gives the two bright bands.
  • Line 30 calls SETCOLOR 4,C,0 with a new hue C on every step. In GRAPHICS 9, changing that one register re-colours the whole screen at once, so the picture cycles through all 15 hues as it grows. Each new pass starts with the next colour.
  • Line 100 pauses before GOTO 10 clears the screen and starts again.

Variations to try

  • Delete SETCOLOR 4,C,0 from line 30 and add SETCOLOR 4,9,0 to line 10 for a steady blue picture.
  • Change 2.5 in line 30 to 5 for a single smooth ramp of brightness.

Listing

1 REM VISIONS
2 REM BY MICHAEL METZ
10 GRAPHICS 9:FOR I=1 TO 79
20 C=C+1:IF C>15 THEN C=1
30 SETCOLOR 4,C,0:COLOR I/2.5
40 PLOT I,X:DRAWTO 79-I,X
50 PLOT I,190-X:DRAWTO 79-I,190-X
60 PLOT 79-I,X:DRAWTO I,190-X
70 PLOT 79-I,190-X:DRAWTO I,X
80 X=X+1:IF X>190 THEN X=0
90 NEXT I
100 FOR D=1 TO 700:NEXT D:GOTO 10

Download

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

Credits