blob: 592f77c929cf0fe0724c91d0bac388afc20ac87b [file] [log] [blame]
kthacker62e146c2006-04-17 15:11:35 +00001; unsigned char kbhit (void);
2; Return true if there's a key waiting, return false if not
3; TESTED
4
5.globl _kbhit
6 .area _CODE
7_kbhit::
8 call 0xBB09 ; KM READ KEY
9 ld (key),a
PulkoMandy3783e422023-05-02 17:40:17 +020010 ld a,#1
kthacker62e146c2006-04-17 15:11:35 +000011 ret c
PulkoMandy3783e422023-05-02 17:40:17 +020012 ld a,#0
kthacker62e146c2006-04-17 15:11:35 +000013 ret
14
15; char cgetc (void);
16; Return a character from the keyboard. If there is no character available,
17; the functions waits until the user does press a key. If cursor is set to
18; 1 (see below), a blinking cursor is displayed while waiting.
19; TESTED
20
21.globl _cgetc
22
23_cgetc::
24 ld a,(key)
kthacker62e146c2006-04-17 15:11:35 +000025 ret
26
27;; call 0xBB09
28;; jr nc,_cgetc
29;; ld l,a
30;; ret
31
32key: .db 0