mirror of
https://github.com/A2osX/A2osX.git
synced 2024-08-14 13:29:02 +00:00
Kernel version 0.9 :
- SHELL : internal commands are now case insensitive - MV : MV can now rename files properly....bug still remains : ask for confirm ??
This commit is contained in:
parent
bdb42e3b20
commit
81a3fcbd77
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -45,6 +45,7 @@ oDIRENTs .BS X.MAX.RECURSE*2
|
|||||||
hSrcBasePath .BS 1
|
hSrcBasePath .BS 1
|
||||||
hDstBasePath .BS 1
|
hDstBasePath .BS 1
|
||||||
hFilter .BS 1
|
hFilter .BS 1
|
||||||
|
hDstFileName .BS 1
|
||||||
hSrcFile .BS 1
|
hSrcFile .BS 1
|
||||||
hDstFile .BS 1
|
hDstFile .BS 1
|
||||||
bPause .BS 1
|
bPause .BS 1
|
||||||
|
@ -101,7 +101,7 @@ CS.INIT >SYSCALL GetArgC
|
|||||||
jsr CS.INIT.Check.Wildcard
|
jsr CS.INIT.Check.Wildcard
|
||||||
|
|
||||||
>LDYA ZPPtr1
|
>LDYA ZPPtr1
|
||||||
jsr InitSrcDirPatYA
|
jsr InitSrcDirYA
|
||||||
bcc .1 success, scan for any other args
|
bcc .1 success, scan for any other args
|
||||||
.9 rts
|
.9 rts
|
||||||
|
|
||||||
@ -337,8 +337,7 @@ CS.RUN.DIR .DO X.COPY.TO.DEST=1
|
|||||||
>SYSCALL CPrintFYA
|
>SYSCALL CPrintFYA
|
||||||
bcs CS.RUN.DIR.RTS
|
bcs CS.RUN.DIR.RTS
|
||||||
|
|
||||||
ldy #hDstBasePath
|
jsr CS.RUN.GetDstFilePath
|
||||||
jsr CS.RUN.GetFilePath
|
|
||||||
|
|
||||||
>PUSHW L.STAT
|
>PUSHW L.STAT
|
||||||
>PUSHWI UsrBuf256
|
>PUSHWI UsrBuf256
|
||||||
@ -402,8 +401,7 @@ CS.RUN.FILE ldy #bQuiet
|
|||||||
|
|
||||||
.14 .DO X.COPY.TO.DEST=1
|
.14 .DO X.COPY.TO.DEST=1
|
||||||
|
|
||||||
ldy #hDstBasePath
|
jsr CS.RUN.GetDstFilePath
|
||||||
jsr CS.RUN.GetFilePath
|
|
||||||
|
|
||||||
>PUSHW L.STAT
|
>PUSHW L.STAT
|
||||||
>PUSHWI UsrBuf256
|
>PUSHWI UsrBuf256
|
||||||
@ -472,8 +470,8 @@ CS.RUN.FILE ldy #bQuiet
|
|||||||
.FIN
|
.FIN
|
||||||
|
|
||||||
.4 .DO X.DELETE.SOURCE=1
|
.4 .DO X.DELETE.SOURCE=1
|
||||||
ldy #hSrcBasePath
|
|
||||||
jsr CS.RUN.GetFilePath
|
jsr CS.RUN.GetSrcFilePath
|
||||||
|
|
||||||
>LDYAI UsrBuf256
|
>LDYAI UsrBuf256
|
||||||
>SYSCALL NewPStrYA
|
>SYSCALL NewPStrYA
|
||||||
@ -492,9 +490,17 @@ CS.RUN.FILE ldy #bQuiet
|
|||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.FILE.MSG .DO X.COPY.TO.DEST=1
|
CS.RUN.FILE.MSG .DO X.COPY.TO.DEST=1
|
||||||
>PUSHW ZPFileName
|
ldy #hDstFileName
|
||||||
|
lda (pData),y
|
||||||
|
beq .1
|
||||||
|
|
||||||
ldy #hDstBasePath
|
>SYSCALL GetMemPtrA
|
||||||
|
>PUSHYA
|
||||||
|
bra .2
|
||||||
|
|
||||||
|
.1 >PUSHW ZPFileName
|
||||||
|
|
||||||
|
.2 ldy #hDstBasePath
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
>SYSCALL GetMemPtrA
|
>SYSCALL GetMemPtrA
|
||||||
>PUSHYA
|
>PUSHYA
|
||||||
@ -513,16 +519,26 @@ CS.RUN.FILE.MSG .DO X.COPY.TO.DEST=1
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.DO X.COPY.TO.DEST=1
|
.DO X.COPY.TO.DEST=1
|
||||||
.DO X.DELETE.SOURCE=1
|
.DO X.DELETE.SOURCE=1
|
||||||
CS.RUN.Rename ldy #hDstFile
|
CS.RUN.Rename jsr CS.RUN.GetDstFilePath
|
||||||
lda (pData),y
|
|
||||||
>SYSCALL GetMemPtrA
|
>LDYAI UsrBuf256
|
||||||
|
>SYSCALL NewPStrYA
|
||||||
|
stx .1+1
|
||||||
>PUSHYA
|
>PUSHYA
|
||||||
|
|
||||||
ldy #hSrcBasePath
|
jsr CS.RUN.GetSrcFilePath
|
||||||
jsr CS.RUN.GetFilePath
|
>PUSHWI UsrBuf256
|
||||||
>PUSHYA
|
|
||||||
>SYSCALL Rename
|
>SYSCALL Rename
|
||||||
|
php
|
||||||
|
pha
|
||||||
|
.1 lda #$ff
|
||||||
|
>SYSCALL FreeMemA
|
||||||
|
pla
|
||||||
|
plp
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
.9 bra .9
|
||||||
.FIN
|
.FIN
|
||||||
.FIN
|
.FIN
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -535,8 +551,8 @@ CS.RUN.CopyStart
|
|||||||
ldy #S.STAT.P.TYPE
|
ldy #S.STAT.P.TYPE
|
||||||
>PUSHB (ZPFileStat),y
|
>PUSHB (ZPFileStat),y
|
||||||
>PUSHBI SYS.FOpen.R
|
>PUSHBI SYS.FOpen.R
|
||||||
ldy #hSrcBasePath
|
|
||||||
jsr CS.RUN.GetFilePath
|
jsr CS.RUN.GetSrcFilePath
|
||||||
|
|
||||||
>PUSHWI UsrBuf256
|
>PUSHWI UsrBuf256
|
||||||
>SYSCALL FOpen
|
>SYSCALL FOpen
|
||||||
@ -552,8 +568,8 @@ CS.RUN.CopyStart
|
|||||||
ldy #S.STAT.P.TYPE
|
ldy #S.STAT.P.TYPE
|
||||||
>PUSHB (ZPFileStat),y
|
>PUSHB (ZPFileStat),y
|
||||||
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
|
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
|
||||||
ldy #hDstBasePath
|
|
||||||
jsr CS.RUN.GetFilePath
|
jsr CS.RUN.GetDstFilePath
|
||||||
|
|
||||||
>PUSHWI UsrBuf256
|
>PUSHWI UsrBuf256
|
||||||
>SYSCALL FOpen
|
>SYSCALL FOpen
|
||||||
@ -702,16 +718,35 @@ CS.RUN.CheckErr bcs .1
|
|||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.GetFilePath
|
CS.RUN.GetSrcFilePath
|
||||||
|
ldy #hSrcBasePath
|
||||||
|
jsr CS.RUN.GeFilePath
|
||||||
|
|
||||||
|
>PUSHW ZPFileName
|
||||||
|
>PUSHWI UsrBuf256
|
||||||
|
>SYSCALL PStrCat
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
CS.RUN.GetDstFilePath
|
||||||
|
ldy #hDstBasePath
|
||||||
|
jsr CS.RUN.GeFilePath
|
||||||
|
|
||||||
|
ldy #hDstFileName
|
||||||
|
lda (pData),y
|
||||||
|
beq .9
|
||||||
|
|
||||||
|
>SYSCALL GetMemPtrA
|
||||||
|
>PUSHYA
|
||||||
|
>PUSHWI UsrBuf256
|
||||||
|
>SYSCALL PStrCat
|
||||||
|
.9 rts
|
||||||
|
*--------------------------------------
|
||||||
|
CS.RUN.GeFilePath
|
||||||
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
|
||||||
@ -737,7 +772,12 @@ CS.QUIT jsr LeaveSubDir
|
|||||||
lda (pData),y
|
lda (pData),y
|
||||||
>SYSCALL FCloseA
|
>SYSCALL FCloseA
|
||||||
|
|
||||||
.2 ldy #hFilter
|
.2 ldy #hDstFilename
|
||||||
|
lda (pData),y
|
||||||
|
beq .3
|
||||||
|
>SYSCALL FreeMemA
|
||||||
|
|
||||||
|
.3 ldy #hFilter
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
beq .8
|
beq .8
|
||||||
>SYSCALL FreeMemA
|
>SYSCALL FreeMemA
|
||||||
|
@ -133,11 +133,56 @@ InitSrcDirYA.RTS
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.DO X.COPY.TO.DEST=1
|
.DO X.COPY.TO.DEST=1
|
||||||
InitDstDirYA >SYSCALL GetFullPathYA
|
InitDstDirYA >SYSCALL GetFullPathYA
|
||||||
bcs .99
|
bcc .10
|
||||||
|
rts
|
||||||
|
|
||||||
stx .90+1
|
.10 stx .90+1
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
|
|
||||||
|
>PUSHW L.STAT
|
||||||
|
>PUSHW ZPPtr1
|
||||||
|
>SYSCALL Stat
|
||||||
|
bcs .1 File/DIR does not exists, go extract DstFileName
|
||||||
|
|
||||||
|
lda STAT+S.STAT.P.TYPE
|
||||||
|
cmp #$0f
|
||||||
|
beq .5 Dst is a directory...no destfilename
|
||||||
|
|
||||||
|
.1 lda (ZPPtr1)
|
||||||
|
tay
|
||||||
|
|
||||||
|
.2 lda (ZPPtr1),y search backward for a /
|
||||||
|
cmp #'/'
|
||||||
|
beq .3
|
||||||
|
dey
|
||||||
|
bne .2
|
||||||
|
|
||||||
|
.3 tya
|
||||||
|
cmp (ZPPtr1)
|
||||||
|
beq .5 Make sure at least one char
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
phy save / pos to trunk string later
|
||||||
|
|
||||||
|
.4 iny
|
||||||
|
inx
|
||||||
|
lda (ZPPtr1),y
|
||||||
|
sta UsrBuf256,x
|
||||||
|
tya
|
||||||
|
cmp (ZPPtr1)
|
||||||
|
bne .4
|
||||||
|
|
||||||
|
pla get back / pos
|
||||||
|
sta (ZPPtr1) trunk it for Opendir
|
||||||
|
|
||||||
|
stx UsrBuf256
|
||||||
|
>LDYAI UsrBuf256
|
||||||
|
>SYSCALL NewPstrYA
|
||||||
|
bcs .9
|
||||||
|
txa
|
||||||
|
ldy #hDstFileName
|
||||||
|
sta (pData),y
|
||||||
|
|
||||||
.5 >PUSHWI 256
|
.5 >PUSHWI 256
|
||||||
>PUSHBI 0
|
>PUSHBI 0
|
||||||
>SYSCALL GetMem Get a 256 buffer to store DstBasePath
|
>SYSCALL GetMem Get a 256 buffer to store DstBasePath
|
||||||
|
@ -17,11 +17,12 @@ Cmd.ExecYA.1 >SYSCALL ExpandPStrYA
|
|||||||
ldx #0 ARGS len
|
ldx #0 ARGS len
|
||||||
|
|
||||||
lda (ZPPtr1),y
|
lda (ZPPtr1),y
|
||||||
.10 cmp #'a'
|
.10
|
||||||
bcc .11
|
* cmp #'a'
|
||||||
cmp #'z'+1
|
* bcc .11
|
||||||
bcs .11
|
* cmp #'z'+1
|
||||||
eor #$20 to Uppercase
|
* bcs .11
|
||||||
|
* eor #$20 to Uppercase
|
||||||
|
|
||||||
.11 sta CMD,y Store Cmd in Buffer
|
.11 sta CMD,y Store Cmd in Buffer
|
||||||
sty CMD update CMD len
|
sty CMD update CMD len
|
||||||
@ -58,18 +59,26 @@ Cmd.ExecYA.1 >SYSCALL ExpandPStrYA
|
|||||||
.1 lda (ZPPtr2)
|
.1 lda (ZPPtr2)
|
||||||
beq Cmd.Exec.EXT Ending 0, must be an external Cmd....
|
beq Cmd.Exec.EXT Ending 0, must be an external Cmd....
|
||||||
|
|
||||||
cmp CMD
|
cmp CMD Same Len ?
|
||||||
bne .4
|
bne .4
|
||||||
|
|
||||||
tay
|
tay
|
||||||
|
|
||||||
.2 lda CMD,y
|
.2 lda CMD,y
|
||||||
cmp (ZPPtr2),y
|
|
||||||
|
cmp #'a' To Uppercase
|
||||||
|
bcc .21
|
||||||
|
cmp #'z'+1
|
||||||
|
bcs .21
|
||||||
|
eor #$20
|
||||||
|
|
||||||
|
.21 cmp (ZPPtr2),y
|
||||||
bne .4
|
bne .4
|
||||||
dey
|
dey
|
||||||
bne .2
|
bne .2
|
||||||
|
|
||||||
jsr .5 Found an internal Cmd...
|
jsr .5 Found an internal Cmd...
|
||||||
|
|
||||||
bcs .3
|
bcs .3
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
|
Loading…
Reference in New Issue
Block a user