]> git.sur5r.net Git - cc65/commitdiff
fixed it and saved 1 byte
authorcpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 7 Jun 2000 22:10:45 +0000 (22:10 +0000)
committercpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 7 Jun 2000 22:10:45 +0000 (22:10 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@27 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/atari/kbhit.s

index 25418c15d016c7c67e4054621c16859c1f1aa342..e066aacd4ed899e0257b8ba010bcfaefee9d8847 100644 (file)
@@ -1,5 +1,5 @@
 ;
-; Ullrich von Bassewitz, 06.08.1998
+; Christian Groessler, 19-Feb-2000
 ;
 ; int kbhit (void);
 ;
        .include        "atari.inc"
 
 _kbhit:
-       lda     CH      ; Get number of characters
-       cmp     #$FF
-       bne     L1
-       jmp     return1
-L1:    jmp     return0
-
-
-
-
+       ldx     CH              ; last pressed key
+       inx                     ; 255 means "no key"
+       bne     L1
+       jmp     return0
+L1:    jmp     return1