mirror of https://github.com/A2osX/A2osX.git
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
|
||||
hDstBasePath .BS 1
|
||||
hFilter .BS 1
|
||||
hDstFileName .BS 1
|
||||
hSrcFile .BS 1
|
||||
hDstFile .BS 1
|
||||
bPause .BS 1
|
||||
|
|
|
@ -101,7 +101,7 @@ CS.INIT >SYSCALL GetArgC
|
|||
jsr CS.INIT.Check.Wildcard
|
||||
|
||||
>LDYA ZPPtr1
|
||||
jsr InitSrcDirPatYA
|
||||
jsr InitSrcDirYA
|
||||
bcc .1 success, scan for any other args
|
||||
.9 rts
|
||||
|
||||
|
@ -337,8 +337,7 @@ CS.RUN.DIR .DO X.COPY.TO.DEST=1
|
|||
>SYSCALL CPrintFYA
|
||||
bcs CS.RUN.DIR.RTS
|
||||
|
||||
ldy #hDstBasePath
|
||||
jsr CS.RUN.GetFilePath
|
||||
jsr CS.RUN.GetDstFilePath
|
||||
|
||||
>PUSHW L.STAT
|
||||
>PUSHWI UsrBuf256
|
||||
|
@ -402,8 +401,7 @@ CS.RUN.FILE ldy #bQuiet
|
|||
|
||||
.14 .DO X.COPY.TO.DEST=1
|
||||
|
||||
ldy #hDstBasePath
|
||||
jsr CS.RUN.GetFilePath
|
||||
jsr CS.RUN.GetDstFilePath
|
||||
|
||||
>PUSHW L.STAT
|
||||
>PUSHWI UsrBuf256
|
||||
|
@ -472,8 +470,8 @@ CS.RUN.FILE ldy #bQuiet
|
|||
.FIN
|
||||
|
||||
.4 .DO X.DELETE.SOURCE=1
|
||||
ldy #hSrcBasePath
|
||||
jsr CS.RUN.GetFilePath
|
||||
|
||||
jsr CS.RUN.GetSrcFilePath
|
||||
|
||||
>LDYAI UsrBuf256
|
||||
>SYSCALL NewPStrYA
|
||||
|
@ -492,16 +490,24 @@ CS.RUN.FILE ldy #bQuiet
|
|||
rts
|
||||
*--------------------------------------
|
||||
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
|
||||
>SYSCALL GetMemPtrA
|
||||
>PUSHYA
|
||||
.FIN
|
||||
|
||||
>PUSHW ZPFileName
|
||||
|
||||
|
||||
ldy #hSrcBasePath
|
||||
lda (pData),y
|
||||
>SYSCALL GetMemPtrA
|
||||
|
@ -513,16 +519,26 @@ CS.RUN.FILE.MSG .DO X.COPY.TO.DEST=1
|
|||
*--------------------------------------
|
||||
.DO X.COPY.TO.DEST=1
|
||||
.DO X.DELETE.SOURCE=1
|
||||
CS.RUN.Rename ldy #hDstFile
|
||||
lda (pData),y
|
||||
>SYSCALL GetMemPtrA
|
||||
CS.RUN.Rename jsr CS.RUN.GetDstFilePath
|
||||
|
||||
>LDYAI UsrBuf256
|
||||
>SYSCALL NewPStrYA
|
||||
stx .1+1
|
||||
>PUSHYA
|
||||
|
||||
ldy #hSrcBasePath
|
||||
jsr CS.RUN.GetFilePath
|
||||
>PUSHYA
|
||||
jsr CS.RUN.GetSrcFilePath
|
||||
>PUSHWI UsrBuf256
|
||||
|
||||
>SYSCALL Rename
|
||||
php
|
||||
pha
|
||||
.1 lda #$ff
|
||||
>SYSCALL FreeMemA
|
||||
pla
|
||||
plp
|
||||
rts
|
||||
|
||||
.9 bra .9
|
||||
.FIN
|
||||
.FIN
|
||||
*--------------------------------------
|
||||
|
@ -535,8 +551,8 @@ CS.RUN.CopyStart
|
|||
ldy #S.STAT.P.TYPE
|
||||
>PUSHB (ZPFileStat),y
|
||||
>PUSHBI SYS.FOpen.R
|
||||
ldy #hSrcBasePath
|
||||
jsr CS.RUN.GetFilePath
|
||||
|
||||
jsr CS.RUN.GetSrcFilePath
|
||||
|
||||
>PUSHWI UsrBuf256
|
||||
>SYSCALL FOpen
|
||||
|
@ -552,8 +568,8 @@ CS.RUN.CopyStart
|
|||
ldy #S.STAT.P.TYPE
|
||||
>PUSHB (ZPFileStat),y
|
||||
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
|
||||
ldy #hDstBasePath
|
||||
jsr CS.RUN.GetFilePath
|
||||
|
||||
jsr CS.RUN.GetDstFilePath
|
||||
|
||||
>PUSHWI UsrBuf256
|
||||
>SYSCALL FOpen
|
||||
|
@ -702,16 +718,35 @@ CS.RUN.CheckErr bcs .1
|
|||
.8 clc
|
||||
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
|
||||
>SYSCALL GetMemPtrA
|
||||
>PUSHYA
|
||||
>PUSHWI UsrBuf256
|
||||
>SYSCALL PStrCpy
|
||||
|
||||
>PUSHW ZPFileName
|
||||
>PUSHWI UsrBuf256
|
||||
>SYSCALL PStrCat
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.DOEVENT sec
|
||||
|
@ -737,7 +772,12 @@ CS.QUIT jsr LeaveSubDir
|
|||
lda (pData),y
|
||||
>SYSCALL FCloseA
|
||||
|
||||
.2 ldy #hFilter
|
||||
.2 ldy #hDstFilename
|
||||
lda (pData),y
|
||||
beq .3
|
||||
>SYSCALL FreeMemA
|
||||
|
||||
.3 ldy #hFilter
|
||||
lda (pData),y
|
||||
beq .8
|
||||
>SYSCALL FreeMemA
|
||||
|
|
|
@ -133,14 +133,59 @@ InitSrcDirYA.RTS
|
|||
*--------------------------------------
|
||||
.DO X.COPY.TO.DEST=1
|
||||
InitDstDirYA >SYSCALL GetFullPathYA
|
||||
bcs .99
|
||||
bcc .10
|
||||
rts
|
||||
|
||||
stx .90+1
|
||||
.10 stx .90+1
|
||||
>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
|
||||
>PUSHBI 0
|
||||
>SYSCALL GetMem Get a 256 buffer to store DstBasePath
|
||||
>SYSCALL GetMem Get a 256 buffer to store DstBasePath
|
||||
bcs .9
|
||||
|
||||
>STYA ZPPtr2
|
||||
|
@ -169,7 +214,7 @@ InitDstDirYA >SYSCALL GetFullPathYA
|
|||
sta (ZPPtr2)
|
||||
|
||||
.7 jsr .9 Cleanup
|
||||
|
||||
|
||||
clc
|
||||
.99 rts
|
||||
|
||||
|
|
|
@ -17,11 +17,12 @@ Cmd.ExecYA.1 >SYSCALL ExpandPStrYA
|
|||
ldx #0 ARGS len
|
||||
|
||||
lda (ZPPtr1),y
|
||||
.10 cmp #'a'
|
||||
bcc .11
|
||||
cmp #'z'+1
|
||||
bcs .11
|
||||
eor #$20 to Uppercase
|
||||
.10
|
||||
* cmp #'a'
|
||||
* bcc .11
|
||||
* cmp #'z'+1
|
||||
* bcs .11
|
||||
* eor #$20 to Uppercase
|
||||
|
||||
.11 sta CMD,y Store Cmd in Buffer
|
||||
sty CMD update CMD len
|
||||
|
@ -58,18 +59,26 @@ Cmd.ExecYA.1 >SYSCALL ExpandPStrYA
|
|||
.1 lda (ZPPtr2)
|
||||
beq Cmd.Exec.EXT Ending 0, must be an external Cmd....
|
||||
|
||||
cmp CMD
|
||||
cmp CMD Same Len ?
|
||||
bne .4
|
||||
|
||||
tay
|
||||
|
||||
.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
|
||||
dey
|
||||
bne .2
|
||||
|
||||
jsr .5 Found an internal Cmd...
|
||||
jsr .5 Found an internal Cmd...
|
||||
|
||||
bcs .3
|
||||
|
||||
lda #0
|
||||
|
|
Loading…
Reference in New Issue