belgo.org

Stuff about Christopher Shepherd, with a seemingly incongruous domain name.

COLORCDA.S (CDA, multicolor text mode)

* this appears to be a classic desk accessory (CDA)
* that hooks into the keyboard strobe KSWL/KSWH
* and changes the text/bgcolor settings to give
* multicolored text on the GS
* I vaguely recall writing it to prove a teacher wrong

lst off
cas in
use bbsnum.mac
org $8000
clc
xce
rep #$30
dropout pushlong #handle
_installcda
sec
xce
rts
point str "-Mega-Color-CDA-"
adrl start
adrl exit
mx %00
start phk
plb
_textstartup
pea $00ff
pea $0080
_setinglobals
pea $00ff
pea $0080
_setoutglobals
pea $0000
pea $0000
pea $0003
_setinputdevice
pea $0000
pea $0000
pea $0003
_setoutputdevice
pea $0000
_inittextdev
pea $0001
_inittextdev
pushlong #numberz
_writecstring
pha
pea $0000
_readchar
pla
_textshutdown
sec
xce
sep #$20
jsr open
clc
xce
rep #$30
exit rtl
numberz asc "               MegaColor now <ON>.",8D
asc "Hit any key to exit to BASIC, and onward to Color!",8d,8d
asc "    ! You may have to hit CTRL-Reset for color to take effect !",8d
asc "MegaColor (c) 1992 Chris Shepherd",00
handle adrl point

basl = $28
kswl = $38
ourch = $57b
cxromon = $c007
cxromoff = $c006
altchar = $c01e
invert = $cedd
pick = $cf01

mx %11

open lda #<intro1
sta kswl
lda #>intro1
sta kswl+1
lda #<reset
sta $3f2
lda #>reset
sta $3f3
eor #$a5
sta $3f4
rts

INTRO1 PHY
PHX
LDY $C022
INTRO2 LDA $C02E
AND #$7C
ROR
ROR
TAX
LDA TABLINT,X
STA $C022
BIT $C000
BPL INTRO2
ORA #$80
STY $C022
LDA $C000
STA $C010
PLX
PLY
RTS
TABLINT HEX 10507080203060904020106070A0C0D0E0B0A0F08090105040A0C0D0

reset jsr open
jmp $be00