Fix high byte of return value, optimized.

This commit is contained in:
Stephan Mühlstrasser
2015-02-13 19:53:02 +01:00
parent 88df129215
commit e178a33d29

View File

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