This program draws a continuously animating geometric pattern on screen using overlapping diagonal line plots. It uses the SOUND command to initialize the AY sound chip with a specific register configuration before entering the drawing routines. Lines 14 through 19 repeatedly PLOT a starting point and issue pairs of DRAW commands with equal-and-opposite slopes (63,175 and 62,-175), creating a dense web of crossing diagonal lines across the screen. The FOR loop ranges vary across lines, causing the pattern to grow and shift with each iteration before looping back via GO TO 15. The OVER 1 attribute causes lines to XOR with existing pixels, producing a moire-like interference effect as lines are redrawn.
Program Analysis
Program Structure
The program is divided into two functional phases: a one-time initialization block (lines 0–10) and a continuous drawing loop (lines 14–20). After setup, execution cycles between lines 15 and 20 indefinitely via GO TO 15, with line 14 only executing on the first pass.
- Line 0: REM block containing copyright and author attribution.
- Line 10: Screen clear, OVER 1 mode activation, and AY sound chip register setup.
- Lines 14–19: Six FOR loops each drawing overlapping diagonal line pairs.
- Line 20:
GO TO 15— returns to line 15, skipping line 14 on all subsequent iterations.
SOUND Chip Initialization
Line 10 uses the SOUND command to configure the AY-3-8912 sound chip registers directly. The parameters set register pairs for tone periods, noise, mixer, and amplitude:
| Register | Value | Function |
|---|---|---|
| 0 | 254 | Channel A tone period (low byte) |
| 1 | 5 | Channel A tone period (high byte) |
| 2 | 255 | Channel B tone period (low byte) |
| 3 | 5 | Channel B tone period (high byte) |
| 4 | 253 | Channel C tone period (low byte) |
| 5 | 5 | Channel C tone period (high byte) |
| 7 | 56 | Mixer control (tones/noise enables) |
| 8 | 15 | Channel A amplitude |
| 9 | 15 | Channel B amplitude |
| 10 | 15 | Channel C amplitude |
Mixer register 7 = 56 (binary 00111000) enables noise on all three channels and disables tone output, with all amplitudes set to maximum fixed level (15). This produces a sustained noise burst on program start.
Drawing Technique
Each FOR loop in lines 14–19 iterates over a range of X coordinates at either y=0 or y=175. From each plotted point, two DRAW commands are issued: DRAW 63,175 followed by DRAW 62,-175. This traces a tall, narrow zigzag from the starting point, producing dense crossing diagonals across the 256×176 pixel screen area.
The loop ranges differ between lines, creating varying densities of coverage:
| Line | X range | Start Y | Iterations |
|---|---|---|---|
| 14 | 38–92 | 0 | 55 |
| 15 | 38–92 | 175 | 55 |
| 16 | 43–87 | 0 | 45 |
| 17 | 28–102 | 175 | 75 |
| 18 | 28–102 | 175 | 75 |
| 19 | 28–62 | 175 | 35 |
OVER 1 and XOR Effect
OVER 1, set once in line 10, causes all subsequent PLOT and DRAW operations to XOR pixels with the existing screen content rather than overwriting them. As lines are redrawn across multiple loop iterations, pixels that are plotted an even number of times cancel out, creating a dynamic, shifting moire interference pattern characteristic of this technique.
Loop Design and Line 14 Anomaly
Because GO TO 15 is used at line 20, line 14 executes only once — on initial program run. Lines 17 and 18 are identical in both X range and starting Y coordinate, meaning that pass effectively doubles the stroke density for that particular range on every cycle through the main loop. It is unclear whether this is intentional for visual effect or an authoring oversight.
Notable Techniques
- Using
OVER 1globally to achieve XOR pixel toggling without per-line mode switching. - Deliberately excluding line 14 from the infinite loop to create an asymmetric first frame.
- Drawing lines whose combined horizontal span (63+62=125 pixels) is close to half the screen width, producing a structured rather than random web.
- AY chip configured for noise-only output at startup with no subsequent SOUND commands, leaving the noise running continuously under the animation.
Content
Source Code
0 REM ©1986 BYTE POWER WRITTEN BY E & K BOISVERT
10 CLS : OVER 1: SOUND 0,254;1,5;2,255;3,5;4,253;5,5;7,56;8,15;9,15;10,15
14 FOR x=38 TO 92: PLOT x,0: DRAW 63,175: DRAW 62,-175: NEXT x
15 FOR x=38 TO 92: PLOT x,175: DRAW 63,-175: DRAW 62,175: NEXT x
16 FOR x=43 TO 87: PLOT x,0: DRAW 63,175: DRAW 62,-175: NEXT x
17 FOR x=28 TO 102: PLOT x,175: DRAW 63,-175: DRAW 62,175: NEXT x
18 FOR x=28 TO 102: PLOT x,175: DRAW 63,-175: DRAW 62,175: NEXT x
19 FOR x=28 TO 62: PLOT x,175: DRAW 63,-175: DRAW 62,175: NEXT x
20 GO TO 15
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.


