ca65 V2.17 - Git 582aa41 Main file : duck_shoot.ca65 Current file: duck_shoot.ca65 000000r 1 ; 000000r 1 ; ACORN System 1 Applications: Duck Shoot 000000r 1 ; 000000r 1 ; From the Acorn System 1 User's Manual 000000r 1 ; 000000r 1 ; (Chris Oddy January 2022) 000000r 1 ; 000000r 1 ; entry point $0200 000000r 1 ; 000000r 1 .setcpu "6502" 000000r 1 .listbytes unlimited 000000r 1 ; 000000r 1 TIME := $0E 000000r 1 DEDDCK := $1C 000000r 1 DUCK := $61 000000r 1 DISPLAY := $FE0C ; scan the display 000000r 1 RESTART := $FF04 ; Monitor reentry point 000000r 1 ; 000000r 1 .org $0200 000200 1 ; 000200 1 A9 1F BEGIN: lda #$1F ; single scan display routine 000202 1 85 0E sta TIME 000204 1 A9 00 lda #$00 ; clear the display 000206 1 A2 07 ldx #$07 000208 1 86 20 stx $20 00020A 1 95 10 CLEAR: sta $10,x 00020C 1 CA dex 00020D 1 10 FB bpl CLEAR 00020F 1 A9 00 REMOVE: lda #$00 ; take the old duck off 000211 1 A6 20 ldx $20 000213 1 95 10 sta $10,x 000215 1 A9 61 INSERT: lda #DUCK ; put new duck on 000217 1 CA dex ; in new position 000218 1 10 02 bpl OLDX ; but not over the end of the display 00021A 1 A2 07 ldx #$07 00021C 1 95 10 OLDX: sta $10,X 00021E 1 86 20 stx $20 000220 1 A2 0E ldx #TIME ; display interval is set by the byte loaded into X 000222 1 20 0C FE WAIT: jsr DISPLAY 000225 1 C5 20 cmp $20 ; hit ? 000227 1 F0 05 beq HIT 000229 1 CA dex 00022A 1 D0 F6 bne WAIT 00022C 1 F0 E1 beq REMOVE ; finished wait time 00022E 1 A9 1C HIT: lda #DEDDCK ; put in a dead duck 000230 1 A6 20 ldx $20 000232 1 95 10 sta $10,x 000234 1 A9 FF lda #$FF 000236 1 85 0E sta TIME 000238 1 20 0C FE jsr DISPLAY ; test for continuation 00023B 1 90 C3 bcc BEGIN 00023D 1 4C 04 FF jmp RESTART ; or back to the Monitor 00023D 1