fix(screen): CHROUT prints PETSCII $E0-$FF as screen codes $60-$7E and pi

PETSCII $E0-$FE became the reverse screen codes $A0-$BE. A C64 prints them as
$60-$7E, as it does $A0-$BE, and $FF, pi, as $5E, as it does $DE (C64
Programmer's Reference Guide, appendices B and C).
This commit is contained in:
chris committed 2026-10-18 07:20:45 +02:00
1 parent e9a64fb7a8
commit ec4dc7df62
1 file changed
+7 -3
+7 -3
View File
@@ -9,14 +9,18 @@
chrout_to_screen_code:
; Codes $C0-$DF become $40-$5F
cmp #$E0
bcs @1
; Codes $C0-$FE become $40-$7E, and $FF (pi) becomes $5E, as $DE does
; (C64 PRG p380-381)
cmp #$FF
beq @pi
cmp #$C0
bcc @1
and #$7F
rts ; not high char
@pi:
lda #$5E
rts
@1:
; Range $20-$3F is unchanged
cmp #$40