ArtMaker

Type
Graphics
Category
GRAPHICS 10 pattern generator for paint programs
Author
Leonard Buchanan
Published in
Antic, July 1986 (Vol. 5, No. 3)
Year
1986
Language
Atari BASIC (with a tiny machine-language CIO call)
Requirements
GTIA chip (any XL/XE, or a 400/800 with GTIA), Atari BASIC, disk drive; a paint program such as Micro-Illustrator to use the pictures
Two GRAPHICS 10 screens side by side: a cityscape with a green sky, brown tower blocks and a perspective grid running to a vanishing point, and a dense diamond-shaped moire Eye of God pattern in purple and green

About the program

Antic introduced ArtMaker with a tale "from the computer graphics Twilight Zone": Joseph T. Atari-Hacker buys every paint program on the market, then sits up nights with a joystick in his fist and lightpens behind his ears, moaning "I am an artist!" He can't draw. Leonard Buchanan's point was that paint software keeps your circles round but can't supply the detail a good picture needs. What the Atari is good at is computing hundreds of perfectly spaced lines, like the moiré patterns of Broderbund's Print Shop.

So Buchanan and his son wrote a program that does the detailed work. It draws one of seven patterns in GRAPHICS 10 (GTIA's nine-colour mode) and saves it as a picture file you can finish in a paint program:

  1. Cityscape: perspective lines and randomly built towers, different every time.
  2. Eyeframe: a border shaped like an eye.
  3. Eye of God: an elaborate Navajo ceremonial pattern.
  4. Fresco: a Grecian border along the top and bottom.
  5. RNDcolor: randomly coloured pixels everywhere.
  6. Textures: free-flowing patterns. Change the letters in the string or the value of Z for thousands more, as the REMs explain.
  7. TVframe: an Eye-of-God border in the shape of a TV screen.

Typing it in

Line 94 contains a short machine-language routine in a string, "hhh{inv}*{/inv}LV{inv}d{/inv}": the inverse characters ({inv}…{/inv}, press the Atari key before and after) are part of the code, so type them exactly. The rest is plain. The REMs in each pattern routine suggest values to change. The magazine printed TYPO II codes.

How to use it

Type the number of a pattern and press RETURN. When the picture is finished, press START to save it as D:PICTURE, or OPTION to return to the menu. Buchanan chose that name because Micro-Illustrator (the software sold with the KoalaPad and the Atari Touch Tablet) loads a 62-sector file called PICTURE when you press CLEAR. The same file format works with Micro-Painter-compatible programs. Saving overwrites the last PICTURE, so rename each file you want to keep.

How it works

  • Eye of God (lines 300–380) draws lines from each corner of the screen to points stepping along the opposite edges, changing colour on every line. The overlapping lines create the moiré diamonds.
  • RNDcolor (lines 500–560) prints random character codes to the graphics screen with PRINT #6, which sets each pixel to a random colour. Code 125 is skipped because it would clear the screen.
  • Saving (lines 90–94) opens the file, then POKEs a "put bytes" command (11), the screen address from locations 88–89 and a length of 30 × 256 bytes into the I/O control block for channel 1, which starts at location 848. It then calls the routine in the string, which is just PLA:PLA:PLA:TAX:JMP CIOV, the operating system's central I/O entry. So the whole 7,680-byte screen is written in one call instead of with thousands of PUTs.

Listing

10 REM ARTMAKER
20 REM BY LEONARD BUCHANAN
30 REM (c) 1986, ANTIC PUBLISHING
35 GRAPHICS 0:? ,"   ARTMAKER":? :? "AVAILABLE SCREENS:":?
40 ? "(1) CITYSCAPE","(2) EYEFRAME"
45 ? "(3) EYEOFGOD","(4) FRESCO"
50 ? "(5) RNDCOLOR","(6) TEXTURES"
55 ? "(7) TVFRAME"
56 POSITION 2,19:? "Choose a screen.":? "Once it appears,":? "press [START] to SAVE it ";
57 ? "(D:PICTURE)"
58 ? "or [OPTION] to return to this menu."
60 TRAP 35:POSITION 2,10:? "YOUR CHOICE";:INPUT CHOICE
65 TRAP 40000
70 ON CHOICE GOSUB 100,200,300,400,500,600,700
75 FOR X=1 TO 100 STEP 2:SOUND 0,X,14,14:NEXT X:SOUND 0,0,0,0
80 IF PEEK(53279)=3 THEN 35
85 IF PEEK(53279)=6 THEN 90
86 GOTO 80
90 CLOSE #1:OPEN #1,8,0,"D:PICTURE"
92 IO=848:POKE IO+2,11:POKE IO+4,PEEK(88):POKE IO+5,PEEK(89):POKE IO+8,0:POKE IO+9,30
94 JNK=USR(ADR("hhh{inv}*{/inv}LV{inv}d{/inv}"),16):CLOSE #1:GOTO 35
100 REM CITYSCAPE DESIGN
105 GRAPHICS 10:COLOR 4:Y=80:Z=0
110 FOR N=1 TO 14:PLOT 50,80:DRAWTO 0,Y:DRAWTO 79,Y:DRAWTO 50,80:Z=Z+0.3:Y=Y+Z*Z:NEXT N
115 FOR X=5 TO 75 STEP 8:PLOT X,179:DRAWTO 50,80:NEXT X
120 COLOR 6:PLOT 79,79:DRAWTO 79,0:DRAWTO 0,0:POSITION 0,79:POKE 765,6:XIO 18,#6,0,0,"S:"
125 FOR BUILDINGS=1 TO 5
130 X=50-7*BUILDINGS:Y=INT(RND(0)*80)+80:Y2=90-(Y-80)
135 COLOR 5:PLOT X,Y:DRAWTO X,Y2:PLOT X-1,Y+1:DRAWTO X-1,Y2-2
140 COLOR 6:PLOT X-2,Y+3:DRAWTO X-2,Y2-1:PLOT X-3,Y:DRAWTO X-3,Y2
145 X=55+7*BUILDINGS/2:Y=INT(RND(0)*80)+80:Y2=90-(Y-80)
150 COLOR 6:PLOT X,Y:DRAWTO X,Y2:PLOT X-1,Y+1:DRAWTO X-1,Y2-2
155 COLOR 5:PLOT X-2,Y+3:DRAWTO X-2,Y2-2:PLOT X-3,Y:DRAWTO X-3,Y2
160 NEXT BUILDINGS
165 RETURN
200 REM EYEFRAME CREATES A BORDER
205 REM SHAPED LIKE AN EYE. FOR SOME
210 REM INTERESTING EFFECTS, TRY
215 REM CHANGING THE VALUE OF Z.
230 GRAPHICS 10:Z=3.5
235 FOR X=0 TO 178 STEP Z:XCOL=X
236 IF XCOL=125 THEN XCOL=12
240 COLOR XCOL:PLOT 0,X:DRAWTO X/Z,179:PLOT 0,179-X:DRAWTO X/Z,0
245 PLOT 79,X:DRAWTO 79-X/Z,179:PLOT 79,179-X:DRAWTO 79-X/Z,0
250 NEXT X
255 RETURN
300 REM NAVAJO "EYE OF GOD" DESIGN
310 GRAPHICS 10:C=1
320 FOR Y=1 TO 90:COLOR C:PLOT 0,0:DRAWTO 79,179-Y:PLOT 0,179:DRAWTO 79,Y
330 PLOT 79,0:DRAWTO 0,179-Y:PLOT 79,179:DRAWTO 0,Y:C=C+1:IF C=16 THEN C=0
340 NEXT Y:C=1
350 FOR X=1 TO 40:COLOR C:PLOT 0,0:DRAWTO 79-X,179:PLOT 79,0:DRAWTO X,179
360 PLOT 0,179:DRAWTO 79-X,0:PLOT 79,179:DRAWTO X,0:C=C+1:IF C=16 THEN C=0
370 NEXT X
380 RETURN
400 REM FRESCO BORDER, TOP & BOTTOM
410 GRAPHICS 10:COLOR 5:Y=0:RESTORE 450
420 FOR Z=1 TO 2:READ Y:FOR X=1 TO 70 STEP 6
430 PLOT X,Y+6:DRAWTO X,Y:DRAWTO X+4,Y:DRAWTO X+4,Y+3:DRAWTO X+2,Y+3:DRAWTO X+2,Y+6:DRAWTO X+6,Y+6:DRAWTO X+6,Y
440 NEXT X:NEXT Z
450 DATA 5,173
460 RETURN
500 REM RANDOMLY-COLORED AREA
510 REM FOR A PICTURE
515 GRAPHICS 10
520 FOR DOWN=1 TO 179
525 FOR ACROSS=1 TO 78
530 Z=INT(RND(0)*256)
535 IF Z=125 THEN 530
545 POSITION ACROSS,DOWN:? #6;CHR$(Z);
550 NEXT ACROSS
555 NEXT DOWN
560 RETURN
600 REM "TEXTURES" A PATTERN MAKER
605 REM BY CHANGING THE LETTERS IN
610 REM Z$, OR THE VALUE OF Z (2-38)
615 REM YOU CAN CREATE THOUSANDS OF
620 REM DIFFERENT BACKGROUND TEXTURES
625 REM FOR YOU  PICTURES. OR,
630 REM OR, REMOVE THE "REM" STATEMENTS
635 REM FROM LINES 655 AND 665 AND
640 REM YOU'LL GET A NEW PATTERN
645 REM EACH TIME YOU PRESS [SELECT]
650 TRAP 655:GRAPHICS 10:Z=38:DIM Z$(39),T$(39)
655 REM Z=INT(RND(0)*36)+2
660 Z$="{inv}ANTIC{/inv} Magazine<<==>>The {inv}ATARI{/inv} Resource"
665 REM FOR X=1 TO 39:Z$(X,X)=CHR$(INT(RND(0)*124)):NEXT X
670 FOR Y=1 TO 179:FOR X=1 TO 2:? #6;Z$;:NEXT X:? #6:T$=Z$(Z,LEN(Z$)):T$(LEN(T$)+1)=Z$(1,Z-1):Z$=T$:NEXT Y
671 TRAP 40000
675 RETURN
700 REM DRAWS A BORDER SHAPED LIKE
710 REM A TV SCREEN
720 GRAPHICS 10:Y=0.5
730 FOR X=0 TO 178 STEP 2:COLOR X:Y=Y*1.055:PLOT 0,X:DRAWTO Y,179:PLOT 0,179-X:DRAWTO Y,0
740 PLOT 79,X:DRAWTO 79-Y,179:PLOT 79,179-X:DRAWTO 79-Y,0:NEXT X
750 RETURN

Download

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

Credits