2019-09-27 07:38:51 +00:00
|
|
|
;
|
2020-01-10 20:17:23 +00:00
|
|
|
; 2020-01-08, Greg King
|
2019-09-27 07:38:51 +00:00
|
|
|
;
|
|
|
|
; unsigned char kbhit (void);
|
|
|
|
; /* Returns non-zero (true) if a typed character is waiting. */
|
|
|
|
;
|
|
|
|
|
|
|
|
.export _kbhit
|
|
|
|
|
|
|
|
.include "cx16.inc"
|
|
|
|
|
|
|
|
|
|
|
|
.proc _kbhit
|
2020-01-10 20:17:23 +00:00
|
|
|
ldy VIA1::PRA ; (KEY_COUNT is in RAM bank 0)
|
|
|
|
stz VIA1::PRA
|
2019-09-27 07:38:51 +00:00
|
|
|
lda KEY_COUNT ; Get number of characters
|
2020-01-10 20:17:23 +00:00
|
|
|
sty VIA1::PRA
|
2019-11-16 18:11:40 +00:00
|
|
|
tax ; High byte of return (only its zero/nonzero ...
|
2019-12-25 15:56:32 +00:00
|
|
|
rts ; ... state matters)
|
2019-09-27 07:38:51 +00:00
|
|
|
.endproc
|