]> git.sur5r.net Git - cc65/blob - libsrc/atari/kbhit.s
Squeezed bytes and cycles out of the kbhit functions for almost all platforms.
[cc65] / libsrc / atari / kbhit.s
1 ;
2 ; Christian Groessler, 19-Feb-2000
3 ;
4 ; unsigned char kbhit (void);
5 ;
6
7         .export         _kbhit
8         .import         return1
9
10         .include        "atari.inc"
11
12 .proc   _kbhit
13
14         ldx     CH              ; last pressed key
15         inx                     ; 255 means "no key"
16         bne     L1
17         txa                     ; X = A = 0
18         rts
19 L1:     jmp     return1
20
21 .endproc
22
23