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: chrout_to_screen_code:
; Codes $C0-$DF become $40-$5F ; Codes $C0-$FE become $40-$7E, and $FF (pi) becomes $5E, as $DE does
cmp #$E0 ; (C64 PRG p380-381)
bcs @1 cmp #$FF
beq @pi
cmp #$C0 cmp #$C0
bcc @1 bcc @1
and #$7F and #$7F
rts ; not high char rts ; not high char
@pi:
lda #$5E
rts
@1: @1:
; Range $20-$3F is unchanged ; Range $20-$3F is unchanged
cmp #$40 cmp #$40