4cade/src/wait.a

22 lines
432 B
Plaintext

;license:MIT
;(c) 2018-9 by 4am
;
; This file is included from multiple assembly targets,
; so it should only have 1 function.
WaitForKeyWithTimeout
; in: A = timeout length (like standard $FCA8 wait routine)
; out: A clobbered
; X/Y preserved
sec
@wait1 pha
@wait2 sbc #1
bne @wait2
pla
bit $C000
bmi @exit
sbc #1
bne @wait1
@exit rts