From e178a33d2916ba33fd141c482c77dfef88deafff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20M=C3=BChlstrasser?= Date: Fri, 13 Feb 2015 19:53:02 +0100 Subject: [PATCH] Fix high byte of return value, optimized. --- libsrc/osic1p/cgetc.s | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 -- 2.39.5