fix CHROUT handling of most character codes

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-29 21:36:56 +09:30
1 parent 8ffe1b61da
commit b5ab7ba10c
1 file changed
+19 -22
+19 -22
View File
@@ -278,34 +278,31 @@ not_clearscreen:
bcs + bcs +
jmp chrout_done jmp chrout_done
* *
;; Unshifted letters ;; Range $20-$3F is unchanged
cmp #$40 cmp #$40
bcc not_lower bcc not_high_char
cmp #$41+26
bcs not_lower
and #$1f
jmp chrout_l1
not_lower:
;; Shifted letters ;; Unshifted letters and symbols from $40-$5F
cmp #$60 ;; all end up being -$40
bcc not_upper ;; (C64 PRG p376)
cmp #$60+26
bcs not_upper
sec
sbc #$20
jmp chrout_l1 ;; But anything >= $80 needs to be -$40
;; (C64 PRG p380-381)
not_upper: ;; And bit 7 should be cleared, only to be
cmp #$a0 ;; set by reverse video
bcc not_vendor
sec sec
sbc #$40 sbc #$40
not_vendor: ;; Fix shifted chars by adding $20 again
cmp #$20
bcc not_high_char
cmp #$40
bcs not_high_char
clc
adc #$20
not_high_char:
chrout_l1: chrout_l1: