From: Stephan Mühlstrasser Date: Fri, 13 Feb 2015 18:53:02 +0000 (+0100) Subject: Fix high byte of return value, optimized. X-Git-Tag: V2.15~22^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e178a33d2916ba33fd141c482c77dfef88deafff;p=cc65 Fix high byte of return value, optimized. --- diff --git a/libsrc/osic1p/cgetc.s b/libsrc/osic1p/cgetc.s index ecd53b8d7..3c9dd4381 100644 --- a/libsrc/osic1p/cgetc.s +++ b/libsrc/osic1p/cgetc.s @@ -18,13 +18,14 @@ _cgetc: lda #$A1 ; full white square sta (SCREEN_PTR),y ; store at cursor position nocursor: - jsr INPUTC - pha ; save retrieved character - lda cursor ; was cursor on? - beq nocursor2 + jsr INPUTC ; get input character in A + ldx cursor + beq done ; was cursor on? + tax ; save A in X lda tmp1 ; fetch saved character ldy CURS_X sta (SCREEN_PTR),y ; store at cursor position -nocursor2: - pla ; restore retrieved character + txa ; restore saved character from X + ldx #$00 ; high byte of int return value +done: rts