2021-08-12 15:41:39 -04:00
|
|
|
;====================================
|
|
|
|
; wait for keypress or a few seconds
|
|
|
|
;====================================
|
2021-09-23 23:49:10 -04:00
|
|
|
; A is length to wait
|
2021-08-12 15:41:39 -04:00
|
|
|
|
|
|
|
wait_a_bit:
|
|
|
|
|
|
|
|
bit KEYRESET
|
|
|
|
tax
|
|
|
|
|
|
|
|
keyloop:
|
|
|
|
lda #200 ; delay a bit
|
2021-09-25 22:44:07 -04:00
|
|
|
jsr wait
|
2021-08-12 15:41:39 -04:00
|
|
|
|
|
|
|
lda KEYPRESS
|
|
|
|
bmi done_keyloop
|
|
|
|
|
|
|
|
dex
|
|
|
|
bne keyloop
|
2021-09-23 23:49:10 -04:00
|
|
|
beq no_escape
|
2021-08-12 15:41:39 -04:00
|
|
|
|
|
|
|
done_keyloop:
|
|
|
|
|
2021-09-23 23:49:10 -04:00
|
|
|
and #$7f
|
|
|
|
cmp #27
|
|
|
|
bne no_escape
|
|
|
|
|
|
|
|
inc ESC_PRESSED
|
|
|
|
no_escape:
|
|
|
|
|
2021-09-23 14:59:07 -04:00
|
|
|
bit KEYRESET
|
2021-08-15 00:02:13 -04:00
|
|
|
|
2021-09-23 14:59:07 -04:00
|
|
|
rts
|
2021-08-15 00:02:13 -04:00
|
|
|
|
|
|
|
|
2021-08-12 15:41:39 -04:00
|
|
|
|
|
|
|
|