Apple2: spare 2 bytes on read

This commit is contained in:
Colin Leroy-Mira
2025-10-25 11:22:50 +02:00
committed by Oliver Schmidt
parent 759884ddd4
commit 25c1223f02

View File

@@ -67,6 +67,9 @@ device: lda #$00
next: jsr RDKEY next: jsr RDKEY
jsr COUT jsr COUT
; We'll need Y=0 in both branches below
ldy #$00
; Clear hi bit and check for '\r' ; Clear hi bit and check for '\r'
and #$7F and #$7F
cmp #$0D cmp #$0D
@@ -74,13 +77,11 @@ next: jsr RDKEY
; Replace with '\n' and set count to zero ; Replace with '\n' and set count to zero
lda #$0A lda #$0A
ldy #$00
sty ptr2 sty ptr2
sty ptr2+1 sty ptr2+1
; Put char into buf ; Put char into buf
: ldy #$00 : sta (ptr1),y
sta (ptr1),y
; Increment pointer ; Increment pointer
inc ptr1 inc ptr1