mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-22 16:31:07 +00:00
91 lines
1.6 KiB
Plaintext
91 lines
1.6 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.SRC
|
||
NEW
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
* K.LoadDrvYA
|
||
* in :
|
||
* Y,A = PTR To Full Cmd Line PStrArray
|
||
* out :
|
||
* none
|
||
*--------------------------------------
|
||
K.LoadDrvYA >STYA K.LoadDrv.CmdArray
|
||
|
||
>LDYAI ENV.DRV push ENVNAME=DRV
|
||
jsr K.GetEnvYA get value for ENV=DRV
|
||
bcs .99
|
||
|
||
>PUSHYA Push $DRV value
|
||
|
||
>PUSHW K.LoadDrv.CmdArray (ARG[0] = DRVNAME)
|
||
|
||
jsr K.FileSearch find libname in $DRV
|
||
bcs .99
|
||
stx K.LoadDrv.hFullName
|
||
|
||
jsr K.LoadBinYA Y,A =filename full path
|
||
bcs .98
|
||
|
||
>STYA pDrv
|
||
stx K.LoadDrv.hMem
|
||
|
||
>LDYA K.LoadDrv.CmdArray Advance to ARG[1]
|
||
>STYA ZPQuickPtr1
|
||
|
||
lda ZPQuickPtr1
|
||
sec
|
||
adc (ZPQuickPtr1)
|
||
sta ZPQuickPtr1
|
||
bcc .1
|
||
inc ZPQuickPtr1+1
|
||
|
||
.1 >LDYA ZPQuickPtr1
|
||
jsr pDrvJmp call Dev.Detect
|
||
|
||
bcs .97
|
||
|
||
bit RRAMWRAMBNK2
|
||
bit RRAMWRAMBNK2
|
||
|
||
jsr K.InsDrv
|
||
|
||
bit RRAMWRAMBNK1
|
||
bit RRAMWRAMBNK1
|
||
|
||
bcs .97
|
||
|
||
ldy #S.DEV.F
|
||
lda (pDev),y
|
||
ora #S.DEV.F.INUSE
|
||
sta (pDev),y
|
||
|
||
jsr .97 Cleanup...
|
||
|
||
lda #0 Make sure RC = 0 if success
|
||
clc
|
||
.99 rts
|
||
|
||
.97 pha
|
||
lda K.LoadDrv.hMem
|
||
jsr K.FreeMemA
|
||
pla
|
||
|
||
.98 pha
|
||
lda K.LoadDrv.hFullName
|
||
jsr K.FreeMemA
|
||
pla
|
||
sec
|
||
rts
|
||
*--------------------------------------
|
||
ENV.DRV >PSTRING "DRV"
|
||
K.LoadDrv.CmdArray .BS 2
|
||
K.LoadDrv.hFullName .BS 1
|
||
K.LoadDrv.hMem .BS 1
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE SYS/KERNEL.S.DRV
|
||
LOAD SYS/KERNEL.S
|
||
ASM
|