--- title: "Photon" id: 72036 type: "computer_media" slug: "photon" url: "http://localhost/computer_media/photon/" markdown_url: "http://localhost/computer_media/photon.md" published_at: "2026-10-20T14:07:37+00:00" modified_at: "2026-10-20T14:19:54+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/10/3_PHOTON.png" excerpt: "A machine code light beam bounces diagonally around a black box, tracing a criss-cross path of white squares before the pattern clears and restarts." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Gene G. Buza" slug: "gene-g-buza" taxonomy: "indiv" url: "http://localhost/indiv/gene-g-buza/" genre: - name: "Graphics" slug: "graphics" taxonomy: "genre" url: "http://localhost/type/graphics/" media_contents: - id: 72046 title: "Synchro-Sette May 1984" type: "computer_media" url: "http://localhost/computer_media/synchro-sette-may-1984/" media_type: "Program" programmers: - name: "Gene G. Buza" slug: "gene-g-buza" taxonomy: "indiv" url: "http://localhost/indiv/gene-g-buza/" mediadate: "1984" images: - url: "http://localhost/wp-content/uploads/2026/10/3_PHOTON.png" media_type_tags: "Graphics" --- # Photon 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. ## 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 ```