; ATRACT seed demo: a rainbow that scrolls down the screen, and POKE 77,0 ; on every scan line, so the machine never falls into attract mode. ; ; ATRACT ($4D, location 77) is the OS's idle counter. The vertical blank adds ; one to it every four seconds; past 127 the OS starts cycling the screen ; colours to save the TV from burn-in. A program that does not read the ; keyboard writes 0 there to stay awake. This one does it constantly. ; ; The rainbow is the classic trick: VCOUNT says which scan line ANTIC is on, ; RTCLOK moves on every frame, and their sum, written to the colour ; registers right after WSYNC, gives every pair of lines its own colour. ; ; MIT licence. Copyright (c) 2026 the ATRACT authors. ; Built by seed/attract/build.js with the workbench's assembler. ATRACT = $4D RTCLOK = $14 COLPF2 = $D018 COLBK = $D01A WSYNC = $D40A VCOUNT = $D40B *= $2000 START LDA #0 STA ATRACT LOOP LDA VCOUNT CLC ADC RTCLOK STA WSYNC STA COLBK STA COLPF2 LDX #0 STX ATRACT JMP LOOP