2016-08-26 15:10:38 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
2017-03-15 16:44:15 +00:00
|
|
|
|
LOMEM $A00
|
2016-08-26 15:10:38 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* For All SYS.xxxx calls, X = #SYSCall
|
|
|
|
|
* Must be kept in X before calling
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* PFT.Check
|
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* #FOpen
|
|
|
|
|
* Open a file
|
|
|
|
|
* ##In :
|
|
|
|
|
* PUSHW = AUXTYPE
|
|
|
|
|
* PUSHB = TYPE
|
|
|
|
|
* PUSHB = MODE
|
2017-01-12 17:43:45 +00:00
|
|
|
|
* SYS.FOpen.R : if R and !exists -> ERROR
|
|
|
|
|
* SYS.FOpen.W : if W and !exists -> CREATE
|
|
|
|
|
* SYS.FOpen.A : Append
|
|
|
|
|
* SYS.FOpen.T : Open/Append in Text mode
|
|
|
|
|
* SYS.FOpen.X : Create if not exists
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* PUSHW = PATH (PSTR)
|
|
|
|
|
* ##Out :
|
2016-08-26 15:10:38 +00:00
|
|
|
|
* CC : A = hFILE
|
|
|
|
|
* CS : A = EC
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*\--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
K.FOpen jsr PFT.CheckPathSTK
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>PULLW K.MLI.PARAMS+1
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>PULLB K.FOpen.MODE
|
|
|
|
|
>PULLB K.FOpen.TYPE
|
|
|
|
|
>PULLW K.FOpen.AUXTYPE
|
2016-08-26 15:10:38 +00:00
|
|
|
|
|
2016-08-28 20:48:01 +00:00
|
|
|
|
>MLICALL MLIGETFILEINFO
|
2017-01-12 17:43:45 +00:00
|
|
|
|
bcc K.FOpen.10 Already Exists
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
bit K.FOpen.MODE Create if not exists ?
|
|
|
|
|
bpl K.FOpen.9 No, return MLI error
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
2016-09-20 16:00:51 +00:00
|
|
|
|
lda #S.FILEINFO.ACCESS.FULL Yes, Create...
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+3 Access
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda K.FOpen.TYPE
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+4 File type
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>LDYA K.FOpen.AUXTYPE
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+5 Aux type
|
2016-09-20 16:00:51 +00:00
|
|
|
|
lda #S.FILEINFO.STORETYPE.STD
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+7
|
2016-11-13 21:03:31 +00:00
|
|
|
|
|
|
|
|
|
ldx #3
|
|
|
|
|
.1 lda DATELO,x
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+8,x
|
2016-11-13 21:03:31 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
2017-02-21 17:01:30 +00:00
|
|
|
|
|
2016-08-28 20:48:01 +00:00
|
|
|
|
>MLICALL MLICREATE
|
2017-01-12 17:43:45 +00:00
|
|
|
|
bcc K.FOpen.10
|
|
|
|
|
K.FOpen.9 rts
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
K.FOpen.10 >PUSHWI S.NODE.REG
|
2016-08-26 15:10:38 +00:00
|
|
|
|
>PUSHBI S.MEM.F.INIT0
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMem
|
2017-01-12 17:43:45 +00:00
|
|
|
|
bcs K.FOpen.9
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2016-11-04 15:13:22 +00:00
|
|
|
|
stx hFILE
|
2016-10-24 15:54:43 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
jsr FILE.SetIOBUF
|
2016-09-01 15:42:38 +00:00
|
|
|
|
bcs .98
|
2017-02-21 07:52:27 +00:00
|
|
|
|
|
2016-08-26 15:10:38 +00:00
|
|
|
|
>MLICALL MLIOPEN
|
2016-08-28 20:48:01 +00:00
|
|
|
|
bcs .98
|
2016-08-26 15:10:38 +00:00
|
|
|
|
|
2017-03-28 15:46:12 +00:00
|
|
|
|
lda K.MLI.PARAMS+5 get ref_num
|
2016-12-09 16:36:24 +00:00
|
|
|
|
ldy #S.NODE.REG.REF
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr1),y
|
2016-08-26 15:10:38 +00:00
|
|
|
|
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+1 Next MLI Calls are REF_NUM based
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda K.FOpen.MODE
|
|
|
|
|
bit #SYS.FOpen.W
|
2016-11-04 15:13:22 +00:00
|
|
|
|
beq .20 Write mode ?
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
and #SYS.FOpen.A Append ?
|
2016-11-04 15:13:22 +00:00
|
|
|
|
bne .11 yes, go to end of file
|
|
|
|
|
|
2017-03-28 15:46:12 +00:00
|
|
|
|
stz K.MLI.PARAMS+2
|
|
|
|
|
stz K.MLI.PARAMS+3
|
|
|
|
|
stz K.MLI.PARAMS+4
|
2016-11-04 15:13:22 +00:00
|
|
|
|
>MLICALL MLISETEOF no, reset size to 0
|
|
|
|
|
bcs .98
|
|
|
|
|
bra .20
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
2016-11-04 15:13:22 +00:00
|
|
|
|
.11 >MLICALL MLIGETEOF
|
2016-08-28 20:48:01 +00:00
|
|
|
|
bcs .98
|
2016-08-26 15:10:38 +00:00
|
|
|
|
|
2016-08-28 20:48:01 +00:00
|
|
|
|
>MLICALL MLISETMARK
|
|
|
|
|
bcs .98
|
2016-08-26 15:10:38 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.20 lda K.FOpen.MODE
|
|
|
|
|
and #SYS.FOpen.T Text Mode ?
|
2016-08-28 20:48:01 +00:00
|
|
|
|
beq .30
|
2016-08-26 15:10:38 +00:00
|
|
|
|
|
2016-08-28 20:48:01 +00:00
|
|
|
|
lda #$FF
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+2
|
2016-08-28 20:48:01 +00:00
|
|
|
|
lda #$0D
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+3
|
2016-08-28 20:48:01 +00:00
|
|
|
|
>MLICALL MLINEWLINE
|
2016-08-26 15:10:38 +00:00
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
.30 ldy #S.NODE.T
|
|
|
|
|
lda #S.NODE.T.REG
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr1),y
|
2016-12-08 16:53:29 +00:00
|
|
|
|
lda hFILE
|
2016-08-26 15:10:38 +00:00
|
|
|
|
clc
|
|
|
|
|
rts CC
|
|
|
|
|
|
|
|
|
|
.98 pha save MLI error
|
2017-02-21 07:52:27 +00:00
|
|
|
|
lda hFILE
|
2016-10-29 19:58:21 +00:00
|
|
|
|
jsr K.FCloseA.1
|
2016-08-26 15:10:38 +00:00
|
|
|
|
pla get back MLI error
|
|
|
|
|
sec
|
2016-11-04 15:13:22 +00:00
|
|
|
|
rts
|
2016-08-26 15:10:38 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
K.FOpen.MODE .BS 1
|
|
|
|
|
K.FOpen.TYPE .BS 1
|
|
|
|
|
K.FOpen.AUXTYPE .BS 2
|
2016-08-26 15:10:38 +00:00
|
|
|
|
hFILE .BS 1
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* #FCloseA
|
|
|
|
|
* Close a file
|
|
|
|
|
* ##In :
|
2016-08-26 15:10:38 +00:00
|
|
|
|
* A = hFILE
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* ##Out :
|
|
|
|
|
*\--------------------------------------
|
2016-12-09 16:36:24 +00:00
|
|
|
|
K.FCloseA jsr PFT.CheckNodeA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta K.FCloseA.2+1
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMemPtrA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2016-08-26 15:10:38 +00:00
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
K.FCloseA.1 ldy #S.NODE.REG.REF
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2016-08-26 15:10:38 +00:00
|
|
|
|
beq .1
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+1
|
2016-08-26 15:10:38 +00:00
|
|
|
|
>MLICALL MLICLOSE
|
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
.1 ldy #S.NODE.REG.IOBUF
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
beq K.FCloseA.2
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.FreeMemA
|
2016-08-26 15:10:38 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
K.FCloseA.2 lda #$ff Self Modified
|
|
|
|
|
jmp K.FreeMemA
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
2016-12-09 16:36:24 +00:00
|
|
|
|
* #FReadA
|
|
|
|
|
* Read ONE byte from file
|
|
|
|
|
* ##In :
|
|
|
|
|
* A = hFILE
|
|
|
|
|
* ##Out :
|
|
|
|
|
* A = Byte Read
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.FReadA jsr PFT.CheckNodeA
|
|
|
|
|
ldx #MLIREAD
|
|
|
|
|
bra K.FReadWrite.0
|
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* #FWriteAY
|
|
|
|
|
* ##In:
|
|
|
|
|
* A = hFILE
|
|
|
|
|
* Y = char
|
|
|
|
|
* #Out:
|
|
|
|
|
* Y,A = Bytes Written
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.FWriteAY jsr PFT.CheckNodeA
|
2017-03-15 16:44:15 +00:00
|
|
|
|
sty K.FWriteAY.Buf
|
2016-12-09 16:36:24 +00:00
|
|
|
|
ldx #MLIWRITE
|
|
|
|
|
K.FReadWrite.0 jsr FILE.SetupPrt1A
|
2017-03-15 16:44:15 +00:00
|
|
|
|
>LDYAI K.FWriteAY.Buf
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+2
|
2016-12-09 16:36:24 +00:00
|
|
|
|
lda #1
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+4
|
|
|
|
|
stz K.MLI.PARAMS+5
|
2016-12-09 16:36:24 +00:00
|
|
|
|
lda #4 Param Count = 4 for MLIREAD & MLIWRITE
|
|
|
|
|
jsr A2osX.MLICALL
|
|
|
|
|
bcs .9
|
2017-03-15 16:44:15 +00:00
|
|
|
|
lda K.FWriteAY.Buf
|
|
|
|
|
.9 rts
|
|
|
|
|
K.FWriteAY.Buf .BS 1
|
2016-12-09 16:36:24 +00:00
|
|
|
|
*/--------------------------------------
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* #FRead
|
|
|
|
|
* Read bytes from file
|
|
|
|
|
* ##In :
|
2016-10-29 19:58:21 +00:00
|
|
|
|
* PUSHW = Dest Ptr
|
|
|
|
|
* PUSHW = Bytes To Read
|
|
|
|
|
* PUSHB = hFILE
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* ##Out :
|
|
|
|
|
* Y,A = Bytes Read
|
|
|
|
|
*\--------------------------------------
|
2016-12-09 16:36:24 +00:00
|
|
|
|
K.FRead jsr PFT.CheckNodeSTK
|
2016-09-27 15:51:59 +00:00
|
|
|
|
ldx #MLIREAD
|
2016-12-09 16:36:24 +00:00
|
|
|
|
bra K.FReadWrite.1
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* #FWrite
|
|
|
|
|
* ##In:
|
2016-10-29 19:58:21 +00:00
|
|
|
|
* PUSHW = Src Ptr
|
|
|
|
|
* PUSHW = Bytes To Write
|
|
|
|
|
* PUSHB = hFILE
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* #Out:
|
|
|
|
|
* Y,A = Bytes Written
|
|
|
|
|
*\--------------------------------------
|
2016-12-09 16:36:24 +00:00
|
|
|
|
K.FWrite jsr PFT.CheckNodeSTK
|
2016-09-27 15:51:59 +00:00
|
|
|
|
ldx #MLIWRITE
|
2016-12-09 16:36:24 +00:00
|
|
|
|
K.FReadWrite.1 >PULLA
|
2016-10-03 06:18:46 +00:00
|
|
|
|
jsr FILE.SetupPrt1A
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>PULLW K.MLI.PARAMS+4
|
|
|
|
|
>PULLW K.MLI.PARAMS+2
|
2016-09-27 15:51:59 +00:00
|
|
|
|
|
|
|
|
|
lda #4 Param Count = 4 for MLIREAD & MLIWRITE
|
|
|
|
|
jsr A2osX.MLICALL
|
2016-08-26 15:10:38 +00:00
|
|
|
|
bcs .9
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>LDYA K.MLI.PARAMS+6
|
2016-08-26 15:10:38 +00:00
|
|
|
|
.9 rts
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* #FFlushA
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* ##In:
|
2016-08-26 15:10:38 +00:00
|
|
|
|
* A = hFILE
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*\--------------------------------------
|
2016-12-09 16:36:24 +00:00
|
|
|
|
K.FFlushA jsr PFT.CheckNodeA
|
2016-09-26 16:00:52 +00:00
|
|
|
|
jsr FILE.SetupPrt1A
|
2016-08-26 15:10:38 +00:00
|
|
|
|
>MLICALL MLIFLUSH
|
|
|
|
|
rts
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/-------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* #FSeek
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* ##In:
|
|
|
|
|
* PUSHW = OffsetHi
|
|
|
|
|
* PUSHW = OffsetLo
|
|
|
|
|
* PUSHB = From
|
|
|
|
|
* PUSHB = hFILE
|
|
|
|
|
*\-------------------------------------
|
2016-12-09 16:36:24 +00:00
|
|
|
|
K.FSeek jsr PFT.CheckNodeSTK
|
2016-08-29 15:12:04 +00:00
|
|
|
|
>PULLA
|
2016-09-26 16:00:52 +00:00
|
|
|
|
jsr FILE.SetupPrt1A
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>PULLB K.FSeek.FROM
|
|
|
|
|
>PULLW K.FSeek.OFFSET
|
|
|
|
|
>PULLW K.FSeek.OFFSET+2
|
2016-09-22 15:46:01 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda K.FSeek.FROM
|
2016-08-29 15:12:04 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
* cmp #SYS.FSeek.SET =0
|
2016-09-22 15:46:01 +00:00
|
|
|
|
|
2016-08-29 15:12:04 +00:00
|
|
|
|
bne .1
|
2017-03-28 15:46:12 +00:00
|
|
|
|
stz K.MLI.PARAMS+2
|
|
|
|
|
stz K.MLI.PARAMS+3
|
|
|
|
|
stz K.MLI.PARAMS+4
|
2016-09-22 15:46:01 +00:00
|
|
|
|
bra .8
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.1 cmp #SYS.FSeek.CUR
|
2016-09-22 15:46:01 +00:00
|
|
|
|
bne .2
|
2016-08-29 15:12:04 +00:00
|
|
|
|
>MLICALL MLIGETMARK
|
2016-09-22 15:46:01 +00:00
|
|
|
|
bcc .8
|
|
|
|
|
rts
|
2016-08-29 15:12:04 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.2 cmp #SYS.FSeek.END
|
2016-09-22 15:46:01 +00:00
|
|
|
|
bne .98
|
2016-08-29 15:12:04 +00:00
|
|
|
|
>MLICALL MLIGETEOF
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-03-28 15:46:12 +00:00
|
|
|
|
.8 lda K.MLI.PARAMS+2
|
2017-01-12 17:43:45 +00:00
|
|
|
|
adc K.FSeek.OFFSET
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+2
|
|
|
|
|
lda K.MLI.PARAMS+3
|
2017-01-12 17:43:45 +00:00
|
|
|
|
adc K.FSeek.OFFSET+1
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+3
|
|
|
|
|
lda K.MLI.PARAMS+4
|
2017-01-12 17:43:45 +00:00
|
|
|
|
adc K.FSeek.OFFSET+2
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+4
|
2016-09-22 15:46:01 +00:00
|
|
|
|
bcs .99 Offset out of range!
|
2016-08-29 15:12:04 +00:00
|
|
|
|
|
2016-09-22 15:46:01 +00:00
|
|
|
|
>MLICALL MLISETMARK
|
2016-08-29 15:12:04 +00:00
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
|
2016-09-22 15:46:01 +00:00
|
|
|
|
.98 lda #SYSMGR.ERRSYN
|
|
|
|
|
.HS 2C bit abs
|
2016-08-29 15:12:04 +00:00
|
|
|
|
.99 lda #SYSMGR.ERRFTB
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2016-08-26 15:10:38 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
K.FSeek.FROM .BS 1
|
|
|
|
|
K.FSeek.OFFSET .BS 4
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* #FTellA
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* ##In:
|
2016-08-29 15:12:04 +00:00
|
|
|
|
* A = hFILE
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* ##Out:
|
2016-08-29 15:12:04 +00:00
|
|
|
|
* Y,A,X = Offset
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*\--------------------------------------
|
2016-12-09 16:36:24 +00:00
|
|
|
|
K.FTellA jsr PFT.CheckNodeA
|
2016-10-26 20:51:06 +00:00
|
|
|
|
K.FTellA.1 jsr FILE.SetupPrt1A
|
2016-08-29 15:12:04 +00:00
|
|
|
|
>MLICALL MLIGETMARK
|
|
|
|
|
bcs .9
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>LDYA K.MLI.PARAMS+2
|
|
|
|
|
ldx K.MLI.PARAMS+4
|
2016-08-29 15:12:04 +00:00
|
|
|
|
.9 rts
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* #FEOFA
|
|
|
|
|
* ##In:
|
2016-08-29 15:12:04 +00:00
|
|
|
|
* A = hFILE
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* ##Out:
|
|
|
|
|
* CC :
|
|
|
|
|
* A=0 EOF
|
|
|
|
|
* A !=0 NOT EOF
|
|
|
|
|
* CS :
|
|
|
|
|
*\--------------------------------------
|
2016-12-09 16:36:24 +00:00
|
|
|
|
K.FEOFA jsr PFT.CheckNodeA
|
2016-09-26 16:00:52 +00:00
|
|
|
|
jsr FILE.SetupPrt1A
|
2017-01-12 17:43:45 +00:00
|
|
|
|
jsr K.FTellA.1
|
2016-08-29 15:12:04 +00:00
|
|
|
|
bcs .9
|
2016-09-21 15:20:37 +00:00
|
|
|
|
>STYA K.FEOFA.MARK
|
|
|
|
|
stx K.FEOFA.MARK+2
|
2016-08-29 15:12:04 +00:00
|
|
|
|
|
|
|
|
|
>MLICALL MLIGETEOF
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
sec
|
2017-03-28 15:46:12 +00:00
|
|
|
|
lda K.MLI.PARAMS+2
|
2016-09-21 15:20:37 +00:00
|
|
|
|
sbc K.FEOFA.MARK
|
2016-08-29 15:12:04 +00:00
|
|
|
|
bne .8
|
2017-03-28 15:46:12 +00:00
|
|
|
|
lda K.MLI.PARAMS+3
|
2016-09-21 15:20:37 +00:00
|
|
|
|
sbc K.FEOFA.MARK+1
|
2016-08-29 15:12:04 +00:00
|
|
|
|
bne .8
|
2017-03-28 15:46:12 +00:00
|
|
|
|
lda K.MLI.PARAMS+4
|
2016-09-21 15:20:37 +00:00
|
|
|
|
sbc K.FEOFA.MARK+2
|
2016-08-29 15:12:04 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
.9 rts
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.FEOFA.MARK .BS 3
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* #RemoveYA
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*\--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
K.RemoveYA jsr PFT.CheckPathYA
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+1
|
2016-08-29 15:12:04 +00:00
|
|
|
|
>MLICALL MLIDESTROY
|
|
|
|
|
rts
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* #Rename
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* Rename a file
|
|
|
|
|
* ##In :
|
|
|
|
|
* PUSHW = New Name
|
|
|
|
|
* PUSHW = Old Name
|
|
|
|
|
* ##Out :
|
|
|
|
|
*\--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
K.Rename jsr PFT.CheckPathSTK
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>PULLW K.MLI.PARAMS+1
|
|
|
|
|
>PULLW K.MLI.PARAMS+3
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>MLICALL MLIRename
|
2016-08-29 15:12:04 +00:00
|
|
|
|
rts
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
* #Stat
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* Return information about a file
|
|
|
|
|
* ##In :
|
|
|
|
|
* PUSHW = PTR to S.STAT buffer
|
|
|
|
|
* PUSHW = PTR to Filename (PSTR)
|
|
|
|
|
* ##Out :
|
|
|
|
|
*\--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
K.Stat jsr PFT.CheckPathSTK
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>PULLW K.MLI.PARAMS+1
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>PULLW ZPPtr2
|
2016-09-21 15:20:37 +00:00
|
|
|
|
>MLICALL MLIGETFILEINFO
|
|
|
|
|
bcs .9
|
2016-10-08 20:53:45 +00:00
|
|
|
|
jsr FILE.MLI2STAT
|
2016-09-26 16:00:52 +00:00
|
|
|
|
clc
|
2016-09-21 15:20:37 +00:00
|
|
|
|
.9 rts
|
2016-09-20 16:00:51 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
FILE.SetIOBUF >PUSHWI 1024 get a ProDOS IOBUF
|
|
|
|
|
>PUSHBI S.MEM.F.ALIGN+S.MEM.F.NOMOVE
|
|
|
|
|
jsr K.GetMem
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+3 Save Ptr to IOBUF for MLIOPEN call
|
2017-01-12 17:43:45 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #S.NODE.REG.IOBUF
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2016-09-26 16:00:52 +00:00
|
|
|
|
FILE.SetupPrt1A jsr K.GetMemPtrA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2016-12-09 16:36:24 +00:00
|
|
|
|
ldy #S.NODE.REG.REF
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2017-03-28 15:46:12 +00:00
|
|
|
|
sta K.MLI.PARAMS+1
|
2016-08-29 15:12:04 +00:00
|
|
|
|
rts
|
2016-09-26 16:00:52 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-28 15:46:12 +00:00
|
|
|
|
FILE.MLI2STAT lda K.MLI.PARAMS+S.FILEINFO.ACCESS
|
2016-09-26 16:00:52 +00:00
|
|
|
|
cmp #S.FILEINFO.ACCESS.FULL
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
lda #S.STAT.MODE.XO+S.STAT.MODE.WO+S.STAT.MODE.RO
|
|
|
|
|
bra .2
|
|
|
|
|
|
|
|
|
|
.1 and #S.FILEINFO.ACCESS.R
|
|
|
|
|
beq .2
|
|
|
|
|
lda #S.STAT.MODE.XO+S.STAT.MODE.RO
|
|
|
|
|
|
|
|
|
|
.2 ldy #S.STAT.MODE
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr2),y
|
2016-09-26 16:00:52 +00:00
|
|
|
|
|
2016-10-03 06:18:46 +00:00
|
|
|
|
ldx #2
|
2016-12-09 16:36:24 +00:00
|
|
|
|
ldy #S.STAT.P.TYPE+2
|
2016-10-03 06:18:46 +00:00
|
|
|
|
|
2017-03-28 15:46:12 +00:00
|
|
|
|
.3 lda K.MLI.PARAMS+S.FILEINFO.TYPE,x
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr2),y
|
2016-10-03 06:18:46 +00:00
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .3
|
2016-09-26 16:00:52 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-08-26 15:10:38 +00:00
|
|
|
|
MAN
|
2016-09-02 06:09:44 +00:00
|
|
|
|
SAVE SYS/KERNEL.S.FILE
|
2016-08-26 15:10:38 +00:00
|
|
|
|
LOAD SYS/KERNEL.S
|
|
|
|
|
ASM
|