Photon

This file is part of Synchro-Sette May 1984. Download the collection to get this file.
Developer(s): Gene G. Buza
Date: 1984
Type: Program
Platform(s): TS 1000
Tags: Graphics

A graphics display in which a beam of light travels diagonally across a black field and reflects off its edges, leaving a trail of white squares that builds up into a criss-cross pattern. When the run finishes, the program clears itself and starts a new pattern from a different starting value.


Program Analysis

Program Structure

The work is done by a machine code routine stored in the REM at line 0, which the listing shows only as keyword and character noise. The BASIC part is a short driver:

  • Line 10 calls the routine at 16533 with RAND USR 16533, apparently to set up the field and its border.
  • Line 30 POKEs a random value from 10 to 41 into address 16571, a byte inside the machine code just before the second entry point, so each run starts differently.
  • Lines 40–60 fill sixteen rows with full blocks to make the black playing field.
  • Line 70 runs the beam routine with RAND USR 16572. Lines 80–90 then CLEAR and RUN 10 to start the next pattern.

The machine code itself has not been disassembled for this description.

Notable Techniques

  • The BASIC program changes the machine code’s behaviour by POKEing one byte of the REM before each run, a common way to pass a value to a ZX81 routine.
  • The program is saved to start with RUN 10, which skips line 0.

Appears On

The May 1984 Synchro-Sette subscription cassette: seven programs, including a binary tutor, a hex-digit swapping game, a payroll calculator and a machine code light show.

Image Gallery

Source Code

   0 Y[▒]▞4NOT ( CLEARTAN Y)[(]#LN  PRINT ▒Y[▒]NOT TAN LN F?LN E~~LN ▙RND▞(VAL : LN [~~]RNDAT VAL :3LN [~~]RNDAT ( LIST Y#WNOT LN ▙RNDTAN ▘ COPY1~~Y▘M[S]RNDM[T]RNDWM[U]RND GOSUB #[U]RNDY[.]MKRNDLN [M]"LN [V]▝ FOR 5 CLS LOAD [B] GOSUB #COS 5# CLEAR[B] GOSUB #COS U[U]RND RETURN▝C▖ RETURNX4▒U[T]RNDJWM[T]RNDU[V]RND RETURN~~C▖ RETURND4▒U[S]RNDJWM[S]RND GOSUB #[U]RNDY[4]MKRNDLN [M]"5[T]RND▘[U]RND~~[-]▝F▀~~[-]▝/[4]
  10 RAND USR 16533
  20 PRINT AT 19,9;"█[P]█[H]█[O]█[T]█[O]█[N]█"
  30 POKE 16571,INT (RND*32+10)
  40 FOR N=1 TO 16
  50 PRINT AT N,1;"██████████████████████████████"
  60 NEXT N
  70 RAND USR 16572
  80 CLEAR
  90 RUN 10
9998 SAVE "PHOTO[N]"
9999 RUN 10

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.