mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-20 03:31:42 +00:00
105 lines
2.2 KiB
Plaintext
105 lines
2.2 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.SRC
|
||
NEW
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
* In :
|
||
* PULLW/Y,A = PATH (PSTR)
|
||
* Out :
|
||
*--------------------------------------
|
||
S.PFTCHECKPATHSTK
|
||
lda (pStack) read PTR.LO on top of stack
|
||
pha
|
||
ldy #1
|
||
lda (pStack),y read PTR.HI on top of stack
|
||
ply
|
||
S.PFTCHECKPATHYA
|
||
stx S.PFT.SYSCALL save #SYSCALL
|
||
>STYA ZPQuickPtr1
|
||
|
||
>LDYA FltMgr.Table
|
||
>STYA ZPQuickPtr2
|
||
|
||
.1 lda (ZPQuickPtr2) Get Filter Len
|
||
beq .9 End Of Table, Exit
|
||
tay
|
||
lda (ZPQuickPtr1),y is there a "/" at this point in SRC path?
|
||
cmp #'/'
|
||
bne .8
|
||
|
||
.2 lda (ZPQuickPtr1),y
|
||
cmp (ZPQuickPtr2),y
|
||
bne .8
|
||
dey
|
||
bne .2
|
||
|
||
ldy #S.PFT.HANDLER
|
||
lda (ZPQuickPtr2),y get hLib
|
||
jsr S.GetMemPtrA
|
||
>STYA .3+1
|
||
|
||
lda S.PFT.SYSCALL getback #SYSCALL
|
||
sec
|
||
sbc #SYS.FOPEN-4 0=Lib.load, 2=Lib.Unload
|
||
tax
|
||
|
||
pla discard JSR return @
|
||
pla
|
||
|
||
>LDYA ZPQuickPtr1 restore passed params
|
||
.3 jmp $ffff
|
||
|
||
|
||
.8 lda ZPQuickPtr2
|
||
clc
|
||
adc (ZPQuickPtr2) Add STR len
|
||
adc #S.PFT
|
||
sta ZPQuickPtr2
|
||
bcc .1
|
||
|
||
.9 >LDYA ZPQuickPtr1 restore passed params
|
||
ldx S.PFT.SYSCALL
|
||
rts
|
||
*--------------------------------------
|
||
* In :
|
||
* PULLB/A = hFILE/hDIR
|
||
* Out :
|
||
*--------------------------------------
|
||
S.PFTCHECKFILESTK
|
||
lda (pStack) read hFILE on top of stack
|
||
S.PFTCHECKFILEA
|
||
S.PFTCHECKDIRA stx S.PFT.SYSCALL save #SYSCALL
|
||
sta S.PFT.hFILE
|
||
jsr S.GetMemPtrA X = unmidified
|
||
>STYA ZPQuickPtr1
|
||
lda (ZPQuickPtr1)
|
||
beq .9 Handler is 0, back to kernel....
|
||
|
||
jsr S.GetMemPtrA
|
||
>STYA .1+1
|
||
|
||
lda S.PFT.SYSCALL getback #SYSCALL
|
||
sec
|
||
sbc #SYS.FOPEN-4 0=Lib.load, 2=Lib.Unload
|
||
tax
|
||
|
||
pla discard JSR return @
|
||
pla
|
||
|
||
lda S.PFT.hFILE restore passed params
|
||
.1 jmp $ffff
|
||
|
||
|
||
.9 lda S.PFT.hFILE
|
||
rts
|
||
*--------------------------------------
|
||
S.PFT.hFILE .BS 1
|
||
S.PFT.SYSCALL .BS 1
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE SYS/KERNEL.S.PFT
|
||
LOAD SYS/KERNEL.S
|
||
ASM
|