dos33fsprogs/games/peasant/wait_a_bit.s
2021-08-15 00:02:13 -04:00

37 lines
395 B
ArmAsm

;====================================
; wait for keypress or a few seconds
;====================================
; A is length to wait
wait_a_bit:
bit KEYRESET
tax
keyloop:
lda #200 ; delay a bit
jsr WAIT
lda KEYPRESS
bmi done_keyloop
dex
bne keyloop
beq no_escape
done_keyloop:
and #$7f
cmp #27
bne no_escape
lda #1
sta ESC_PRESSED
no_escape:
bit KEYRESET
rts