dos33fsprogs/graphics/hgr/wipes/wait_for_key.s
2024-11-12 01:03:03 -05:00

15 lines
370 B
ArmAsm

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