NEW
AUTO
FOR I%=0 TO 2 STEP 2
P%=&900
[OPT I%
SEI
LDX #&09
.loop%
LDA #&0B:STA &FE40
CLI:SEI
LDA #&0B:STA &FE40
LDA #&7F:STA &FE43
LDA #&03:STA &FE40
LDA #&0F:STA &FE4F
LDA #&01:STA &FE4D
STX &FE4F
BIT &FE4D
BEQ next%
TXA:CLC:ADC #&30:STA &7C00
JMP end
.next%
DEX
BPL loop%
.end%
CLI
RTS
]
NEXT
CLS
REPEAT CALL &900:UNTIL FALSE
