home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_26_1988_Transactor_Publishing.d64
/
driversetup.src
< prev
next >
Wrap
Text File
|
2023-02-26
|
5KB
|
231 lines
.opt nos
;put"@0:driversetup.src
;* * * * * * * * * * * * * * * * *
;* *
;* c-128 centronics printer... *
;* driver setup module *
;* *
;* written 1-08-87 w.j. brier *
;* *
;* revised *
;* *
;* copyright (c) 1987 *
;* *
;* sys 5632,dn,lf to enable *
;* sys 5632,0 to disable *
;* *
;* see the documentation for... *
;* instructions on using this... *
;* utility with your software. *
;* *
;* * * * * * * * * * * * * * * * *
;
;
;
;* * * * * * * * * * * * * * * * *
;* *
;* <<< program assignments >>> *
;* *
;* * * * * * * * * * * * * * * * *
;
;
;
;system vectors & pointers...
;
ierror =$0300 ;basic error vector
;
iopen =$031a ;kernal open vector
iclose =$031c ;kernal close vector
ickout =$0320 ;kernal ckout vector
iclrch =$0322 ;kernal clrchn vector
ibsout =$0326 ;kernal chrout vector
;
mmu =$ff00 ;configuration
;
;
;printer driver jump table...
;
open =$1a00 ;kernal open patch
close =$1a03 ;kernal close patch
ckout =$1a06 ;kernal chkout patch
clrch =$1a09 ;kernal clrchn patch
bsout =$1a0c ;kernal chrout patch
setprt =$1a0f ;port setup
;
;
;printer driver control flags...
;
pdev =$1a1e ;port device number
lfflg =$1a1f ;linefeed flag
;
;
;alternate indirect vector storage...
;
opena =$1a12 ;open exit
closea =$1a14 ;close exit
ckouta =$1a16 ;chkout exit
clrcha =$1a18 ;clrchn exit
bsouta =$1a1a ;chrout exit
;
resrvd =$1a1c ;reserved
;
*=$1600 ;5632
;
;
;=================================
;
;driver enable/disable
;
stx lfflg ;save linefeed flag
;
ldx #0
ldy mmu ;get configuration
stx mmu ;enable roms
;
tax
bne endr ;enable driver
;
jmp dadr ;disable driver
;
;---------------------------------
;
;enable driver
;
endr cpx #4 ;check device number
bcs endr02
;
endr01 ldx #9 ;illegal device
jmp (ierror) ;abort
;
endr02 cpx #8
bcs endr01 ;out of range
;
tya
pha ;save configuration
stx pdev ;set device number
;
clc
lda lfflg
and #1 ;mask garbage
ror a ;rotate twice
ror a
sta lfflg ;set up flag
;
;
;set up new vectors...
;
ldx iopen ;open vector
ldy iopen+1
cpx #<open
bne endr03
;
cpy #>open
bne endr03
;
jmp endr04 ;skip setup
;
endr03 stx opena
sty opena+1
;
ldx #<open ;new vector
ldy #>open
stx iopen
sty iopen+1
;
ldx iclose ;close vector
ldy iclose+1
stx closea
sty closea+1
;
ldx #<close ;new vector
ldy #>close
stx iclose
sty iclose+1
;
ldx ickout ;ckout vector
ldy ickout+1
stx ckouta
sty ckouta+1
;
ldx #<ckout ;new vector
ldy #>ckout
stx ickout
sty ickout+1
;
ldx iclrch ;clrchn vector
ldy iclrch+1
stx clrcha
sty clrcha+1
;
ldx #<clrch ;new vector
ldy #>clrch
stx iclrch
sty iclrch+1
;
ldx ibsout ;chrout vector
ldy ibsout+1
stx bsouta
sty bsouta+1
;
ldx #<bsout ;new vector
ldy #>bsout
stx ibsout
sty ibsout+1
;
jsr setprt ;set up user port
;
endr04 pla ;old configuration
sta mmu
;
rts
;
;---------------------------------
;
;disable driver
;
dadr tya
pha ;save old configuration
;
;
;check for enabled driver...
;
ldx iopen ;open vector
ldy iopen+1
cpx #<open
bne endr04 ;not enabled
;
cpy #>open
bne endr04
;
;
;restore vectors...
;
ldx opena ;old open
ldy opena+1
stx iopen
sty iopen+1
;
ldx closea ;old close
ldy closea+1
stx iclose
sty iclose+1
;
ldx clrcha ;old clrchn
ldy clrcha+1
stx iclrch
sty iclrch+1
;
ldx ckouta ;old ckout
ldy ckouta+1
stx ickout
sty ickout+1
;
ldx bsouta ;old bsout
ldy bsouta+1
stx ibsout
sty ibsout+1
jmp endr04
;
;=================================
.end