A2osX/SYS/PM.VEDRIVE.S.CF.txt
2022-03-13 13:58:15 +01:00

380 lines
5.1 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
*--------------------------------------
VEDRIVE.ReadConf
jsr MLI
.DA #MLIGETPREFIX
.DA MLIGETPREFIX.P
bcs .9
ldx #0
ldy CONF.FILEPATH
.1 lda CONF.FILENAME,x
iny
sta CONF.FILEPATH,y
inx
cpx #CONF.FILENAME.L
bne .1
sty CONF.FILEPATH
lda #CONF.FILEPATH
pha
lda /CONF.FILEPATH
pha
>LDYAI VEDRIVE.CONF
jsr PrintFYA
jsr MLI
.DA #MLIOPEN
.DA MLIOPEN.P
bcc .10
>LDYAI VEDRIVE.CONFKO
jsr PrintFYA
sec
rts
.10 lda MLIOPEN.P+5
sta MLINEWLINE.P+1
sta MLIREAD.P+1
sta MLICLOSE.P+1
jsr MLI
.DA #MLINEWLINE
.DA MLINEWLINE.P
bcs .9
.2 jsr MLI
.DA #MLIREAD
.DA MLIREAD.P
bcs .8
jsr VEDRIVE.CONF.L
bcc .2
>LDYAI VEDRIVE.CONFSYN
jsr PrintFYA
sec
bra .9
.8 cmp #MLI.E.EOF
sec
bne .9
lda CONF.NIC
bmi .9
lda CONF.SLOT
beq .9
lda CONF.SERVER
beq .9
clc
.9 php
pha
jsr MLI
.DA #MLICLOSE
.DA MLICLOSE.P
pla
plp
rts
*--------------------------------------
VEDRIVE.CONF.L lda CONF.LBUF
cmp #13 CR
beq .8
cmp #'#' comment
beq .8
lda #CONF.LBUF
sta ZPPtr1
lda /CONF.LBUF
sta ZPPtr1+1
ldy #CONF.KW
lda /CONF.KW
jsr VEDRIVE.CONF.KW
bcs .9
ldx idx
jmp (.5,x)
.5 .DA VEDRIVE.CONF.KW.NIC
.DA VEDRIVE.CONF.KW.SLOT
.DA VEDRIVE.CONF.KW.ADDRESS
.DA VEDRIVE.CONF.KW.MASK
.DA VEDRIVE.CONF.KW.GATEWAY
.DA VEDRIVE.CONF.KW.SERVER
.DA VEDRIVE.CONF.KW.PORT
.8 clc
rts
.9 sec
rts
*--------------------------------------
VEDRIVE.CONF.KW.NIC
jsr VEDRIVE.CONF.SKIPSP
bcs .9
ldy #CONF.KW.NIC
lda /CONF.KW.NIC
jsr VEDRIVE.CONF.KW
bcs .9
lda idx
sta CONF.NIC
clc
.9 rts
*--------------------------------------
VEDRIVE.CONF.KW.SLOT
jsr VEDRIVE.CONF.SKIPSP
bcs .9
lda (ZPPtr1)
cmp #'1'
bcc .9
cmp #'8'
bcs .9
and #$0F
sta CONF.SLOT
clc
rts
.9 sec
rts
*--------------------------------------
VEDRIVE.CONF.KW.ADDRESS
ldx #CONF.ADDRESS-CONF.IPCFG
.HS 2C BIT ABS
VEDRIVE.CONF.KW.MASK
ldx #CONF.MASK-CONF.IPCFG
.HS 2C BIT ABS
VEDRIVE.CONF.KW.GATEWAY
ldx #CONF.GATEWAY-CONF.IPCFG
.HS 2C BIT ABS
VEDRIVE.CONF.KW.SERVER
ldx #CONF.SERVER-CONF.IPCFG
jsr VEDRIVE.CONF.SKIPSP
bcs .9
jsr VEDRIVE.CONF.GetIPatX
.9 rts
*--------------------------------------
VEDRIVE.CONF.KW.PORT
jsr VEDRIVE.CONF.SKIPSP
bcs .9
jsr VEDRIVE.CONF.GetInt
bcs .9
lda int
sta CONF.PORT+1
lda int+1
sta CONF.PORT
.9 rts
*--------------------------------------
VEDRIVE.CONF.KW sty ZPPtr2
sta ZPPtr2+1
ldy #$ff
.1 iny
lda (ZPPtr1),y
cmp #13 CR
beq .2
cmp #32 SPACE
bne .1
.2 sty len
stz idx
.3 lda len
cmp (ZPPtr2)
bne .6
tay
.4 lda (ZPPtr2),y
dey
cmp (ZPPtr1),y
bne .6
tya
bne .4
lda ZPPtr1
clc
adc len
sta ZPPtr1
bcc .5
inc ZPPtr1+1
.5 clc
rts
.6 lda (ZPPtr2)
sec
adc ZPPtr2
sta ZPPtr2
bcc .7
inc ZPPtr2+1
.7 inc idx
inc idx
lda (ZPPtr2)
bne .3
sec
rts
*--------------------------------------
VEDRIVE.CONF.SKIPSP
lda (ZPPtr1)
cmp #32
bne .9
bra .3
.1 lda (ZPPtr1)
cmp #13
beq .9
.2 cmp #32
bne .8
.3 inc ZPPtr1
bne .1
inc ZPPtr1+1
bra .1
.8 clc
.9 rts
*--------------------------------------
VEDRIVE.CONF.GetIPatX
jsr VEDRIVE.CONF.GetShort
bcs .9
ldy #4
.1 sta CONF.IPCFG,x
inx
dey
beq .9 CC
jsr VEDRIVE.GetCharPtr1
bcs .9
cmp #'.'
sec
bne .9
jsr VEDRIVE.CONF.GetShort
bcc .1
.9 rts
*--------------------------------------
VEDRIVE.CONF.GetShort
jsr VEDRIVE.CONF.GetInt
bcs .9
lda int+1
sec
bne .9
lda int
clc
.9 rts
*--------------------------------------
VEDRIVE.CONF.GetInt
stz int
stz int+1
.1 lda (ZPPtr1)
cmp #'0'
bcc .8
cmp #'9'+1
bcs .8
inc ZPPtr1
bne .2
inc ZPPtr1+1
.2 and #$0F
pha
lda int+1
pha
lda int
pha
asl int
rol int+1 x2
asl int
rol int+1 x4
pla
clc
adc int
sta int
pla
adc int+1
sta int+1 x4+1 = x5
asl int
rol int+1 x10
pla
clc
adc int
sta int
bcc .1
inc int+1
bra .1
.8 clc
rts
*--------------------------------------
VEDRIVE.GetCharPtr1
lda (ZPPtr1)
cmp #13
beq .9
inc ZPPtr1
bne .8
inc ZPPtr1+1
.8 clc
.9 rts
*--------------------------------------
MAN
SAVE usr/src/sys/pm.vedrive.s.cf
LOAD usr/src/sys/pm.vedrive.s
ASM