1
0
mirror of https://github.com/cc65/cc65.git synced 2024-10-31 20:06:11 +00:00
cc65/libsrc/telestrat/kbhit.s
2022-07-21 03:20:45 +02:00

30 lines
610 B
ArmAsm

;
; Jede, 2021-02-01
;
; int kbhit (void);
;
.export _kbhit
.import store_char
.include "telestrat.inc"
_kbhit:
lda store_char ; Check if a key has been detected previously
beq @call_telemon ; No, calls Telemon routine
lda #$01 ; There is a key pressed previously, return 1
ldx #$00
rts
@call_telemon:
BRK_TELEMON XRD0
ldx #$00
bcs @no_char_action
sta store_char
lda #$01
rts
@no_char_action:
tax
rts