disasm around charset/MT mapping

This commit is contained in:
Joshua Bell 2021-11-10 21:07:34 -08:00
parent 37f2bfd247
commit 321c116788
2 changed files with 67 additions and 32 deletions

View File

@ -227,10 +227,11 @@ l1: php
l2: plp l2: plp
pla pla
bcs l3 ; input or output? bcs l3 ; input or output?
;; Output
jsr OutputChar jsr OutputChar
bra l9 bra l9
;; Input ;; Input
l3: ldx SAVEX l3: ldx SAVEX
beq l4 beq l4
@ -649,7 +650,7 @@ OutputChar:
sta CHAR sta CHAR
LC8B4: jsr CheckPauseListing LC8B4: jsr CheckPauseListing
lda MODE lda MODE
and #$03 ; test low 2 bits and #$03 ; test low 2 bits (why???)
beq @l1 beq @l1
jmp LCA11 jmp LCA11
@ -661,19 +662,31 @@ LC8B4: jsr CheckPauseListing
cpy WNDWDTH cpy WNDWDTH
bcc @l2 bcc @l2
jsr DoReturn jsr DoReturn
;; If MouseText is not active, make sure to map inverse
;; uppercase range to the control character range.
@l2: lda CHAR ; char to be printed @l2: lda CHAR ; char to be printed
bit INVFLG bit INVFLG ; inverse?
bmi @l3 bmi @l3 ; no, so not MT, just print it
and #$7F and #$7F
bit MODE
bvs @l3 ; test bit 6 (MouseText active) bit MODE ; MT active? (bit 6 = M_MOUSE)
bit ALTCHARSET bvs @l3 ; yes, so skip correction
bpl @l3
cmp #$40 bit ALTCHARSET ; also skip correction if
bcc @l3 bpl @l3 ; alt charset is disabled
cmp #$60
bcs @l3 ;; If within "@ABC...XYZ[\]^_" range, map to $00-$1F
;; so it shows as inverse uppercase, not MouseText.
cmp #'@'
bcc :+
cmp #'_'+1
bcs :+
and #$1F and #$1F
:
@l3: jsr LCBF9 @l3: jsr LCBF9
jmp DoForwardSpace jmp DoForwardSpace
@ -1238,11 +1251,16 @@ LCBDE: lda MODE ; test high bit
LCBEA: jsr LCEBE LCBEA: jsr LCEBE
eor #$80 eor #$80
cmp #$40
bcc LCBF9 ;; If within "@ABC...XYZ[\]^_" range, map to $00-$1F
cmp #$60 ;; so it shows as inverse uppercase, not MouseText.
bcs LCBF9 cmp #'@'
bcc :+
cmp #'_'+1
bcs :+
and #$1F and #$1F
:
LCBF9: ldy CH LCBF9: ldy CH
jmp LCECB jmp LCECB

View File

@ -1054,7 +1054,7 @@ OutputChar:
sta CHAR sta CHAR
LC84C: jsr CheckPauseListing LC84C: jsr CheckPauseListing
lda MODE lda MODE
and #$03 and #$03 ; test low 2 bits (why???)
beq @l1 beq @l1
jmp LCA2F jmp LCA2F
@ -1066,19 +1066,31 @@ LC84C: jsr CheckPauseListing
cpy WNDWDTH cpy WNDWDTH
bcc @l2 bcc @l2
jsr DoReturn jsr DoReturn
@l2: lda CHAR
bit INVFLG ;; If MouseText is not active, make sure to map inverse
bmi @l3 ;; uppercase range to the control character range.
@l2: lda CHAR ; char to be printed
bit INVFLG ; inverse?
bmi @l3 ; no, so not MT, just print it
and #$7F and #$7F
bit MODE
bvs @l3 bit MODE ; MT active? (bit 6 = M_MOUSE)
bit ALTCHARSET bvs @l3 ; yes, so skip correction
bpl @l3
cmp #$40 bit ALTCHARSET ; also skip correction if
bcc @l3 bpl @l3 ; alt charset is disabled
cmp #$60
bcs @l3 ;; If within "@ABC...XYZ[\]^_" range, map to $00-$1F
;; so it shows as inverse uppercase, not MouseText.
cmp #'@'
bcc :+
cmp #'_'+1
bcs :+
and #$1F and #$1F
:
@l3: jsr LCC13 @l3: jsr LCC13
jmp DoForwardSpace jmp DoForwardSpace
@ -1692,11 +1704,16 @@ LCBF8: lda MODE
bra LCC13 bra LCC13
LCC04: jsr LCEBB LCC04: jsr LCEBB
eor #$80 eor #$80
cmp #$40
bcc LCC13 ;; If within "@ABC...XYZ[\]^_" range, map to $00-$1F
cmp #$60 ;; so it shows as inverse uppercase, not MouseText.
bcs LCC13 cmp #'@'
bcc :+
cmp #'_'+1
bcs :+
and #$1F and #$1F
:
LCC13: ldy CH LCC13: ldy CH
jmp LCEC8 jmp LCEC8