A2osX/SYS/KERNEL.S.PFT.txt

148 lines
2.7 KiB
Plaintext
Raw Normal View History

2017-12-22 21:24:30 +00:00
NEW
2018-11-17 17:17:13 +00:00
PREFIX
2017-12-22 21:24:30 +00:00
AUTO 4,1
2016-08-24 15:42:33 +00:00
*--------------------------------------
2016-09-26 16:00:52 +00:00
* K.PFTAdd
* In :
* Out :
*--------------------------------------
K.PFTAdd
clc
rts
*--------------------------------------
* K.PFTRemove
* In :
* Out :
*--------------------------------------
K.PFTRemove
clc
rts
*--------------------------------------
2018-09-05 15:22:46 +00:00
* PFT.CheckPathYA
2016-09-26 16:00:52 +00:00
* In :
2018-09-05 15:22:46 +00:00
* Y,A = PATH (C-String)
2016-09-26 16:00:52 +00:00
* Out :
2016-08-24 15:42:33 +00:00
*--------------------------------------
2018-11-16 16:04:20 +00:00
PFT.CheckPathYA stx .71+1 Save SYSCALL #
jsr K.realpath.I realpath in K.Buf256
bcs .9
2016-08-24 15:42:33 +00:00
>LDYAI Flt.Table
2018-11-16 16:04:20 +00:00
>STYA ZPPtr1
2016-08-24 15:42:33 +00:00
2018-11-16 16:04:20 +00:00
.1 lda (ZPPtr1) Get Filter char....
2018-11-16 22:43:12 +00:00
beq .80
2016-08-24 15:42:33 +00:00
ldy #0
2018-11-16 16:04:20 +00:00
.2 lda (ZPPtr1),y
beq .3 end of filter string....
2018-11-16 16:04:20 +00:00
lda K.Buf256,y
beq .8
2018-11-16 16:04:20 +00:00
cmp (ZPPtr1),y
2016-08-24 15:42:33 +00:00
bne .8
iny
2016-08-24 15:42:33 +00:00
bne .2
2018-11-16 16:04:20 +00:00
.3 lda K.Buf256,y
cmp #'/'
bne .8
2016-08-28 20:48:01 +00:00
ldy #S.PFT.HANDLER
2018-11-16 16:04:20 +00:00
lda (ZPPtr1),y get hLib
2018-06-21 15:12:10 +00:00
jsr K.GetMemPtr
2018-11-16 16:04:20 +00:00
>STYA .72+1
2016-08-24 15:42:33 +00:00
pla discard JSR return @
pla
2018-11-16 16:04:20 +00:00
>LDYAI K.Buf256 pass full path to handler
.71 ldx #$ff SELF MODIFIED SYSCALL #
2018-11-19 07:43:00 +00:00
.72 jmp $ffff SELF MODIFIED
2016-08-24 15:42:33 +00:00
2018-11-16 16:04:20 +00:00
.9 rts
2016-08-24 15:42:33 +00:00
2018-11-16 16:04:20 +00:00
.8 lda ZPPtr1
2016-08-24 15:42:33 +00:00
clc
2018-11-16 16:04:20 +00:00
adc (ZPPtr1) Add STR len
adc #S.PFT
2018-11-16 16:04:20 +00:00
sta ZPPtr1
bcc .1
2018-11-16 22:43:12 +00:00
.80 >LDYAI K.Buf256
2018-11-16 16:04:20 +00:00
*--------------------------------------
PFT.YAToMLIPATH >STYA .1+1
ldx #0 no filter, prodos path
.1 lda $ffff,x SELF MODIFIED
beq .2
inx
sta K.MLI.PATH,x
cpx #MLI.MAXPATH
bne .1
2016-08-24 15:42:33 +00:00
2018-11-16 16:04:20 +00:00
.2 stx K.MLI.PATH
inx
stz K.MLI.PATH,x Make ending 0 for /dev/xxx path
>LDYAI K.MLI.PATH
>STYA K.MLI.PARAMS+1
clc
2016-08-24 15:42:33 +00:00
rts
*--------------------------------------
2018-09-05 15:22:46 +00:00
* PFT.CheckNodeA
2016-09-26 16:00:52 +00:00
* In :
2018-11-16 16:04:20 +00:00
* A = hFILE
2016-09-26 16:00:52 +00:00
* Out :
2016-08-24 15:42:33 +00:00
*--------------------------------------
2018-11-16 16:04:20 +00:00
PFT.CheckNodeA stx .80+1 Save SYSCALL #
sta .81+1 Save hFILE
2018-10-08 05:55:28 +00:00
2018-11-16 16:04:20 +00:00
tax
2018-11-19 07:43:00 +00:00
lda OF.Table.hFD,x
2018-11-16 16:04:20 +00:00
beq .9
2018-11-19 21:13:55 +00:00
sta IO.hFD
2018-11-16 16:04:20 +00:00
jsr K.GetMemPtr
>STYA pFD
2018-07-20 11:51:08 +00:00
ldy #S.FD.HANDLER
2018-11-16 16:04:20 +00:00
lda (pFD),y
beq .8 Handler is 0, back to kernel....
2018-06-21 15:12:10 +00:00
jsr K.GetMemPtr
>STYA .1+1
pla discard JSR return @
pla
2016-08-24 15:42:33 +00:00
2018-11-16 16:04:20 +00:00
ldx .80+1 restore SYSCALL #
lda .81+1 restore passed hFILE
2018-11-19 07:43:00 +00:00
.1 jmp $ffff SELF MODIFIED
2016-08-24 15:42:33 +00:00
2018-11-16 16:04:20 +00:00
.8 lda (pFD) #S.FD.T
bne .80
ldy #S.FD.REG.REF
lda (pFD),y
sta K.MLI.PARAMS+1
.80 ldx #$ff SELF MODIFIED
.81 lda #$ff SELF MODIFIED
clc
rts
2018-11-16 16:04:20 +00:00
.9 lda #E.INVH
sec
2016-08-24 15:42:33 +00:00
rts
*--------------------------------------
MAN
2018-11-17 17:17:13 +00:00
SAVE USR/SRC/SYS/KERNEL.S.PFT
LOAD USR/SRC/SYS/KERNEL.S
2016-08-24 15:42:33 +00:00
ASM