]> git.sur5r.net Git - cc65/blobdiff - libsrc/geos/conio/kbhit.s
Squeezed bytes and cycles out of the kbhit functions for almost all platforms.
[cc65] / libsrc / geos / conio / kbhit.s
index 5786d0aeec5dd2acc215c864465e3dfbee66f4c2..6756f49c9391c0260bf710ee4d2d84c1b5ab21c3 100644 (file)
@@ -7,12 +7,16 @@
 ; unsigned char kbhit (void);
 
            .export _kbhit
-           .import return0, return1
 
            .include "../inc/geossym.inc"
 
-_kbhit:
-           lda pressFlag
-           bmi L1
-           jmp return0
-L1:        jmp return1
+.proc   _kbhit
+
+        ldx     #0              ; High byte of result
+        lda     pressFlag
+        rol                     ; Bit 7 is new key flag
+        txa                     ; A = 0
+        rol
+        rts
+
+.endproc