2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2017-08-24 12:46:48 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2017-10-09 15:30:48 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* # FStat
|
|
|
|
|
* Return information about a hfile
|
|
|
|
|
* ## In :
|
|
|
|
|
* PUSHW = PTR to S.STAT buffer
|
|
|
|
|
* PUSHB = hFile
|
|
|
|
|
* ## Out :
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
*jsr PFT.CheckNodeSTK
|
|
|
|
|
|
2017-08-24 12:46:48 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # Stat
|
|
|
|
|
* Return information about a file
|
|
|
|
|
* ## In :
|
|
|
|
|
* PUSHW = PTR to S.STAT buffer
|
2017-08-25 15:02:16 +00:00
|
|
|
|
* PUSHW = PTR to Filename (C-String)
|
2017-08-24 12:46:48 +00:00
|
|
|
|
* ## Out :
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.Stat jsr PFT.CheckPathSTK
|
2017-08-25 15:02:16 +00:00
|
|
|
|
jsr STDIO.PullMLIPath
|
2017-08-25 06:37:21 +00:00
|
|
|
|
>PULLW K.Stat.StoreY+1
|
2017-08-24 12:46:48 +00:00
|
|
|
|
>MLICALL MLIGETFILEINFO
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
ldx K.MLI.PARAMS+S.FI.A
|
2017-08-24 12:46:48 +00:00
|
|
|
|
|
|
|
|
|
lda #S.STAT.MODE.XO+S.STAT.MODE.WO+S.STAT.MODE.RO
|
2017-10-27 14:56:46 +00:00
|
|
|
|
cpx #S.FI.A.FULL
|
2017-08-24 12:46:48 +00:00
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
lda #S.STAT.MODE.XO+S.STAT.MODE.RO
|
2017-10-27 14:56:46 +00:00
|
|
|
|
cpx #S.FI.A.R
|
2017-08-24 12:46:48 +00:00
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
|
|
|
|
|
.2 ldy #S.STAT.MODE
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.Stat.StoreY
|
2017-08-24 12:46:48 +00:00
|
|
|
|
|
|
|
|
|
ldx #K.Stat.DST-K.Stat.SRC
|
|
|
|
|
|
|
|
|
|
.3 ldy K.Stat.SRC-1,x
|
|
|
|
|
lda K.MLI.PARAMS,y
|
|
|
|
|
ldy K.Stat.DST-1,x
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.Stat.StoreY
|
2017-08-24 12:46:48 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
ldy #S.STAT.SIZE
|
|
|
|
|
lda #0
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.Stat.StoreY
|
2017-08-24 12:46:48 +00:00
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
lda K.MLI.PARAMS+S.FI.UBLKS
|
2017-08-24 12:46:48 +00:00
|
|
|
|
asl
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.Stat.StoreY
|
2017-08-24 12:46:48 +00:00
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
lda K.MLI.PARAMS+S.FI.UBLKS+1
|
2017-08-24 12:46:48 +00:00
|
|
|
|
rol
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.Stat.StoreY
|
2017-08-24 12:46:48 +00:00
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
rol
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.Stat.StoreY
|
2017-08-24 12:46:48 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
2017-08-25 06:37:21 +00:00
|
|
|
|
|
|
|
|
|
K.Stat.StoreY sta $ffff,y
|
|
|
|
|
rts
|
2017-08-24 12:46:48 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
K.Stat.SRC .DA #S.FI.T
|
|
|
|
|
.DA #S.FI.AUXTYPE,#S.FI.AUXTYPE+1
|
|
|
|
|
.DA #S.FI.UBLKS,#S.FI.UBLKS+1
|
2017-08-24 12:46:48 +00:00
|
|
|
|
K.Stat.DST .DA #S.STAT.P.TYPE
|
|
|
|
|
.DA #S.STAT.P.AUXTYPE,#S.STAT.P.AUXTYPE+1
|
|
|
|
|
.DA #S.STAT.BLOCKS,#S.STAT.BLOCKS+1
|
2017-08-24 15:29:22 +00:00
|
|
|
|
*/-------------------------------------
|
2017-10-31 15:25:16 +00:00
|
|
|
|
* # MKDir.YA
|
2017-08-24 15:29:22 +00:00
|
|
|
|
* ## In:
|
|
|
|
|
* Y,A = DIR name
|
|
|
|
|
* ## Out:
|
|
|
|
|
* CC : success
|
|
|
|
|
* CS : error
|
|
|
|
|
* A = EC
|
|
|
|
|
*\-------------------------------------
|
|
|
|
|
K.MKDir.YA jsr PFT.CheckPathYA
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr STDIO.SetMLIPathYA
|
2017-10-27 14:56:46 +00:00
|
|
|
|
lda #S.FI.A.FULL
|
|
|
|
|
sta K.MLI.PARAMS+S.FI.A
|
|
|
|
|
lda #S.FI.T.DIR
|
|
|
|
|
sta K.MLI.PARAMS+S.FI.T
|
|
|
|
|
lda #S.FI.ST.DIR
|
|
|
|
|
sta K.MLI.PARAMS+S.FI.ST
|
2017-08-24 15:29:22 +00:00
|
|
|
|
|
|
|
|
|
* jsr DATETIME
|
|
|
|
|
|
|
|
|
|
ldx #3
|
|
|
|
|
.1 lda DATELO,x
|
|
|
|
|
sta K.MLI.PARAMS+8,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
>MLICALL MLICREATE
|
|
|
|
|
rts
|
|
|
|
|
*/--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
* # MkNod.YA
|
2017-08-24 15:29:22 +00:00
|
|
|
|
* return a hFile for a given Device Name
|
|
|
|
|
* ## IN:
|
|
|
|
|
* Y,A=DevName
|
|
|
|
|
* ## OUT:
|
|
|
|
|
* CC = OK, CS = ERROR
|
|
|
|
|
* A = hFILE
|
|
|
|
|
*\--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
K.MkNod.YA jsr K.GetDevByName.YA Ptr1=NAME
|
2017-08-24 15:29:22 +00:00
|
|
|
|
bcs .9
|
2018-01-15 06:50:44 +00:00
|
|
|
|
>STYA .1+1
|
|
|
|
|
stx .2+1
|
2017-08-24 15:29:22 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.DEV.S
|
|
|
|
|
lda (pDev),y
|
|
|
|
|
bit #S.DEV.S.BLOCK
|
|
|
|
|
bne .99
|
|
|
|
|
|
|
|
|
|
txa Pass DEV.ID to OPEN
|
|
|
|
|
ldx #DEVMGR.OPEN
|
2018-01-15 06:50:44 +00:00
|
|
|
|
.1 jsr $FFFF SELF MODIFIED
|
2017-08-24 15:29:22 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYAI S.NODE.DEV
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMem0.YA
|
2017-08-24 15:29:22 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>STYA ZPPtr3 Ptr3=S.NODE
|
|
|
|
|
|
|
|
|
|
ldy #S.NODE.T
|
|
|
|
|
lda #S.NODE.T.CDEV
|
|
|
|
|
sta (ZPPtr3),y
|
|
|
|
|
|
|
|
|
|
ldy #S.NODE.DEV.ID
|
|
|
|
|
|
2018-01-15 06:50:44 +00:00
|
|
|
|
.2 lda #$ff Self Modified
|
2017-08-24 15:29:22 +00:00
|
|
|
|
sta (ZPPtr3),y
|
|
|
|
|
|
|
|
|
|
ldy #S.NODE.DEV.JMP
|
2018-01-15 06:50:44 +00:00
|
|
|
|
lda .1+1
|
2017-08-24 15:29:22 +00:00
|
|
|
|
sta (ZPPtr3),y
|
|
|
|
|
|
|
|
|
|
iny
|
2018-01-15 06:50:44 +00:00
|
|
|
|
lda .1+2
|
2017-08-24 15:29:22 +00:00
|
|
|
|
sta (ZPPtr3),y
|
|
|
|
|
txa
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
.99 lda #MLI.E.IO
|
2017-08-24 15:29:22 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # MKFIFO
|
2017-10-09 15:30:48 +00:00
|
|
|
|
* return a hFILE to a new FIFO
|
2017-08-24 15:29:22 +00:00
|
|
|
|
* ## IN:
|
|
|
|
|
* ## OUT:
|
|
|
|
|
* CC = OK, CS = ERROR
|
|
|
|
|
* A = hFILE
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.MKFIFO >LDYAI 256
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMem.YA
|
2017-08-24 15:29:22 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
stx .1+1 save FIFO buffer
|
|
|
|
|
|
|
|
|
|
>LDYAI S.NODE.FIFO
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMem0.YA
|
2017-08-24 15:29:22 +00:00
|
|
|
|
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
|
|
|
|
ldy #S.NODE.T
|
|
|
|
|
lda #S.NODE.T.FIFO
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
|
|
|
|
|
iny S.NODE.FIFO.hMem
|
|
|
|
|
.1 lda #$ff Self Modified
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
txa
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 pha save error code
|
|
|
|
|
lda .1+1 get back FIFO buffer
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.FreeMem.A
|
2017-08-24 15:29:22 +00:00
|
|
|
|
pla
|
|
|
|
|
sec
|
|
|
|
|
|
|
|
|
|
.99 rts
|
2017-08-24 12:46:48 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.STAT
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
|
|
|
|
ASM
|