1
0
mirror of https://github.com/cc65/cc65.git synced 2024-05-29 08:41:31 +00:00

Fix switched meaning of '\n' and '\r'

When conio was implemented for the osic1p target, the cbm
target was used as a blueprint. But it was overlooked that the
cbm target encodes CR as 0x0A and LF as 0x0D, while the
osic1p target uses the ASCII encoding of CR and LF. Therefore
conio output of '\n' moved the active position to the start of the
line and '\r' moved the active position to the next line.

This change implements the correct semantics of '\n' and '\r'
in conio for the osic1p target.

Fixes #1747.
This commit is contained in:
Stephan Mühlstrasser 2022-05-18 18:57:52 +02:00 committed by mrdudz
parent f69b993ee6
commit 8ec1f76b9c

View File

@ -78,13 +78,13 @@ _cputcxy:
; Plot a character - also used as internal function
_cputc: cmp #$0A ; CR?
_cputc: cmp #$0D ; CR?
bne L1
lda #0
sta CURS_X
beq plot ; Recalculate pointers
L1: cmp #$0D ; LF?
L1: cmp #$0A ; LF?
beq newline ; Recalculate pointers
cputdirect: