1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-13 09:31:53 +00:00

30 lines
621 B
ArmAsm
Raw Normal View History

2021-02-01 17:53:07 +01:00
;
; Jede, 2021-02-01
;
; int kbhit (void);
;
.export _kbhit
2022-04-26 00:40:16 +02:00
.import store_char
2021-02-01 17:53:07 +01:00
.include "telestrat.inc"
_kbhit:
2022-04-26 00:40:16 +02:00
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:
2021-02-01 17:53:07 +01:00
BRK_TELEMON XRD0
2022-04-26 00:40:16 +02:00
ldx #$00
2022-04-26 00:40:16 +02:00
bcs @no_char_action
sta store_char
lda #$01
rts
@no_char_action:
tax
2021-02-01 17:53:07 +01:00
rts