Kernel version 0.9 : CP/MV/RM, more bug fix

This commit is contained in:
Rémy GIBERT 2017-02-24 08:46:53 +01:00
parent 69cf7bf321
commit a9ba29a701
4 changed files with 61 additions and 60 deletions

Binary file not shown.

Binary file not shown.

View File

@ -25,7 +25,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%S..." MSG.DIR >CSTR "RM Dir :%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"

View File

@ -129,6 +129,8 @@ CS.INIT >SYSCALL GetArgC
clc clc
rts rts
*-------------------------------------- *--------------------------------------
* CS.RUN
*--------------------------------------
CS.RUN >SYSCALL GetC CS.RUN >SYSCALL GetC
bcs .11 no char bcs .11 no char
@ -147,7 +149,9 @@ CS.RUN >SYSCALL GetC
.11 ldy #bPause .11 ldy #bPause
lda (pData),y lda (pData),y
bmi .8 bpl .1
clc
rts
*-------------------------------------- *--------------------------------------
.1 .DO X.COPY.TO.DEST=1 .1 .DO X.COPY.TO.DEST=1
ldy #bCopy ldy #bCopy
@ -160,7 +164,21 @@ CS.RUN >SYSCALL GetC
ldy #hToDelete ldy #hToDelete
lda (pData),y lda (pData),y
beq .3 beq .3
jmp CS.RUN.Delete
>SYSCALL GetMemPtrA
>SYSCALL RemoveYA
php
pha
ldy #hToDelete
lda (pData),y
>SYSCALL FreeMemA
ldy #hToDelete
lda #0
sta (pData),y
pla
plp
jmp CS.RUN.CheckErr
.FIN .FIN
*-------------------------------------- *--------------------------------------
.3 jsr GetNextEntry Ptr1=NAME, Ptr2=STAT .3 jsr GetNextEntry Ptr1=NAME, Ptr2=STAT
@ -178,36 +196,45 @@ CS.RUN >SYSCALL GetC
.4 ldy #S.STAT.P.DRIVE .4 ldy #S.STAT.P.DRIVE
lda (ZPPtr2),y ProDOS Device ? lda (ZPPtr2),y ProDOS Device ?
bne .5 bne .6
ldy #S.STAT.P.TYPE ldy #S.STAT.P.TYPE
lda (ZPPtr2),y lda (ZPPtr2),y
cmp #$0F Directory ? cmp #$0F Directory ?
beq .6 bne .5
jmp CS.RUN.FILE ldy #bRecurse
lda (pData),y
.5 jmp CS.RUN.DEV bpl .8
jmp CS.RUN.DIR
.6 jmp CS.RUN.DIR
.9 jsr LeaveSubDir .5 jmp CS.RUN.FILE
bcs .99
.6 lda #MLI.ERR.UNSUPSS
sec
rts
*-------------------------------------- *--------------------------------------
.9 jsr LeaveSubDir exit this sub dir....
bcs .99 base, we are done, exit
.DO X.DELETE.SOURCE=1 .DO X.DELETE.SOURCE=1
.DO X.COPY.TO.DEST=0
ldy #hSrcBasePath ldy #hSrcBasePath
jsr CS.RUN.GetBasePath jsr CS.RUN.GetBasePath
>PUSHWI UsrBuf256
>LDYA L.MSG.DIR
>SYSCALL CPrintFYA
bcs .9
>LDYAI UsrBuf256
>SYSCALL RemoveYA >SYSCALL RemoveYA
jsr CS.RUN.CheckErr jsr CS.RUN.CheckErr
bcs .99 bcs .99
.FIN .FIN
.FIN
*-------------------------------------- *--------------------------------------
ldy #bRecurse
lda (pData),y
bpl .8
jsr BasePath.. jsr BasePath..
.8 clc .8 clc
rts rts
@ -215,10 +242,6 @@ CS.RUN >SYSCALL GetC
sec sec
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.DEV
.8 clc
.9 rts
*--------------------------------------
CS.RUN.DIR ldy #1 CS.RUN.DIR ldy #1
lda (ZPPtr1),y lda (ZPPtr1),y
cmp #'.' cmp #'.'
@ -229,7 +252,6 @@ CS.RUN.DIR ldy #1
lda (pData),y lda (pData),y
>SYSCALL GetMemPtrA >SYSCALL GetMemPtrA
>PUSHYA >PUSHYA
.FIN
>PUSHW ZPPtr1 Filename >PUSHW ZPPtr1 Filename
@ -241,8 +263,7 @@ CS.RUN.DIR ldy #1
>LDYA L.MSG.DIR >LDYA L.MSG.DIR
>SYSCALL CPrintFYA >SYSCALL CPrintFYA
bcs .9 bcs .9
*--------------------------------------
.DO X.COPY.TO.DEST=1
ldy #hDstBasePath ldy #hDstBasePath
jsr CS.RUN.GetFilePath jsr CS.RUN.GetFilePath
@ -252,22 +273,9 @@ CS.RUN.DIR ldy #1
bcs .9 bcs .9
.FIN .FIN
*-------------------------------------- *--------------------------------------
ldy #bRecurse
lda (pData),y
bpl .1
>LDYA ZPPtr1 >LDYA ZPPtr1
jmp EnterSubDirYA jmp EnterSubDirYA
*-------------------------------------- *--------------------------------------
.1 .DO X.DELETE.SOURCE=1
ldy #hSrcBasePath
jsr CS.RUN.GetFilePath
>LDYAI UsrBuf256
>SYSCALL RemoveYA
jsr CS.RUN.CheckErr
bcs .9
.FIN
*--------------------------------------
.8 clc .8 clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
@ -291,10 +299,12 @@ CS.RUN.FILE .DO X.COPY.TO.DEST=1
*-------------------------------------- *--------------------------------------
.DO X.COPY.TO.DEST=1 .DO X.COPY.TO.DEST=1
jsr CS.RUN.CopyStart jsr CS.RUN.CopyStart
bcs .9 bcc .1
jsr CS.RUN.CheckErr
rts
.FIN .FIN
*-------------------------------------- *--------------------------------------
.DO X.DELETE.SOURCE=1 .1 .DO X.DELETE.SOURCE=1
ldy #hSrcBasePath ldy #hSrcBasePath
jsr CS.RUN.GetFilePath jsr CS.RUN.GetFilePath
>LDYAI UsrBuf256 >LDYAI UsrBuf256
@ -322,7 +332,7 @@ CS.RUN.CopyStart
>PUSHWI UsrBuf256 >PUSHWI UsrBuf256
>SYSCALL FOpen >SYSCALL FOpen
bcs .9 bcs .99
ldy #hSrcFile ldy #hSrcFile
sta (pData),y sta (pData),y
@ -340,23 +350,24 @@ CS.RUN.CopyStart
>PUSHWI UsrBuf256 >PUSHWI UsrBuf256
>SYSCALL FOpen >SYSCALL FOpen
bcc .1 bcs .9
pha
ldy #hSrcFile
lda (pData),y
>SYSCALL FCloseA
pla
sec
rts
.1 ldy #hDstFile ldy #hDstFile
sta (pData),y sta (pData),y
ldy #bCopy ldy #bCopy
lda #$ff lda #$ff
sta (pData),y sta (pData),y
clc clc
.9 rts rts
.9 pha
ldy #hSrcFile
lda (pData),y
>SYSCALL FCloseA
pla
sec
.99 rts
*-------------------------------------- *--------------------------------------
CS.RUN.Copy stz .90+1 CS.RUN.Copy stz .90+1
>PUSHWI COPY.BUF.SIZE >PUSHWI COPY.BUF.SIZE
@ -426,16 +437,6 @@ CS.RUN.CopyEnd ldy #hSrcFile
sec sec
bra CS.RUN.CheckErr bra CS.RUN.CheckErr
.FIN .FIN
*--------------------------------------
.DO X.DELETE.SOURCE=1
CS.RUN.Delete pha
lda #0
sta (pData),y
pla
>SYSCALL GetMemPtrA
>SYSCALL RemoveYA
bra CS.RUN.CheckErr
.FIN
*-------------------------------------- *--------------------------------------
CS.RUN.CheckErr bcs .1 CS.RUN.CheckErr bcs .1
>LDYA L.MSG.OK >LDYA L.MSG.OK