Apple2: spare 2 bytes on read
This commit is contained in:
committed by
Oliver Schmidt
parent
759884ddd4
commit
25c1223f02
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user