mirror of
https://github.com/A2osX/A2osX.git
synced 2024-06-26 09:29:30 +00:00
Kernel version 0.9 : CP/MV/RM migration OK
This commit is contained in:
parent
43011c7cd2
commit
d9637361b9
BIN
A2OSX.BOOT.po
BIN
A2OSX.BOOT.po
Binary file not shown.
BIN
A2OSX.DEV.po
BIN
A2OSX.DEV.po
Binary file not shown.
BIN
A2OSX.SRC.po
BIN
A2OSX.SRC.po
Binary file not shown.
|
@ -24,8 +24,8 @@ OptionList >PSTR "CRY"
|
||||||
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm
|
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MSG.USAGE >CSTR "Usage : CP [Src File/Dir, *,? wildcards allowed]\n -C : Continue on error\n -R : Recurse subdirectories\n -Y : Dont't prompt for override\n"
|
MSG.USAGE >CSTR "Usage : CP [Src File/Dir, *,? wildcards allowed]\n -C : Continue on error\n -R : Recurse subdirectories\n -Y : Dont't prompt for override\n"
|
||||||
MSG.DIR >CSTR "CP Dir :%S%S to %S..."
|
MSG.DIR >CSTR "CP Dir :%S%S to %S%S..."
|
||||||
MSG.FILE >CSTR "CP File:%S%S to %S..."
|
MSG.FILE >CSTR "CP File:%S%S to %S%S..."
|
||||||
MSG.OVERWRTE >CSTR "Overwrite [Yes,No,All]?"
|
MSG.OVERWRTE >CSTR "Overwrite [Yes,No,All]?"
|
||||||
MSG.OK >CSTR "[OK]\n"
|
MSG.OK >CSTR "[OK]\n"
|
||||||
MSG.ERR >CSTR "[%h]\n"
|
MSG.ERR >CSTR "[%h]\n"
|
||||||
|
@ -50,6 +50,7 @@ bPause .BS 1
|
||||||
bCopy .BS 1
|
bCopy .BS 1
|
||||||
hToDelete .BS 1
|
hToDelete .BS 1
|
||||||
CopyRC .BS 1
|
CopyRC .BS 1
|
||||||
|
RC .BS 1
|
||||||
bContinue .BS 1
|
bContinue .BS 1
|
||||||
bRecurse .BS 1
|
bRecurse .BS 1
|
||||||
bNoConfirm .BS 1
|
bNoConfirm .BS 1
|
||||||
|
|
|
@ -24,8 +24,8 @@ OptionList >PSTR "CRY"
|
||||||
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm
|
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MSG.USAGE >CSTR "Usage : MV [Src File/Dir, *,? wildcards allowed]\n -C : Continue on error\n -R : Recurse subdirectories\n -Y : Dont't prompt for override\n"
|
MSG.USAGE >CSTR "Usage : MV [Src File/Dir, *,? wildcards allowed]\n -C : Continue on error\n -R : Recurse subdirectories\n -Y : Dont't prompt for override\n"
|
||||||
MSG.DIR >CSTR "MV Dir :%S%S to %S..."
|
MSG.DIR >CSTR "MV Dir :%S%S to %S%S..."
|
||||||
MSG.FILE >CSTR "MV File:%S%S to %S..."
|
MSG.FILE >CSTR "MV File:%S%S to %S%S..."
|
||||||
MSG.OVERWRTE >CSTR "Overwrite [Yes,No,All]?"
|
MSG.OVERWRTE >CSTR "Overwrite [Yes,No,All]?"
|
||||||
MSG.OK >CSTR "[OK]\n"
|
MSG.OK >CSTR "[OK]\n"
|
||||||
MSG.ERR >CSTR "[%h]\n"
|
MSG.ERR >CSTR "[%h]\n"
|
||||||
|
@ -49,6 +49,7 @@ hDstFile .BS 1
|
||||||
bPause .BS 1
|
bPause .BS 1
|
||||||
bCopy .BS 1
|
bCopy .BS 1
|
||||||
hToDelete .BS 1
|
hToDelete .BS 1
|
||||||
|
RC .BS 1
|
||||||
CopyRC .BS 1
|
CopyRC .BS 1
|
||||||
bContinue .BS 1
|
bContinue .BS 1
|
||||||
bRecurse .BS 1
|
bRecurse .BS 1
|
||||||
|
|
|
@ -24,7 +24,7 @@ OptionList >PSTR "CRY"
|
||||||
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm
|
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MSG.USAGE >CSTR "Usage : RM [File/Dir, *,? wildcards allowed]\n -C : Continue on error\n -R : Recurse subdirectories\n"
|
MSG.USAGE >CSTR "Usage : RM [File/Dir, *,? wildcards allowed]\n -C : Continue on error\n -R : Recurse subdirectories\n"
|
||||||
MSG.DIR >CSTR "RM Dir :%S..."
|
MSG.DIR >CSTR "RM Dir :%S%S..."
|
||||||
MSG.FILE >CSTR "RM File:%S%S..."
|
MSG.FILE >CSTR "RM File:%S%S..."
|
||||||
MSG.OK >CSTR "[OK]\n"
|
MSG.OK >CSTR "[OK]\n"
|
||||||
MSG.ERR >CSTR "[%h]\n"
|
MSG.ERR >CSTR "[%h]\n"
|
||||||
|
@ -48,6 +48,7 @@ hDstFile .BS 1
|
||||||
bPause .BS 1
|
bPause .BS 1
|
||||||
bCopy .BS 1
|
bCopy .BS 1
|
||||||
hToDelete .BS 1
|
hToDelete .BS 1
|
||||||
|
RC .BS 1
|
||||||
CopyRC .BS 1
|
CopyRC .BS 1
|
||||||
bContinue .BS 1
|
bContinue .BS 1
|
||||||
bRecurse .BS 1
|
bRecurse .BS 1
|
||||||
|
|
|
@ -181,10 +181,12 @@ CS.RUN >SYSCALL GetC
|
||||||
sta (pData),y
|
sta (pData),y
|
||||||
pla
|
pla
|
||||||
plp
|
plp
|
||||||
jmp CS.RUN.CheckErr
|
jsr CS.RUN.CheckErr
|
||||||
|
bcs .9
|
||||||
|
jmp CS.RUN.NEXT
|
||||||
.FIN
|
.FIN
|
||||||
|
*---------------
|
||||||
.3 jsr GetNextEntry
|
.3 jsr GetEntry
|
||||||
bcs CS.RUN.LEAVE
|
bcs CS.RUN.LEAVE
|
||||||
|
|
||||||
ldy #hFilter
|
ldy #hFilter
|
||||||
|
@ -195,7 +197,7 @@ CS.RUN >SYSCALL GetC
|
||||||
>PUSHYA
|
>PUSHYA
|
||||||
>PUSHW ZPFileName
|
>PUSHW ZPFileName
|
||||||
>SYSCALL PStrMatch
|
>SYSCALL PStrMatch
|
||||||
bcs .8 no match, skip....
|
bcs CS.RUN.NEXT no match, skip....
|
||||||
|
|
||||||
.4 ldy #S.STAT.P.DRIVE
|
.4 ldy #S.STAT.P.DRIVE
|
||||||
lda (ZPFileStat),y ProDOS Device ?
|
lda (ZPFileStat),y ProDOS Device ?
|
||||||
|
@ -208,37 +210,51 @@ CS.RUN >SYSCALL GetC
|
||||||
|
|
||||||
ldy #bRecurse
|
ldy #bRecurse
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
bpl .8
|
bpl CS.RUN.NEXT
|
||||||
|
|
||||||
ldy #1
|
ldy #1
|
||||||
lda (ZPFileName),y
|
lda (ZPFileName),y
|
||||||
cmp #'.'
|
cmp #'.'
|
||||||
beq .8 Skip "." & ".."
|
beq CS.RUN.NEXT Skip "." & ".."
|
||||||
|
|
||||||
jmp CS.RUN.DIR
|
jmp CS.RUN.DIR
|
||||||
|
|
||||||
.5 jmp CS.RUN.FILE
|
.5 jmp CS.RUN.FILE
|
||||||
|
|
||||||
.6 lda #MLI.ERR.UNSUPSS
|
.6 lda #MLI.ERR.UNSUPST
|
||||||
sec
|
sec
|
||||||
rts
|
|
||||||
|
|
||||||
.8 clc
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
CS.RUN.CR.NEXT lda #13
|
||||||
|
>SYSCALL PutCA
|
||||||
|
CS.RUN.NEXT jsr GetNextEntry
|
||||||
|
bcs CS.RUN.LEAVE
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
CS.RUN.LEAVE jsr LeaveSubDir exit this sub dir....
|
CS.RUN.LEAVE jsr LeaveSubDir exit this sub dir....
|
||||||
bcs .99 base, we are done, exit
|
bcs .99 base, we are done, exit
|
||||||
|
jsr BasePath..
|
||||||
|
|
||||||
.DO X.DELETE.SOURCE=1
|
.DO X.DELETE.SOURCE=1
|
||||||
.DO X.COPY.TO.DEST=0
|
.DO X.COPY.TO.DEST=0
|
||||||
ldy #hSrcBasePath
|
|
||||||
jsr CS.RUN.GetBasePath
|
|
||||||
|
|
||||||
>PUSHWI UsrBuf256
|
jsr GetEntry
|
||||||
|
bcs *
|
||||||
|
|
||||||
|
>PUSHW ZPFileName
|
||||||
|
|
||||||
|
ldy #hSrcBasePath
|
||||||
|
lda (pData),y
|
||||||
|
>SYSCALL GetMemPtrA
|
||||||
|
>PUSHYA
|
||||||
|
|
||||||
>LDYA L.MSG.DIR
|
>LDYA L.MSG.DIR
|
||||||
>SYSCALL CPrintFYA
|
>SYSCALL CPrintFYA
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
|
ldy #hSrcBasePath
|
||||||
|
jsr CS.RUN.GetFilePath
|
||||||
|
|
||||||
>LDYAI UsrBuf256
|
>LDYAI UsrBuf256
|
||||||
>SYSCALL RemoveYA
|
>SYSCALL RemoveYA
|
||||||
jsr CS.RUN.CheckErr
|
jsr CS.RUN.CheckErr
|
||||||
|
@ -246,19 +262,22 @@ CS.RUN.LEAVE jsr LeaveSubDir exit this sub dir....
|
||||||
.FIN
|
.FIN
|
||||||
.FIN
|
.FIN
|
||||||
|
|
||||||
jsr BasePath..
|
jmp CS.RUN.NEXT
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
.99 lda #0
|
.99 ldy #RC
|
||||||
|
lda (pData),y get global RC in case of bContinue
|
||||||
sec
|
sec
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.DIR .DO X.COPY.TO.DEST=1
|
CS.RUN.DIR .DO X.COPY.TO.DEST=1
|
||||||
|
|
||||||
|
>PUSHW ZPFileName Filename
|
||||||
|
|
||||||
ldy #hDstBasePath
|
ldy #hDstBasePath
|
||||||
jsr CS.RUN.GetFilePath
|
lda (pData),y
|
||||||
>PUSHWI UsrBuf256
|
>SYSCALL GetMemPtrA
|
||||||
|
>PUSHYA
|
||||||
|
|
||||||
>PUSHW ZPFileName Filename
|
>PUSHW ZPFileName Filename
|
||||||
|
|
||||||
|
@ -271,14 +290,17 @@ CS.RUN.DIR .DO X.COPY.TO.DEST=1
|
||||||
>SYSCALL CPrintFYA
|
>SYSCALL CPrintFYA
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
|
ldy #hDstBasePath
|
||||||
|
jsr CS.RUN.GetFilePath
|
||||||
|
|
||||||
>PUSHW L.STAT
|
>PUSHW L.STAT
|
||||||
>PUSHWI UsrBuf256
|
>PUSHWI UsrBuf256
|
||||||
>SYSCALL Stat
|
>SYSCALL Stat
|
||||||
bcs .2 File Not exists...go create
|
bcs .3 File Not exists...go create
|
||||||
|
|
||||||
ldy #bNoConfirm
|
ldy #bNoConfirm
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
bmi .12 no prompt, nothing to create, enter subdir
|
bmi .21 no prompt, nothing to create, enter subdir
|
||||||
|
|
||||||
>LDYA L.MSG.OVERWRTE
|
>LDYA L.MSG.OVERWRTE
|
||||||
>SYSCALL CPrintFYA
|
>SYSCALL CPrintFYA
|
||||||
|
@ -291,14 +313,12 @@ CS.RUN.DIR .DO X.COPY.TO.DEST=1
|
||||||
beq .99 abort
|
beq .99 abort
|
||||||
|
|
||||||
cmp #'N'
|
cmp #'N'
|
||||||
bne .11
|
bne .2
|
||||||
|
|
||||||
lda #13
|
jmp CS.RUN.CR.NEXT no overwrite, nothing to do, no recurse
|
||||||
>SYSCALL PutCA
|
|
||||||
rts no overwrite, nothing to do, no recurse
|
|
||||||
|
|
||||||
.11 cmp #'Y'
|
.2 cmp #'Y'
|
||||||
beq .12 no create, but recurse
|
beq .21 no create, but recurse
|
||||||
|
|
||||||
cmp #'A'
|
cmp #'A'
|
||||||
bne .1
|
bne .1
|
||||||
|
@ -307,28 +327,28 @@ CS.RUN.DIR .DO X.COPY.TO.DEST=1
|
||||||
lda #$ff
|
lda #$ff
|
||||||
sta (pData),y
|
sta (pData),y
|
||||||
|
|
||||||
.12 lda #0
|
.21 clc
|
||||||
clc
|
lda #0
|
||||||
bra .3
|
bra .4
|
||||||
|
|
||||||
.2 >LDYAI UsrBuf256
|
.3 >LDYAI UsrBuf256
|
||||||
>SYSCALL MKDirYA
|
>SYSCALL MKDirYA
|
||||||
|
|
||||||
.3 jsr CS.RUN.CheckErr
|
.4 jsr CS.RUN.CheckErr
|
||||||
bcs .9
|
bcs .9
|
||||||
.FIN
|
.FIN
|
||||||
|
|
||||||
.7 >LDYA ZPFileName
|
.7 >LDYA ZPFileName
|
||||||
jmp EnterSubDirYA
|
jmp EnterSubDirYA
|
||||||
|
|
||||||
.8 clc
|
.99 ldy #RC
|
||||||
.9 rts
|
lda (pData),y get global RC in case of bContnue
|
||||||
|
|
||||||
.99 lda #0
|
|
||||||
sec
|
sec
|
||||||
rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.FILE .DO X.COPY.TO.DEST=1
|
CS.RUN.FILE .DO X.COPY.TO.DEST=1
|
||||||
|
>PUSHW ZPFileName
|
||||||
|
|
||||||
ldy #hDstBasePath
|
ldy #hDstBasePath
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
>SYSCALL GetMemPtrA
|
>SYSCALL GetMemPtrA
|
||||||
|
@ -336,7 +356,7 @@ CS.RUN.FILE .DO X.COPY.TO.DEST=1
|
||||||
.FIN
|
.FIN
|
||||||
|
|
||||||
>PUSHW ZPFileName
|
>PUSHW ZPFileName
|
||||||
|
|
||||||
ldy #hSrcBasePath
|
ldy #hSrcBasePath
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
>SYSCALL GetMemPtrA
|
>SYSCALL GetMemPtrA
|
||||||
|
@ -348,6 +368,9 @@ CS.RUN.FILE .DO X.COPY.TO.DEST=1
|
||||||
|
|
||||||
.DO X.COPY.TO.DEST=1
|
.DO X.COPY.TO.DEST=1
|
||||||
|
|
||||||
|
ldy #hDstBasePath
|
||||||
|
jsr CS.RUN.GetFilePath
|
||||||
|
|
||||||
>PUSHW L.STAT
|
>PUSHW L.STAT
|
||||||
>PUSHWI UsrBuf256
|
>PUSHWI UsrBuf256
|
||||||
>SYSCALL Stat
|
>SYSCALL Stat
|
||||||
|
@ -370,9 +393,8 @@ CS.RUN.FILE .DO X.COPY.TO.DEST=1
|
||||||
cmp #'N'
|
cmp #'N'
|
||||||
bne .11
|
bne .11
|
||||||
|
|
||||||
lda #13
|
jmp CS.RUN.CR.NEXT no overwrite exit
|
||||||
>SYSCALL PutCA
|
.9 rts
|
||||||
rts no overwrite exit
|
|
||||||
|
|
||||||
.11 cmp #'Y'
|
.11 cmp #'Y'
|
||||||
beq .12 copy
|
beq .12 copy
|
||||||
|
@ -384,8 +406,7 @@ CS.RUN.FILE .DO X.COPY.TO.DEST=1
|
||||||
lda #$ff
|
lda #$ff
|
||||||
sta (pData),y
|
sta (pData),y
|
||||||
|
|
||||||
.12
|
.12 jsr GetEntry get back current entry corrupted by SLEEP
|
||||||
* jsr GetEntry get back current entry corrupted by SLEEP
|
|
||||||
|
|
||||||
.2 jsr CS.RUN.CopyStart
|
.2 jsr CS.RUN.CopyStart
|
||||||
bcc .4
|
bcc .4
|
||||||
|
@ -396,6 +417,7 @@ CS.RUN.FILE .DO X.COPY.TO.DEST=1
|
||||||
.4 .DO X.DELETE.SOURCE=1
|
.4 .DO X.DELETE.SOURCE=1
|
||||||
ldy #hSrcBasePath
|
ldy #hSrcBasePath
|
||||||
jsr CS.RUN.GetFilePath
|
jsr CS.RUN.GetFilePath
|
||||||
|
|
||||||
>LDYAI UsrBuf256
|
>LDYAI UsrBuf256
|
||||||
>SYSCALL NewPStrYA
|
>SYSCALL NewPStrYA
|
||||||
bcs .9
|
bcs .9
|
||||||
|
@ -403,9 +425,12 @@ CS.RUN.FILE .DO X.COPY.TO.DEST=1
|
||||||
ldy #hToDelete
|
ldy #hToDelete
|
||||||
sta (pData),y
|
sta (pData),y
|
||||||
.FIN
|
.FIN
|
||||||
|
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
.9 rts
|
.99 ldy #RC
|
||||||
.99 lda #0
|
lda (pData),y get global RC in case of bContnue
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -438,7 +463,7 @@ CS.RUN.CopyStart
|
||||||
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
|
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
|
||||||
ldy #hDstBasePath
|
ldy #hDstBasePath
|
||||||
jsr CS.RUN.GetFilePath
|
jsr CS.RUN.GetFilePath
|
||||||
|
|
||||||
>PUSHWI UsrBuf256
|
>PUSHWI UsrBuf256
|
||||||
|
|
||||||
>SYSCALL FOpen
|
>SYSCALL FOpen
|
||||||
|
@ -525,9 +550,13 @@ CS.RUN.CopyEnd ldy #hSrcFile
|
||||||
clc
|
clc
|
||||||
ldy #CopyRC
|
ldy #CopyRC
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
beq CS.RUN.CheckErr
|
beq .3
|
||||||
sec
|
sec
|
||||||
bra CS.RUN.CheckErr
|
.3 jsr CS.RUN.CheckErr
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
jmp CS.RUN.NEXT
|
||||||
|
.9 rts
|
||||||
.FIN
|
.FIN
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.CheckErr bcs .1
|
CS.RUN.CheckErr bcs .1
|
||||||
|
@ -535,7 +564,9 @@ CS.RUN.CheckErr bcs .1
|
||||||
>SYSCALL CPrintFYA
|
>SYSCALL CPrintFYA
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.1 pha
|
.1 ldy #RC
|
||||||
|
sta (pData),y
|
||||||
|
pha
|
||||||
|
|
||||||
ldy #bContinue
|
ldy #bContinue
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
|
@ -558,18 +589,15 @@ CS.RUN.CheckErr bcs .1
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.GetFilePath
|
CS.RUN.GetFilePath
|
||||||
jsr CS.RUN.GetBasePath
|
|
||||||
>PUSHW ZPFileName
|
|
||||||
>PUSHWI UsrBuf256
|
|
||||||
>SYSCALL PStrCat
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
CS.RUN.GetBasePath
|
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
>SYSCALL GetMemPtrA
|
>SYSCALL GetMemPtrA
|
||||||
>PUSHYA
|
>PUSHYA
|
||||||
>PUSHWI UsrBuf256
|
>PUSHWI UsrBuf256
|
||||||
>SYSCALL PStrCpy
|
>SYSCALL PStrCpy
|
||||||
|
|
||||||
|
>PUSHW ZPFileName
|
||||||
|
>PUSHWI UsrBuf256
|
||||||
|
>SYSCALL PStrCat
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.DOEVENT sec
|
CS.DOEVENT sec
|
||||||
|
@ -605,5 +633,5 @@ CS.QUIT jsr LeaveSubDir
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MAN
|
MAN
|
||||||
SAVE BIN/X.CPMVRM.S
|
SAVE BIN/X.CPMVRM.S
|
||||||
LOAD BIN/CP.S
|
LOAD BIN/MV.S
|
||||||
ASM
|
ASM
|
||||||
|
|
|
@ -182,52 +182,107 @@ InitDstDirYA >SYSCALL GetFullPathYA
|
||||||
|
|
||||||
.FIN
|
.FIN
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
GetNextEntry ldy #index
|
GetNextEntry jsr GetEntry
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
lda (ZPFileName) Save actual file len for setting up
|
||||||
|
tax new offset later
|
||||||
|
|
||||||
|
lda ZPFileStat
|
||||||
|
clc
|
||||||
|
adc #S.STAT
|
||||||
|
sta ZPFileName
|
||||||
|
|
||||||
|
lda ZPFileStat+1
|
||||||
|
adc /S.STAT
|
||||||
|
sta ZPFileName+1 Make nDIRENTs[i] point to next DIRENT
|
||||||
|
|
||||||
|
lda (ZPFileName) are we at end of this buffer ?
|
||||||
|
beq .1 yes, go read next one ...
|
||||||
|
|
||||||
|
sec
|
||||||
|
adc ZPFileName
|
||||||
|
sta ZPFileStat
|
||||||
|
lda ZPFileName+1
|
||||||
|
adc #0
|
||||||
|
sta ZPFileStat+1
|
||||||
|
|
||||||
|
ldy #index
|
||||||
|
lda (pData),y
|
||||||
|
asl
|
||||||
|
clc
|
||||||
|
adc #oDIRENTs-1
|
||||||
|
tay
|
||||||
|
|
||||||
|
txa Get back previous file len
|
||||||
|
|
||||||
|
sec
|
||||||
|
adc (pData),y
|
||||||
|
sta (pData),y
|
||||||
|
iny
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
adc (pData),y
|
||||||
|
sta (pData),y
|
||||||
|
|
||||||
|
dey
|
||||||
|
|
||||||
|
lda #S.STAT
|
||||||
|
clc
|
||||||
|
adc (pData),y
|
||||||
|
sta (pData),y
|
||||||
|
iny
|
||||||
|
|
||||||
|
lda /S.STAT
|
||||||
|
adc (pData),y
|
||||||
|
sta (pData),y
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
.1 jsr GetEntry.ReadDir
|
||||||
|
bcs .9
|
||||||
|
lda (ZPFileName)
|
||||||
|
beq .99
|
||||||
|
|
||||||
|
sec
|
||||||
|
adc ZPFileName
|
||||||
|
sta ZPFileStat
|
||||||
|
lda ZPFileName+1
|
||||||
|
adc #0
|
||||||
|
sta ZPFileStat+1
|
||||||
|
clc
|
||||||
|
.9 rts
|
||||||
|
|
||||||
|
.99 sec
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
GetEntry ldy #index
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
tax keep index for later
|
|
||||||
clc
|
clc
|
||||||
adc #hDIRENTs-1
|
adc #hDIRENTs-1
|
||||||
tay
|
tay
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
bne .1 we have a buffer to scan
|
bne .1 we have a buffer to scan
|
||||||
|
|
||||||
txa get back index....
|
jsr GetEntry.ReadDir First run, get first block
|
||||||
clc
|
bcs .9 ZPFileName = start of buffer
|
||||||
adc #hDIRs-1
|
|
||||||
tay
|
|
||||||
lda (pData),y
|
|
||||||
|
|
||||||
>SYSCALL ReadDirA
|
|
||||||
bcs InitSrcDirYA.RTS
|
|
||||||
>STYA ZPFileName
|
|
||||||
|
|
||||||
ldy #index
|
|
||||||
lda (pData),y
|
|
||||||
pha save index for later
|
|
||||||
clc
|
|
||||||
adc #hDIRENTs-1
|
|
||||||
tay
|
|
||||||
txa get hDIRENT in A
|
|
||||||
sta (pData),y
|
|
||||||
|
|
||||||
pla get back index
|
|
||||||
asl
|
|
||||||
adc #oDIRENTs-1 and reset offset for this buffer
|
|
||||||
tay
|
|
||||||
lda #0
|
|
||||||
sta (pData),y
|
|
||||||
iny
|
|
||||||
sta (pData),y
|
|
||||||
|
|
||||||
bra .2
|
lda (ZPFileName) Empty !!!
|
||||||
|
bne .8
|
||||||
|
|
||||||
|
txa
|
||||||
|
>SYSCALL FreeMemA
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
|
||||||
.1 >SYSCALL GetMemPtrA
|
.1 >SYSCALL GetMemPtrA
|
||||||
>STYA ZPFileName
|
>STYA ZPFileName
|
||||||
|
|
||||||
ldy #index
|
ldy #index
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
asl
|
asl
|
||||||
adc #oDIRENTs-1 CC from ASL
|
clc
|
||||||
|
adc #oDIRENTs-1
|
||||||
tay
|
tay
|
||||||
|
|
||||||
lda ZPFileName
|
lda ZPFileName
|
||||||
|
@ -238,58 +293,64 @@ GetNextEntry ldy #index
|
||||||
iny
|
iny
|
||||||
lda ZPFileName+1
|
lda ZPFileName+1
|
||||||
adc (pData),y
|
adc (pData),y
|
||||||
sta ZPFileName+1
|
sta ZPFileName+1 ZPFileName=ZPFileName+oDIRENT
|
||||||
|
|
||||||
.2 lda (ZPFileName) first/next DIRENT
|
.8 lda ZPFileName
|
||||||
bne .8
|
|
||||||
|
|
||||||
sta (pData),y reset offset...
|
|
||||||
dey
|
|
||||||
sta (pData),y
|
|
||||||
|
|
||||||
ldy #index
|
|
||||||
lda (pData),y
|
|
||||||
clc
|
|
||||||
adc #hDIRENTs-1
|
|
||||||
tay
|
|
||||||
lda (pData),y
|
|
||||||
pha
|
|
||||||
lda #0
|
|
||||||
sta (pData),y reset hDIRENT
|
|
||||||
pla
|
|
||||||
>SYSCALL FreeMemA discard hDIRENT
|
|
||||||
|
|
||||||
bra GetNextEntry ...startover
|
|
||||||
|
|
||||||
.8 ldy #index
|
|
||||||
lda (pData),y
|
|
||||||
asl
|
|
||||||
adc #oDIRENTs-1
|
|
||||||
tay
|
|
||||||
|
|
||||||
lda (ZPFileName) Add file len+1...
|
|
||||||
sec
|
|
||||||
adc #S.STAT +S.STAT
|
|
||||||
|
|
||||||
clc
|
|
||||||
adc (pData),y Make oDIRENTs[i] point to next DIRENT
|
|
||||||
sta (pData),y
|
|
||||||
|
|
||||||
iny
|
|
||||||
lda (pData),y
|
|
||||||
adc #0
|
|
||||||
sta (pData),y
|
|
||||||
|
|
||||||
lda ZPFileName set Ptr2=Ptr1+LEN-> S.STAT
|
|
||||||
sec
|
sec
|
||||||
adc (ZPFileName)
|
adc (ZPFileName)
|
||||||
sta ZPFileStat
|
sta ZPFileStat
|
||||||
lda ZPFileName+1
|
lda ZPFileName+1
|
||||||
adc #0
|
adc #0
|
||||||
sta ZPFileStat+1
|
sta ZPFileStat+1
|
||||||
|
|
||||||
clc
|
clc
|
||||||
rts
|
.9 rts
|
||||||
|
*--------------------------------------
|
||||||
|
GetEntry.ReadDir
|
||||||
|
ldy #index
|
||||||
|
lda (pData),y
|
||||||
|
clc
|
||||||
|
adc #hDIRENTs-1
|
||||||
|
tay
|
||||||
|
lda (pData),y
|
||||||
|
beq .1
|
||||||
|
pha
|
||||||
|
lda #0
|
||||||
|
sta (pData),y reset hDIRENT
|
||||||
|
pla
|
||||||
|
>SYSCALL FreeMemA discard previous hDIRENT
|
||||||
|
|
||||||
|
.1 ldy #index
|
||||||
|
lda (pData),y
|
||||||
|
clc
|
||||||
|
adc #hDIRs-1
|
||||||
|
tay
|
||||||
|
lda (pData),y
|
||||||
|
|
||||||
|
>SYSCALL ReadDirA
|
||||||
|
bcs .9
|
||||||
|
>STYA ZPFileName
|
||||||
|
|
||||||
|
ldy #index
|
||||||
|
lda (pData),y
|
||||||
|
clc
|
||||||
|
adc #hDIRENTs-1
|
||||||
|
tay
|
||||||
|
txa get hDIRENT in A
|
||||||
|
sta (pData),y
|
||||||
|
|
||||||
|
ldy #index
|
||||||
|
lda (pData),y
|
||||||
|
asl
|
||||||
|
clc
|
||||||
|
adc #oDIRENTs-1 and reset offset for this buffer
|
||||||
|
tay
|
||||||
|
lda #0
|
||||||
|
sta (pData),y
|
||||||
|
iny
|
||||||
|
sta (pData),y
|
||||||
|
clc
|
||||||
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
EnterSubDirYA >STYA ZPPtr2 save SUBDIR for StrCat
|
EnterSubDirYA >STYA ZPPtr2 save SUBDIR for StrCat
|
||||||
|
|
||||||
|
@ -328,7 +389,8 @@ EnterSubDirYA >STYA ZPPtr2 save SUBDIR for StrCat
|
||||||
ldy #hDstBasePath
|
ldy #hDstBasePath
|
||||||
jsr EnterSubDirYA.1
|
jsr EnterSubDirYA.1
|
||||||
.FIN
|
.FIN
|
||||||
|
|
||||||
|
clc
|
||||||
.9 rts
|
.9 rts
|
||||||
|
|
||||||
EnterSubDirYA.1 lda (pData),y
|
EnterSubDirYA.1 lda (pData),y
|
||||||
|
@ -352,10 +414,27 @@ LeaveSubDir ldy #index
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
|
ldy #index
|
||||||
|
lda (pData),y
|
||||||
|
clc
|
||||||
|
adc #hDIRENTs-1
|
||||||
|
tay
|
||||||
|
lda (pData),y
|
||||||
|
beq .1
|
||||||
|
|
||||||
|
pha
|
||||||
|
lda #0
|
||||||
|
sta (pData),y
|
||||||
|
pla
|
||||||
|
>SYSCALL FreeMemA
|
||||||
|
|
||||||
|
.1 ldy #index
|
||||||
|
lda (pData),y
|
||||||
clc
|
clc
|
||||||
adc #hDIRs-1
|
adc #hDIRs-1
|
||||||
tay
|
tay
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
|
|
||||||
pha
|
pha
|
||||||
lda #0
|
lda #0
|
||||||
sta (pData),y
|
sta (pData),y
|
||||||
|
@ -382,6 +461,7 @@ BasePath.. .DO X.COPY.TO.DEST=1
|
||||||
ldy #hDstBasePath
|
ldy #hDstBasePath
|
||||||
jsr BasePath..1
|
jsr BasePath..1
|
||||||
.FIN
|
.FIN
|
||||||
|
|
||||||
ldy #hSrcBasePath
|
ldy #hSrcBasePath
|
||||||
|
|
||||||
BasePath..1 lda (pData),y
|
BasePath..1 lda (pData),y
|
||||||
|
|
|
@ -24,7 +24,7 @@ MLI.ERR.DUPFILE .EQ $47 Duplicate File Name
|
||||||
MLI.ERR.VOLFULL .EQ $48 Volume Full
|
MLI.ERR.VOLFULL .EQ $48 Volume Full
|
||||||
MLI.ERR.DIRFULL .EQ $49 Directory Full
|
MLI.ERR.DIRFULL .EQ $49 Directory Full
|
||||||
MLI.ERR.INCFF .EQ $4A Incompatible File Format
|
MLI.ERR.INCFF .EQ $4A Incompatible File Format
|
||||||
MLI.ERR.UNSUPSS .EQ $4B Unsupported Storage Type
|
MLI.ERR.UNSUPST .EQ $4B Unsupported Storage Type
|
||||||
MLI.ERR.EOF .EQ $4C End of File, No More Data
|
MLI.ERR.EOF .EQ $4C End of File, No More Data
|
||||||
MLI.ERR.BEYEOF .EQ $4D Beyond EOF
|
MLI.ERR.BEYEOF .EQ $4D Beyond EOF
|
||||||
MLI.ERR.LOCKED .EQ $4E File Access Error, File Locked
|
MLI.ERR.LOCKED .EQ $4E File Access Error, File Locked
|
||||||
|
|
|
@ -17,6 +17,7 @@ ERR.Codes .DA #MLI.ERR.IO
|
||||||
.DA #MLI.ERR.DUPFILE
|
.DA #MLI.ERR.DUPFILE
|
||||||
.DA #MLI.ERR.VOLFULL
|
.DA #MLI.ERR.VOLFULL
|
||||||
.DA #MLI.ERR.DIRFULL
|
.DA #MLI.ERR.DIRFULL
|
||||||
|
.DA #MLI.ERR.UNSUPST
|
||||||
.DA #MLI.ERR.EOF
|
.DA #MLI.ERR.EOF
|
||||||
.DA #MLI.ERR.LOCKED
|
.DA #MLI.ERR.LOCKED
|
||||||
.DA #MLI.ERR.OPEN
|
.DA #MLI.ERR.OPEN
|
||||||
|
@ -38,6 +39,7 @@ ERR.Messages >PSTR "I/O Error"
|
||||||
>PSTR "Duplicate Filename"
|
>PSTR "Duplicate Filename"
|
||||||
>PSTR "Volume Is Full"
|
>PSTR "Volume Is Full"
|
||||||
>PSTR "Directory Is Full"
|
>PSTR "Directory Is Full"
|
||||||
|
>PSTR "Unsupported Storage Type"
|
||||||
>PSTR "End Of File"
|
>PSTR "End Of File"
|
||||||
>PSTR "File Access Error, File Locked"
|
>PSTR "File Access Error, File Locked"
|
||||||
>PSTR "File Already Open"
|
>PSTR "File Already Open"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user