Pipe
- Type
- Graphics
- Category
- GRAPHICS 9 shading demo
- Author
- Mark Proudfoot
- Published in
- Antic, August 1989 (Vol. 8, No. 4), Tech Tips ("Three Colorful Graphics Demos")
- Year
- 1989
- Language
- Atari BASIC
- Requirements
- Any Atari 8-bit with the GTIA chip (all XL/XE and nearly all 400/800s), 16K RAM, Atari BASIC
- Tags
- antic, tech-tips, graphics-9, gtia, shading, animation, sound, short-program, atari-basic
About the program
Mark Proudfoot was a 14-year-old high-school student in Brentwood, California, when Antic printed three of his short graphics demos in the August 1989 Tech Tips column. One was an "Easter Egg Maker" with flashing pastel shades, and another was a GRAPHICS 11 "Rainbow" with sound. The third, Pipe, is the only one on the Antic disk. In Antic's words it draws "a pipe with water running out of it", and the delicate shading gives it an almost three-dimensional look. It's only 21 lines long, and a nice example of what the GTIA's sixteen shades can do.
Typing it in
It's plain text with no special characters. In the magazine the TYPO II checksum codes were printed beside the listing with the warning "Don't type the TYPO II codes!". The disk version doesn't include them.
How to use it
RUN it. A short, thick upright pipe is drawn at the top left with a spout sticking out to the right. Then drops of "water" pour from the spout in falling arcs, each a random shade, with a soft hiss. It runs until you press BREAK. Type GRAPHICS 0 to get the text screen back.
How it works
GRAPHICS 9 is a GTIA mode with 80×192 pixels, each in one of 16 luminances of a single hue. POKE 712,16 sets that hue (hue 1, a gold-orange, at the darkest luminance). In this mode the COLOR number is the brightness, 0 to 15.
- The upright pipe (lines 40–80) is 16 pixels wide. For each row, the left half is plotted with colours 1 to 8 and the right half with 11 down to 4. That gives a ramp from dark to bright and back to fairly dark, which the eye reads as a lit, curved surface.
- The spout (lines 90–125) is made of horizontal lines across 31 rows, from the pipe out to column 40. Their brightness rises to a peak in the middle row and falls away again, so the spout looks round. Their left ends move in by one pixel for every three rows (
25-INT(K/3)), which gives it a tapered, conical join where it meets the pipe. - The water (lines 130–170) is a simple ballistic arc. Each drop starts at the spout's mouth, steps 2 pixels right each time, and falls by G, which is multiplied by 1.5 at every step, so the drops curve sharply downwards. Every point gets a random shade. When a drop leaves the screen, a new one starts with a fresh random G.
- The sound comes from SOUND 0 being fed random pitches from POKEY's random register (
PEEK(53770)), first with pure tone 10, then with noise 8, plus a low rumble on voice 1 (line 125).
Variations to try
- Change the hue:
POKE 712,128gives a blue pipe andPOKE 712,192a green one. - Make a gentler stream by changing
G=G*1.5toG=G*1.2. - Try lines 40–80 in GRAPHICS 10 or 11 to see how the same COLOR values look as palette indexes or hues.
Listing
5 REM PIPE
6 REM BY MARK PROUDFOOT
7 REM (C)1989, ANTIC PUBLISHING INC
10 GRAPHICS 9:POKE 712,16:DEG
40 FOR B=1 TO 61
50 FOR A=10 TO 17:COLOR A-9
60 PLOT A,B:NEXT A
70 FOR A=18 TO 25:COLOR 25-(A-4)
80 PLOT A,B:NEXT A:NEXT B
90 FOR A=31 TO 46:K=A-30:COLOR K
100 PLOT 25-INT(K/3),A:DRAWTO 40,A
110 NEXT A:C=15
115 FOR A=46 TO 61:K=ABS(A-61):COLOR K
120 PLOT 25-INT(K/3),A:DRAWTO 40,A
125 NEXT A:C=15:SOUND 1,25,0,2
130 X=41:Y=INT(RND(0)*3)+58:G=(RND(0)*2)+2
135 SOUND 0,PEEK(53770),10,2:SOUND 0,PEEK(53770),8,2
140 COLOR (RND(0)*8)+1:G=G*1.5:PLOT X,Y
150 X=X+2:Y=Y+G
160 IF X>78 OR Y>179 THEN GOTO 130
170 GOTO 135
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: PIPE.BAS.
Credits
- Program listing: Pipe — program listing (Antic, August 1989 (Vol. 8, No. 4), Tech Tips ("Three Colorful Graphics Demos")) — Mark Proudfoot
- Picture: GRAPHICS 9's sixteen shades of one hue give the pipe and spout their rounded look. — Mark Proudfoot (program); screenshot by the site
- Antic Software Archive — August 1989 - Vol. 8 No. 4 disk: PIPE.BAS — Mark Proudfoot, 1989
- Antic magazine scan (OCR text layer): Antic_Vol_8-04_1989-08_Mapping_the_Atari_text.pdf — Frank Martone; Internet Archive
