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