]> git.sur5r.net Git - cc65/blobdiff - libsrc/c64/kbhit.s
Squeezed bytes and cycles out of the kbhit functions for almost all platforms.
[cc65] / libsrc / c64 / kbhit.s
index 1a54c2e5e6fcb3af957053c8889bea8494cad644..9fa04b5501db7d2b478835577e5bffd08b650076 100644 (file)
@@ -1,20 +1,23 @@
 ;
 ; Ullrich von Bassewitz, 06.08.1998
 ;
-; int kbhit (void);
+; unsigned char kbhit (void);
 ;
 
        .export         _kbhit
-       .import         return0, return1
 
        .include        "c64.inc"
 
-_kbhit:
+
+.proc   _kbhit
+
+        ldx     #0              ; High byte of return is always zero
        lda     KEY_COUNT       ; Get number of characters
-       bne     L1
-       jmp     return0
-L1:    jmp     return1
+        beq     L9
+        lda     #1
+L9:     rts
 
+.endproc