2016-08-26 15:10:38 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
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
|
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # FOpen
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* Open a file
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In :
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* 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)
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## 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
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
2016-11-13 21:03:31 +00:00
|
|
|
|
.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-07-01 13:44:40 +00:00
|
|
|
|
K.FOpen.10 >LDYAI S.NODE.REG
|
|
|
|
|
jsr K.GetMem0YA
|
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
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
2016-08-26 15:10:38 +00:00
|
|
|
|
.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
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # FCloseA
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* Close a file
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In :
|
2016-08-26 15:10:38 +00:00
|
|
|
|
* A = hFILE
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out :
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*\--------------------------------------
|
2016-12-09 16:36:24 +00:00
|
|
|
|
K.FCloseA jsr PFT.CheckNodeA
|
2017-04-28 15:04:16 +00:00
|
|
|
|
pha
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMemPtrA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2017-04-28 15:04:16 +00:00
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
K.FCloseA.1 sta K.FCloseA.2+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
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
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
|
2017-04-03 15:35:03 +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
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # FReadA
|
2016-12-09 16:36:24 +00:00
|
|
|
|
* Read ONE byte from file
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In :
|
2016-12-09 16:36:24 +00:00
|
|
|
|
* A = hFILE
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out :
|
2016-12-09 16:36:24 +00:00
|
|
|
|
* A = Byte Read
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.FReadA jsr PFT.CheckNodeA
|
|
|
|
|
ldx #MLIREAD
|
|
|
|
|
bra K.FReadWrite.0
|
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # FWriteAY
|
|
|
|
|
* ## In:
|
2016-12-09 16:36:24 +00:00
|
|
|
|
* A = hFILE
|
|
|
|
|
* Y = char
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # Out:
|
2016-12-09 16:36:24 +00:00
|
|
|
|
* 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
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # FRead
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* Read bytes from file
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In :
|
2016-10-29 19:58:21 +00:00
|
|
|
|
* PUSHW = Dest Ptr
|
|
|
|
|
* PUSHW = Bytes To Read
|
|
|
|
|
* PUSHB = hFILE
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out :
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* 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
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # FWrite
|
|
|
|
|
* ## In:
|
2016-10-29 19:58:21 +00:00
|
|
|
|
* PUSHW = Src Ptr
|
|
|
|
|
* PUSHW = Bytes To Write
|
|
|
|
|
* PUSHB = hFILE
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # Out:
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* 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
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # FFlushA
|
|
|
|
|
* ## 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
|
|
|
|
*/-------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # FSeek
|
|
|
|
|
* ## In:
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* 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-04-13 20:59:25 +00:00
|
|
|
|
>PULLA FROM
|
|
|
|
|
tax
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>PULLW K.FSeek.OFFSET
|
|
|
|
|
>PULLW K.FSeek.OFFSET+2
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
2017-04-13 20:59:25 +00:00
|
|
|
|
cpx #SYS.FSeek.SET
|
2017-04-03 15:35:03 +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-04-03 15:35:03 +00:00
|
|
|
|
|
2017-04-13 20:59:25 +00:00
|
|
|
|
.1 cpx #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
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
2017-04-13 20:59:25 +00:00
|
|
|
|
.2 cpx #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-04-03 15:35:03 +00:00
|
|
|
|
|
2017-04-13 20:59:25 +00:00
|
|
|
|
.8 ldx #0
|
|
|
|
|
ldy #3
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.81 lda K.MLI.PARAMS+2,x
|
|
|
|
|
adc K.FSeek.OFFSET,x
|
|
|
|
|
sta K.MLI.PARAMS+2,x
|
|
|
|
|
|
|
|
|
|
inx
|
|
|
|
|
dey
|
|
|
|
|
bne .81
|
|
|
|
|
|
2016-09-22 15:46:01 +00:00
|
|
|
|
bcs .99 Offset out of range!
|
2017-04-03 15:35:03 +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.OFFSET .BS 4
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # FTellA
|
|
|
|
|
* ## In:
|
2016-08-29 15:12:04 +00:00
|
|
|
|
* A = hFILE
|
2017-03-30 16:11:31 +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
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # FEOFA
|
|
|
|
|
* ## In:
|
2016-08-29 15:12:04 +00:00
|
|
|
|
* A = hFILE
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out:
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* 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
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
2016-08-29 15:12:04 +00:00
|
|
|
|
>MLICALL MLIGETEOF
|
|
|
|
|
bcs .9
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
2016-08-29 15:12:04 +00:00
|
|
|
|
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
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +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
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # Rename
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* Rename a file
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In :
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* PUSHW = New Name
|
|
|
|
|
* PUSHW = Old Name
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out :
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*\--------------------------------------
|
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
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # Stat
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* Return information about a file
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In :
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* PUSHW = PTR to S.STAT buffer
|
|
|
|
|
* PUSHW = PTR to Filename (PSTR)
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out :
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*\--------------------------------------
|
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
|
2017-04-12 15:46:03 +00:00
|
|
|
|
|
|
|
|
|
ldx K.MLI.PARAMS+S.FILEINFO.ACCESS
|
2017-04-13 16:04:05 +00:00
|
|
|
|
|
|
|
|
|
lda #S.STAT.MODE.XO+S.STAT.MODE.WO+S.STAT.MODE.RO
|
2017-04-12 15:46:03 +00:00
|
|
|
|
cpx #S.FILEINFO.ACCESS.FULL
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
lda #S.STAT.MODE.XO+S.STAT.MODE.RO
|
2017-04-13 16:04:05 +00:00
|
|
|
|
cpx #S.FILEINFO.ACCESS.R
|
|
|
|
|
beq .2
|
2017-04-12 15:46:03 +00:00
|
|
|
|
|
2017-04-13 16:04:05 +00:00
|
|
|
|
lda #0
|
|
|
|
|
|
2017-04-12 15:46:03 +00:00
|
|
|
|
.2 ldy #S.STAT.MODE
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
dex
|
|
|
|
|
bne .3
|
2017-06-21 15:46:43 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.STAT.SIZE
|
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda K.MLI.PARAMS+S.FILEINFO.BLOCKSUSED
|
|
|
|
|
asl
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda K.MLI.PARAMS+S.FILEINFO.BLOCKSUSED+1
|
|
|
|
|
rol
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
rol
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
|
2017-04-13 16:04:05 +00:00
|
|
|
|
clc
|
2016-09-21 15:20:37 +00:00
|
|
|
|
.9 rts
|
2016-09-20 16:00:51 +00:00
|
|
|
|
*--------------------------------------
|
2017-04-12 15:46:03 +00:00
|
|
|
|
K.Stat.SRC .DA #S.FILEINFO.TYPE
|
|
|
|
|
.DA #S.FILEINFO.AUXTYPE,#S.FILEINFO.AUXTYPE+1
|
2017-06-21 15:46:43 +00:00
|
|
|
|
.DA #S.FILEINFO.BLOCKSUSED,#S.FILEINFO.BLOCKSUSED+1
|
|
|
|
|
|
2017-04-12 15:46:03 +00:00
|
|
|
|
K.Stat.DST .DA #S.STAT.P.TYPE
|
|
|
|
|
.DA #S.STAT.P.AUXTYPE,#S.STAT.P.AUXTYPE+1
|
2017-06-21 15:46:43 +00:00
|
|
|
|
.DA #S.STAT.BLOCKS,#S.STAT.BLOCKS+1
|
|
|
|
|
.DA #S.STAT.SIZE+1,#S.STAT.SIZE+2
|
|
|
|
|
|
2017-04-12 15:46:03 +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-04-03 15:35:03 +00:00
|
|
|
|
|
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
|
|
|
|
*--------------------------------------
|
2016-08-26 15:10:38 +00:00
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.FILE
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
2016-08-26 15:10:38 +00:00
|
|
|
|
ASM
|