]> git.sur5r.net Git - cc65/commitdiff
Fix high byte of return value, optimized.
authorStephan Mühlstrasser <stephan.muehlstrasser@web.de>
Fri, 13 Feb 2015 18:53:02 +0000 (19:53 +0100)
committerStephan Mühlstrasser <stephan.muehlstrasser@web.de>
Fri, 13 Feb 2015 18:53:02 +0000 (19:53 +0100)
libsrc/osic1p/cgetc.s

index ecd53b8d733dfe7a8248e00ce76cf293de5eee77..3c9dd43815fd33a97f6cd184503074beb6ea220d 100644 (file)
@@ -18,13 +18,14 @@ _cgetc:
         lda     #$A1            ; full white square\r
         sta     (SCREEN_PTR),y  ; store at cursor position\r
 nocursor:\r
-        jsr     INPUTC\r
-        pha                     ; save retrieved character\r
-        lda     cursor          ; was cursor on?\r
-        beq     nocursor2\r
+        jsr     INPUTC          ; get input character in A\r
+        ldx     cursor\r
+        beq     done            ; was cursor on?\r
+        tax                     ; save A in X\r
         lda     tmp1            ; fetch saved character\r
         ldy     CURS_X\r
         sta     (SCREEN_PTR),y  ; store at cursor position\r
-nocursor2:\r
-        pla                     ; restore retrieved character\r
+        txa                     ; restore saved character from X\r
+        ldx     #$00            ; high byte of int return value\r
+done:\r
         rts\r