wipes: fix up a few

This commit is contained in:
Vince Weaver 2024-11-12 01:03:03 -05:00
parent 1050b92d22
commit 0057ec3230
5 changed files with 25 additions and 10 deletions

View File

@ -90,7 +90,7 @@ loop:
lda ($fe),y
bpl copy
lda #$10
; jsr iWaitForKeyWithTimeout
jsr WaitForKeyWithTimeout
bmi cexit
bpl next ; always branches
copy:

View File

@ -41,15 +41,15 @@ WaitForKeyWithTimeout:
; out: A clobbered (not always 0 if key is pressed, but also not the key pressed)
; X/Y preserved
sec
@wait1: pha
@wait2: sbc #1
bne @wait2
wait1: pha
wait2: sbc #1
bne wait2
pla
bit KBD
bmi @exit
bmi wfk_exit
sbc #1
bne @wait1
@exit: rts
bne wait1
wfk_exit: rts
; based on routine by John Brooks
; posted on comp.sys.apple2 on 2018-07-11

View File

@ -30,7 +30,7 @@ h1=*+1
bne loop1
lda #$10
; jsr iWaitForKeyWithTimeout
jsr WaitForKeyWithTimeout
bmi lrexit
inc h1
@ -53,7 +53,7 @@ h2=*+1
bne loop2
lda #$10
; jsr iWaitForKeyWithTimeout
jsr WaitForKeyWithTimeout
bmi lrexit
inc h2

View File

@ -62,5 +62,6 @@ test_graphic:
.include "../zx02_optim.s"
.include "../vblank.s"
;.include "../vblank.s"
;.include "../wait_for_key.s"

View File

@ -0,0 +1,14 @@
WaitForKeyWithTimeout:
; in: A = timeout length (like standard $FCA8 wait routine)
; out: A clobbered (not always 0 if key is pressed, but also not the key pressed)
; X/Y preserved
sec
wait1: pha
wait2: sbc #1
bne wait2
pla
bit KBD
bmi wfk_exit
sbc #1
bne wait1
wfk_exit: rts