mirror of
https://github.com/A2osX/A2osX.git
synced 2025-02-19 23:29:29 +00:00
Kernel 0.9.1 : SHELL : RealPath.YA API, StrMatch debug
This commit is contained in:
parent
2baa185d88
commit
886ca8ec0a
@ -600,7 +600,7 @@ Convert String to 32 bits int
|
|||||||
|
|
||||||
## In:
|
## In:
|
||||||
+ PUSHW PTR to target buffer DWORD
|
+ PUSHW PTR to target buffer DWORD
|
||||||
+ PUSHW Source String (PSTR)
|
+ PUSHW Source String (C-Sring)
|
||||||
|
|
||||||
## Out:
|
## Out:
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -212,7 +212,7 @@ DIR.IN jsr SRC.GetArg
|
|||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
>LDYA L.SRC.BUFFER
|
>LDYA L.SRC.BUFFER
|
||||||
>SYSCALL NewPStrYA
|
>SYSCALL NewStr.YA
|
||||||
|
|
||||||
phx
|
phx
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ FIO.OpenFileA sta FIO.hFileName
|
|||||||
ldy #S.PS.hPREFIX
|
ldy #S.PS.hPREFIX
|
||||||
lda (pPs),y
|
lda (pPs),y
|
||||||
>PUSHA
|
>PUSHA
|
||||||
>SYSCALL PStrCat
|
>SYSCALL StrCat
|
||||||
sta FIO.hFullPath
|
sta FIO.hFullPath
|
||||||
sta FIO.hFileName
|
sta FIO.hFileName
|
||||||
|
|
||||||
|
@ -59,9 +59,10 @@ CS.START cld
|
|||||||
.DA #$61 6502,Level 1 (65c02)
|
.DA #$61 6502,Level 1 (65c02)
|
||||||
.DA #1 BIN Layout Version 1
|
.DA #1 BIN Layout Version 1
|
||||||
.DA 0
|
.DA 0
|
||||||
.DA CS.END-CS.START
|
.DA CS.END-CS.START CS
|
||||||
.DA DS.END-DS.START Data Segment to Allocate
|
.DA DS.END-DS.START DS
|
||||||
.DA 0
|
.DA #128 SS
|
||||||
|
.DA #10 ZP
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Relocation Table
|
* Relocation Table
|
||||||
@ -149,13 +150,13 @@ J.EXP.OP .DA EXP.OP.EOR ^!|&<=>+-*/
|
|||||||
.DA EXP.OP.DIV
|
.DA EXP.OP.DIV
|
||||||
.DA 0
|
.DA 0
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
CS.INIT >SYSCALL GetArgC
|
CS.INIT ldy #S.PS.ARGC
|
||||||
cmp #1
|
lda (pPs),y
|
||||||
beq .99 No arg, new file....
|
beq .99
|
||||||
|
|
||||||
lda #1
|
lda #1
|
||||||
>SYSCALL GetArg.A
|
>SYSCALL GetArg.A
|
||||||
>SYSCALL GetFullPath.YA
|
>SYSCALL RealPath.YA
|
||||||
|
|
||||||
txa
|
txa
|
||||||
ldy #SRC.hFILENAME
|
ldy #SRC.hFILENAME
|
||||||
@ -182,7 +183,7 @@ CS.INIT >SYSCALL GetArgC
|
|||||||
sec
|
sec
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN >SYSCALL GetC
|
CS.RUN >SYSCALL GetChar
|
||||||
bcs .11 no char
|
bcs .11 no char
|
||||||
|
|
||||||
cmp #$03 Ctrl-C
|
cmp #$03 Ctrl-C
|
||||||
@ -445,6 +446,7 @@ SRC.FLabel.Flags .BS 1
|
|||||||
SRC.FLabel.Value .BS 4
|
SRC.FLabel.Value .BS 4
|
||||||
SRC.FLabel.Len .BS 1
|
SRC.FLabel.Len .BS 1
|
||||||
SRC.FLabel.Name .BS SRC.GLABEL.MAXLEN
|
SRC.FLabel.Name .BS SRC.GLABEL.MAXLEN
|
||||||
|
UsrBuf256 .BS 256
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.DUMMY
|
.DUMMY
|
||||||
.OR 0
|
.OR 0
|
||||||
|
@ -22,9 +22,10 @@ CS.START cld
|
|||||||
.DA #$61 6502,Level 1 (65c02)
|
.DA #$61 6502,Level 1 (65c02)
|
||||||
.DA #1 BIN Layout Version 1
|
.DA #1 BIN Layout Version 1
|
||||||
.DA 0
|
.DA 0
|
||||||
.DA CS.END-CS.START Code Length To Relocate
|
.DA CS.END-CS.START CS
|
||||||
.DA DS.END-DS.START Data Segment to Allocate
|
.DA DS.END-DS.START DS
|
||||||
.DA 0
|
.DA #16 SS
|
||||||
|
.DA #4 ZP
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Relocation Table
|
* Relocation Table
|
||||||
@ -264,7 +265,7 @@ CS.RUN.PRINTNUM clc
|
|||||||
>SYSCALL PrintF.YA
|
>SYSCALL PrintF.YA
|
||||||
.8 rts
|
.8 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.OPEN >SYSCALL GetFullPath.YA
|
CS.RUN.OPEN >SYSCALL RealPath.YA
|
||||||
bcs .9
|
bcs .9
|
||||||
stx hFullPath
|
stx hFullPath
|
||||||
pha
|
pha
|
||||||
|
14
BIN/CP.S.txt
14
BIN/CP.S.txt
@ -24,21 +24,21 @@ OptionList >PSTR "CRYQcryq"
|
|||||||
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm,#bQuiet,#bContinue,#bRecurse,#bNoConfirm,#bQuiet
|
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm,#bQuiet,#bContinue,#bRecurse,#bNoConfirm,#bQuiet
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MSG.USAGE >CSTR "Usage : CP [Src File/Dir, *,? wildcards allowed]\r\n -C : Continue on error\r\n -Q : Quiet\r\n -R : Recurse subdirectories\r\n -Y : Dont't prompt for override\r\n"
|
MSG.USAGE >CSTR "Usage : CP [Src File/Dir, *,? wildcards allowed]\r\n -C : Continue on error\r\n -Q : Quiet\r\n -R : Recurse subdirectories\r\n -Y : Dont't prompt for override\r\n"
|
||||||
MSG.DIR >CSTR "CP Dir :%S to %S..."
|
MSG.DIR >CSTR "CP Dir :%s to %s..."
|
||||||
MSG.FILE >CSTR "CP File:%S to %S..."
|
MSG.FILE >CSTR "CP File:%s to %s..."
|
||||||
MSG.OVERWRITE >CSTR "Overwrite %S [Yes,No,All]?"
|
MSG.OVERWRITE >CSTR "Overwrite %s [Yes,No,All]?"
|
||||||
MSG.OK >CSTR "[OK]\r\n"
|
MSG.OK >CSTR "[OK]\r\n"
|
||||||
MSG.ERR >CSTR "[%h]\r\n"
|
MSG.ERR >CSTR "[%h]\r\n"
|
||||||
MSG.DONE >CSTR "%D File(s) Copied.\r\n"
|
MSG.DONE >CSTR "%D File(s) Copied.\r\n"
|
||||||
*--------------------------------------
|
|
||||||
STAT .BS S.STAT
|
|
||||||
ArgCount .BS 1
|
|
||||||
ArgIndex .BS 1
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.DUMMY
|
.DUMMY
|
||||||
.OR 0
|
.OR 0
|
||||||
DS.START
|
DS.START
|
||||||
|
ArgCount .BS 1
|
||||||
Index .BS 1
|
Index .BS 1
|
||||||
|
STAT .BS S.STAT
|
||||||
|
|
||||||
|
hFullPath .BS 1
|
||||||
hDIRs .BS X.MAX.RECURSE
|
hDIRs .BS X.MAX.RECURSE
|
||||||
hDIRENTs .BS X.MAX.RECURSE
|
hDIRENTs .BS X.MAX.RECURSE
|
||||||
oDIRENTs .BS X.MAX.RECURSE*2
|
oDIRENTs .BS X.MAX.RECURSE*2
|
||||||
|
@ -110,7 +110,7 @@ CS.INIT lda #$ff
|
|||||||
lda #1
|
lda #1
|
||||||
>SYSCALL GetArg.A
|
>SYSCALL GetArg.A
|
||||||
|
|
||||||
>SYSCALL GetFullPath.YA
|
>SYSCALL RealPath.YA
|
||||||
txa
|
txa
|
||||||
ldy #hFileName
|
ldy #hFileName
|
||||||
sta (pData),y
|
sta (pData),y
|
||||||
|
@ -22,9 +22,10 @@ CS.START cld
|
|||||||
.DA #$61 6502,Level 1 (65c02)
|
.DA #$61 6502,Level 1 (65c02)
|
||||||
.DA #1 BIN Layout Version 1
|
.DA #1 BIN Layout Version 1
|
||||||
.DA 0
|
.DA 0
|
||||||
.DA CS.END-CS.START Code Length To Relocate
|
.DA CS.END-CS.START CS
|
||||||
.DA DS.END-DS.START Data Segment to Allocate
|
.DA DS.END-DS.START DS
|
||||||
.DA 0
|
.DA #16 SS
|
||||||
|
.DA #4 ZP
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Relocation Table
|
* Relocation Table
|
||||||
@ -41,31 +42,22 @@ L.MSG.OK .DA MSG.OK
|
|||||||
L.MSG.ERR .DA MSG.ERR
|
L.MSG.ERR .DA MSG.ERR
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.INIT >SYSCALL GetArgC
|
CS.INIT ldy #S.PS.ARGC
|
||||||
sta ArgCount
|
lda (pPs),y
|
||||||
cmp #1
|
beq .99
|
||||||
beq .99
|
|
||||||
|
|
||||||
stz ArgIndex
|
.1 >INC.G ArgIndex
|
||||||
|
|
||||||
.1 dec ArgCount
|
|
||||||
beq .7
|
|
||||||
|
|
||||||
inc ArgIndex
|
|
||||||
lda ArgIndex
|
|
||||||
>SYSCALL GetArg.A
|
>SYSCALL GetArg.A
|
||||||
|
bcs .7
|
||||||
|
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
|
|
||||||
lda (ZPPtr1)
|
lda (ZPPtr1)
|
||||||
cmp #2
|
|
||||||
bne .4
|
|
||||||
|
|
||||||
ldy #1
|
|
||||||
lda (ZPPtr1),y
|
|
||||||
cmp #'-'
|
cmp #'-'
|
||||||
bne .4
|
bne .4
|
||||||
|
|
||||||
iny
|
ldy #1
|
||||||
lda (ZPPtr1),y
|
lda (ZPPtr1),y
|
||||||
|
|
||||||
ldx OptionList
|
ldx OptionList
|
||||||
@ -90,30 +82,25 @@ CS.INIT >SYSCALL GetArgC
|
|||||||
lda (pData),y
|
lda (pData),y
|
||||||
bne .5 Already have a dev name...go get VolName
|
bne .5 Already have a dev name...go get VolName
|
||||||
|
|
||||||
lda (ZPPtr1)
|
|
||||||
cmp #4
|
|
||||||
bne .99 DevName must be DxDy
|
|
||||||
|
|
||||||
>LDYA ZPPtr1
|
>LDYA ZPPtr1
|
||||||
>SYSCALL GetDevByNameYA
|
>SYSCALL GetDevByName.YA
|
||||||
bcs .99
|
bcs .99
|
||||||
txa
|
txa
|
||||||
ldy #hDev
|
ldy #hDev
|
||||||
sta (pData),y
|
sta (pData),y
|
||||||
bra .1
|
bra .1
|
||||||
|
|
||||||
.5 lda (ZPPtr1)
|
.5 ldy #$ff
|
||||||
cmp #16
|
|
||||||
bcs .99 VolName too long
|
|
||||||
|
|
||||||
tay
|
.6 iny
|
||||||
|
|
||||||
.6 lda (ZPPtr1),y
|
cpy #16
|
||||||
|
beq .99 VolName too long
|
||||||
|
|
||||||
|
lda (ZPPtr1),y
|
||||||
sta (pData),y
|
sta (pData),y
|
||||||
dey
|
bne .6 success, scan for any other args
|
||||||
bpl .6
|
bra .1
|
||||||
|
|
||||||
bra .1 success, scan for any other args
|
|
||||||
|
|
||||||
.7 lda (pData)
|
.7 lda (pData)
|
||||||
bne .8 Volume name ok
|
bne .8 Volume name ok
|
||||||
@ -146,7 +133,7 @@ CS.INIT >SYSCALL GetArgC
|
|||||||
bpl .71
|
bpl .71
|
||||||
|
|
||||||
.8 >LDYA L.LIBBLKDEV
|
.8 >LDYA L.LIBBLKDEV
|
||||||
>SYSCALL LoadLibYA
|
>SYSCALL LoadLib.YA
|
||||||
sta hLIBBLKDEV
|
sta hLIBBLKDEV
|
||||||
|
|
||||||
lda (pPs)
|
lda (pPs)
|
||||||
@ -178,7 +165,7 @@ CS.RUN jsr CS.RUN.BuildCat
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.BuildCat ldy #hDev
|
CS.RUN.BuildCat ldy #hDev
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
>SYSCALL GetDevStatusA
|
>SYSCALL GetDevStatus.A
|
||||||
|
|
||||||
bcs .99
|
bcs .99
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
@ -191,7 +178,7 @@ CS.RUN.BuildCat ldy #hDev
|
|||||||
|
|
||||||
ldy #hDev
|
ldy #hDev
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
>SYSCALL GetDevByIDA
|
>SYSCALL GetDevByID.A
|
||||||
bcs .99
|
bcs .99
|
||||||
|
|
||||||
pha
|
pha
|
||||||
@ -234,7 +221,7 @@ CS.RUN.WriteCat stz BlkParams.Num
|
|||||||
|
|
||||||
ldy #hDev
|
ldy #hDev
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
>SYSCALL GetDevByIDA
|
>SYSCALL GetDevByID.A
|
||||||
bcs .9
|
bcs .9
|
||||||
>STYA pDev
|
>STYA pDev
|
||||||
|
|
||||||
@ -261,7 +248,7 @@ CS.QUIT ldy #hBuf
|
|||||||
.1 lda hLIBBLKDEV
|
.1 lda hLIBBLKDEV
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
>SYSCALL UnloadLibA
|
>SYSCALL UnloadLib.A
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
@ -293,12 +280,10 @@ OptionVars .DA #bLL,#bLL
|
|||||||
MSG.USAGE >CSTR "Usage : FORMAT <BLOCKDEV> [VOLUME.NAME]\r\n -L : Low-Level Format\r\n"
|
MSG.USAGE >CSTR "Usage : FORMAT <BLOCKDEV> [VOLUME.NAME]\r\n -L : Low-Level Format\r\n"
|
||||||
MSG.OK >CSTR "[OK]\r\n"
|
MSG.OK >CSTR "[OK]\r\n"
|
||||||
MSG.ERR >CSTR "[%h]\r\n"
|
MSG.ERR >CSTR "[%h]\r\n"
|
||||||
MSG.INIT >CSTR "Formatting %S (%D Blks),Volname:%S..."
|
MSG.INIT >CSTR "Formatting %s (%D Blks),Volname:%s..."
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LIBBLKDEV >PSTR "libblkdev.o"
|
LIBBLKDEV >CSTR "libblkdev.o"
|
||||||
DefaultVolName >PSTR "BLANKXXXXXXXX"
|
DefaultVolName >CSTR "BLANKXXXXXXXX"
|
||||||
ArgCount .BS 1
|
|
||||||
ArgIndex .BS 1
|
|
||||||
hLIBBLKDEV .BS 1
|
hLIBBLKDEV .BS 1
|
||||||
SizeInBlocks .BS 2
|
SizeInBlocks .BS 2
|
||||||
BlkCnt .BS 1
|
BlkCnt .BS 1
|
||||||
@ -308,6 +293,7 @@ BlkParams.Num .BS 2
|
|||||||
.DUMMY
|
.DUMMY
|
||||||
.OR 0
|
.OR 0
|
||||||
DS.START
|
DS.START
|
||||||
|
ArgIndex .BS 1
|
||||||
VolName .BS 16
|
VolName .BS 16
|
||||||
hDev .BS 5
|
hDev .BS 5
|
||||||
hBuf .BS 1
|
hBuf .BS 1
|
||||||
|
@ -39,7 +39,7 @@ CS.RUN lda #1
|
|||||||
>SYSCALL GetArg.A
|
>SYSCALL GetArg.A
|
||||||
bcs .99
|
bcs .99
|
||||||
|
|
||||||
>SYSCALL GetFullPath.YA
|
>SYSCALL RealPath.YA
|
||||||
bcs .9
|
bcs .9
|
||||||
phy
|
phy
|
||||||
pha
|
pha
|
||||||
|
@ -19,9 +19,10 @@ CS.START cld
|
|||||||
.DA #$61 6502,Level 1 (65c02)
|
.DA #$61 6502,Level 1 (65c02)
|
||||||
.DA #1 BIN Layout Version 1
|
.DA #1 BIN Layout Version 1
|
||||||
.DA 0
|
.DA 0
|
||||||
.DA CS.END-CS.START Code Length To Relocate
|
.DA CS.END-CS.START CS
|
||||||
.DA DS.END-DS.START Data Segment to Allocate
|
.DA DS.END-DS.START DS
|
||||||
.DA 0
|
.DA #16 SS
|
||||||
|
.DA #8 ZP
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Relocation Table
|
* Relocation Table
|
||||||
@ -42,19 +43,10 @@ L.MSG.DONE .DA MSG.DONE
|
|||||||
L.STAT .DA STAT
|
L.STAT .DA STAT
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.INIT >SYSCALL GetArgC
|
CS.INIT
|
||||||
sta ArgCount
|
.1 >INC.G ArgCount
|
||||||
cmp #1
|
|
||||||
beq .99
|
|
||||||
|
|
||||||
stz ArgIndex
|
|
||||||
|
|
||||||
.1 dec ArgCount
|
|
||||||
beq .7
|
|
||||||
|
|
||||||
inc ArgIndex
|
|
||||||
lda ArgIndex
|
|
||||||
>SYSCALL GetArg.A
|
>SYSCALL GetArg.A
|
||||||
|
bcs .7
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
|
|
||||||
lda (ZPPtr1)
|
lda (ZPPtr1)
|
||||||
@ -153,7 +145,7 @@ CS.INIT >SYSCALL GetArgC
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN >SYSCALL GetC
|
CS.RUN >SYSCALL GetChar
|
||||||
bcs .11 no char
|
bcs .11 no char
|
||||||
|
|
||||||
cmp #$03 Ctrl-C
|
cmp #$03 Ctrl-C
|
||||||
@ -246,7 +238,7 @@ CS.RUN >SYSCALL GetC
|
|||||||
>SYSCALL GetMemPtr.A
|
>SYSCALL GetMemPtr.A
|
||||||
>PUSHYA
|
>PUSHYA
|
||||||
>PUSHW ZPFileName
|
>PUSHW ZPFileName
|
||||||
>SYSCALL PStrMatch
|
>SYSCALL StrMatch
|
||||||
bcs CS.RUN.NEXT no match, skip....
|
bcs CS.RUN.NEXT no match, skip....
|
||||||
|
|
||||||
.4 ldy #S.STAT.P.DRIVE
|
.4 ldy #S.STAT.P.DRIVE
|
||||||
@ -352,7 +344,7 @@ CS.RUN.DIR jsr CS.RUN.DIR.MSG
|
|||||||
bcs CS.RUN.DIR.RTS
|
bcs CS.RUN.DIR.RTS
|
||||||
|
|
||||||
.1 >SYSCALL Sleep
|
.1 >SYSCALL Sleep
|
||||||
>SYSCALL GetC
|
>SYSCALL GetChar
|
||||||
bcs .1
|
bcs .1
|
||||||
cmp #3
|
cmp #3
|
||||||
beq .99 abort
|
beq .99 abort
|
||||||
@ -416,7 +408,7 @@ CS.RUN.FILE jsr CS.RUN.FILE.MSG
|
|||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
.1 >SYSCALL Sleep
|
.1 >SYSCALL Sleep
|
||||||
>SYSCALL GetC
|
>SYSCALL GetChar
|
||||||
bcs .1
|
bcs .1
|
||||||
cmp #3
|
cmp #3
|
||||||
beq .99 abort
|
beq .99 abort
|
||||||
@ -448,7 +440,7 @@ CS.RUN.FILE jsr CS.RUN.FILE.MSG
|
|||||||
jsr CS.RUN.GetPathY
|
jsr CS.RUN.GetPathY
|
||||||
|
|
||||||
>PUSHYA
|
>PUSHYA
|
||||||
>SYSCALL PStrMatch
|
>SYSCALL StrMatch
|
||||||
bcs .3 not same dir, go copy/delete
|
bcs .3 not same dir, go copy/delete
|
||||||
|
|
||||||
jsr CS.RUN.Rename
|
jsr CS.RUN.Rename
|
||||||
@ -725,11 +717,11 @@ CS.RUN.BuildFilePath
|
|||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
|
|
||||||
>PUSHYA
|
>PUSHYA
|
||||||
>SYSCALL PStrCpy
|
>SYSCALL StrCpy
|
||||||
|
|
||||||
>PUSHW ZPFileName
|
>PUSHW ZPFileName
|
||||||
>PUSHW ZPPtr1
|
>PUSHW ZPPtr1
|
||||||
>SYSCALL PStrCat
|
>SYSCALL StrCat
|
||||||
|
|
||||||
.DO X.COPY.TO.DEST=1
|
.DO X.COPY.TO.DEST=1
|
||||||
ldy #hDstBasePath
|
ldy #hDstBasePath
|
||||||
@ -741,7 +733,7 @@ CS.RUN.BuildFilePath
|
|||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
|
|
||||||
>PUSHYA
|
>PUSHYA
|
||||||
>SYSCALL PStrCpy
|
>SYSCALL StrCpy
|
||||||
|
|
||||||
ldy #hDstFileName
|
ldy #hDstFileName
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
@ -754,7 +746,7 @@ CS.RUN.BuildFilePath
|
|||||||
.1 >PUSHW ZPFileName
|
.1 >PUSHW ZPFileName
|
||||||
|
|
||||||
.2 >PUSHW ZPPtr1
|
.2 >PUSHW ZPPtr1
|
||||||
>SYSCALL PStrCat
|
>SYSCALL StrCat
|
||||||
.FIN
|
.FIN
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -15,7 +15,7 @@ X.MAX.RECURSE .EQ 8
|
|||||||
* hDstBasePath .BS 1 (optional)
|
* hDstBasePath .BS 1 (optional)
|
||||||
* STAT .BS S.STAT
|
* STAT .BS S.STAT
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
InitSrcDirYA >SYSCALL GetFullPath.YA
|
InitSrcDirYA >SYSCALL RealPath.YA
|
||||||
bcc .10
|
bcc .10
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@ -23,20 +23,13 @@ InitSrcDirYA >SYSCALL GetFullPath.YA
|
|||||||
txa
|
txa
|
||||||
>STA.G hFullPath
|
>STA.G hFullPath
|
||||||
|
|
||||||
* >LDYA ZPPtr1
|
|
||||||
* >SYSCALL PrintF.YA
|
|
||||||
* lda #'|'
|
|
||||||
* >SYSCALL PutChar.A
|
|
||||||
* lda #13
|
|
||||||
* >SYSCALL PutChar.A
|
|
||||||
* lda #10
|
|
||||||
* >SYSCALL PutChar.A
|
|
||||||
|
|
||||||
ldy #1
|
ldy #1
|
||||||
lda (ZPPtr1),y
|
lda (ZPPtr1),y
|
||||||
beq .5 we have '/'
|
* beq .5 we have '/'
|
||||||
|
bne .55
|
||||||
|
jmp .5
|
||||||
|
|
||||||
>PUSHEA.G STAT
|
.55 >PUSHEA.G STAT
|
||||||
>PUSHW ZPPtr1
|
>PUSHW ZPPtr1
|
||||||
>SYSCALL Stat
|
>SYSCALL Stat
|
||||||
bcs .1 File/DIR does not exists, go extract pattern
|
bcs .1 File/DIR does not exists, go extract pattern
|
||||||
@ -46,11 +39,11 @@ InitSrcDirYA >SYSCALL GetFullPath.YA
|
|||||||
bne .4 TYPE not a DIR, extract....
|
bne .4 TYPE not a DIR, extract....
|
||||||
beq .5 TYPE=DIR, do not extract pattern
|
beq .5 TYPE=DIR, do not extract pattern
|
||||||
|
|
||||||
ldy #0 TYPE is not DIR, check if wc
|
.1 ldy #0 TYPE is not DIR, check if wc
|
||||||
|
|
||||||
.1 iny
|
.11 iny
|
||||||
lda (ZPPtr1),y Get Src Path Len
|
lda (ZPPtr1),y Get Src Path Len
|
||||||
bne .1
|
bne .11
|
||||||
|
|
||||||
dey
|
dey
|
||||||
|
|
||||||
@ -72,7 +65,6 @@ InitSrcDirYA >SYSCALL GetFullPath.YA
|
|||||||
.3 txa
|
.3 txa
|
||||||
beq .91 no wc, file not found....
|
beq .91 no wc, file not found....
|
||||||
|
|
||||||
|
|
||||||
.4 ldy #0
|
.4 ldy #0
|
||||||
|
|
||||||
.41 iny Search end of string.....
|
.41 iny Search end of string.....
|
||||||
@ -86,7 +78,7 @@ InitSrcDirYA >SYSCALL GetFullPath.YA
|
|||||||
bne .42
|
bne .42
|
||||||
|
|
||||||
tya
|
tya
|
||||||
clc
|
sec +1 to skip '/'
|
||||||
adc ZPPtr1
|
adc ZPPtr1
|
||||||
sta ZPPtr2
|
sta ZPPtr2
|
||||||
tay
|
tay
|
||||||
@ -99,6 +91,9 @@ InitSrcDirYA >SYSCALL GetFullPath.YA
|
|||||||
txa
|
txa
|
||||||
>STA.G hFilter
|
>STA.G hFilter
|
||||||
|
|
||||||
|
>LDYA ZPPtr2
|
||||||
|
jsr DEBUG.YA
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta (ZPPtr2)
|
sta (ZPPtr2)
|
||||||
|
|
||||||
@ -145,11 +140,12 @@ InitSrcDirYA.RTS
|
|||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.DO X.COPY.TO.DEST=1
|
.DO X.COPY.TO.DEST=1
|
||||||
InitDstDirYA >SYSCALL GetFullPath.YA
|
InitDstDirYA >SYSCALL RealPath.YA
|
||||||
bcs InitSrcDirYA.RTS
|
bcs InitSrcDirYA.RTS
|
||||||
|
|
||||||
stx .90+1
|
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
|
txa
|
||||||
|
>STA.G hFullPath
|
||||||
|
|
||||||
>PUSHEA.G STAT
|
>PUSHEA.G STAT
|
||||||
>PUSHW ZPPtr1
|
>PUSHW ZPPtr1
|
||||||
@ -160,40 +156,34 @@ InitDstDirYA >SYSCALL GetFullPath.YA
|
|||||||
cmp #$0f
|
cmp #$0f
|
||||||
beq .5 Dst is a directory...no destfilename
|
beq .5 Dst is a directory...no destfilename
|
||||||
|
|
||||||
.1 lda (ZPPtr1)
|
.1 ldy #0
|
||||||
tay
|
|
||||||
|
|
||||||
.2 lda (ZPPtr1),y search backward for a /
|
.11 iny Search end of string.....
|
||||||
cmp #'/'
|
lda (ZPPtr1),y
|
||||||
beq .3
|
bne .11
|
||||||
dey
|
|
||||||
|
lda #'/'
|
||||||
|
|
||||||
|
.2 dey
|
||||||
|
cmp (ZPPtr1),y Search backward /
|
||||||
bne .2
|
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
|
tya
|
||||||
cmp (ZPPtr1)
|
sec +1 to skip '/'
|
||||||
bne .4
|
adc ZPPtr1
|
||||||
|
sta ZPPtr2
|
||||||
|
tay
|
||||||
|
lda ZPPtr1+1
|
||||||
|
adc #0
|
||||||
|
sta ZPPtr2+1
|
||||||
|
|
||||||
pla get back / pos
|
>SYSCALL NewStr.YA
|
||||||
sta (ZPPtr1) trunk it for Opendir
|
|
||||||
|
|
||||||
stx UsrBuf256
|
|
||||||
>LDYAI UsrBuf256
|
|
||||||
>SYSCALL NewPstrYA
|
|
||||||
bcs .9
|
bcs .9
|
||||||
txa
|
txa
|
||||||
ldy #hDstFileName
|
>STA.G hDstFileName
|
||||||
sta (pData),y
|
|
||||||
|
lda #0
|
||||||
|
sta (ZPPtr2)
|
||||||
|
|
||||||
.5 >LDYAI 256
|
.5 >LDYAI 256
|
||||||
>SYSCALL GetMem.YA Get a 256 buffer to store DstBasePath
|
>SYSCALL GetMem.YA Get a 256 buffer to store DstBasePath
|
||||||
@ -201,28 +191,26 @@ InitDstDirYA >SYSCALL GetFullPath.YA
|
|||||||
|
|
||||||
>STYA ZPPtr2
|
>STYA ZPPtr2
|
||||||
txa
|
txa
|
||||||
ldy #hDstBasePath
|
>STA.G hDstBasePath
|
||||||
sta (pData),y
|
|
||||||
|
|
||||||
lda (ZPPtr1)
|
ldy #$ff
|
||||||
sta (ZPPtr2)
|
|
||||||
tay
|
|
||||||
|
|
||||||
.6 lda (ZPPtr1),y
|
.6 iny
|
||||||
|
lda (ZPPtr1),y
|
||||||
sta (ZPPtr2),y
|
sta (ZPPtr2),y
|
||||||
dey
|
|
||||||
bne .6
|
bne .6
|
||||||
|
|
||||||
lda (ZPPtr2)
|
dey
|
||||||
tay
|
|
||||||
lda #'/'
|
lda #'/'
|
||||||
cmp (ZPPtr2),y
|
cmp (ZPPtr2),y
|
||||||
beq .7
|
beq .7
|
||||||
|
|
||||||
iny
|
iny
|
||||||
sta (ZPPtr2),y
|
sta (ZPPtr2),y
|
||||||
tya
|
iny
|
||||||
sta (ZPPtr2)
|
lda #0
|
||||||
|
sta (ZPPtr2),y
|
||||||
|
|
||||||
.7 jsr .9 Cleanup
|
.7 jsr .9 Cleanup
|
||||||
|
|
||||||
@ -230,7 +218,7 @@ InitDstDirYA >SYSCALL GetFullPath.YA
|
|||||||
.99 rts
|
.99 rts
|
||||||
|
|
||||||
.9 pha
|
.9 pha
|
||||||
.90 lda #$ff self modified
|
>LDA.G hFullPath
|
||||||
>SYSCALL FreeMem.A
|
>SYSCALL FreeMem.A
|
||||||
pla
|
pla
|
||||||
sec
|
sec
|
||||||
@ -575,6 +563,14 @@ BasePath..1 lda (pData),y
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
DEBUG.YA >SYSCALL PrintF.YA
|
||||||
|
lda #'|'
|
||||||
|
>SYSCALL PutChar.A
|
||||||
|
lda #13
|
||||||
|
>SYSCALL PutChar.A
|
||||||
|
lda #10
|
||||||
|
>SYSCALL PutChar.A
|
||||||
|
rts
|
||||||
MAN
|
MAN
|
||||||
SAVE /A2OSX.SRC/BIN/X.FILEENUM.S
|
SAVE /A2OSX.SRC/BIN/X.FILEENUM.S
|
||||||
LOAD /A2OSX.SRC/BIN/LS.S
|
LOAD /A2OSX.SRC/BIN/LS.S
|
||||||
|
@ -148,7 +148,7 @@ SYS.FPrintF.YA .EQ $5C
|
|||||||
* .EQ $5E
|
* .EQ $5E
|
||||||
|
|
||||||
* .EQ $60
|
* .EQ $60
|
||||||
SYS.GetFullPath.YA .EQ $62
|
* .EQ $62
|
||||||
SYS.LoadFile .EQ $64
|
SYS.LoadFile .EQ $64
|
||||||
SYS.SaveFile .EQ $66
|
SYS.SaveFile .EQ $66
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ note : '$VAR' does NOT expand Variable
|
|||||||
| RM | Working | -C : Continue On Error | 0.9 |
|
| RM | Working | -C : Continue On Error | 0.9 |
|
||||||
| | | -Q : Quiet | |
|
| | | -Q : Quiet | |
|
||||||
| | | -R : Recurse subdirectories | |
|
| | | -R : Recurse subdirectories | |
|
||||||
| CP | Working | -C : Continue On Error | 0.9 |
|
| CP | Working | -C : Continue On Error | 0.9.1 |
|
||||||
| | | -Q : Quiet | |
|
| | | -Q : Quiet | |
|
||||||
| | | -R : Recurse subdirectories | |
|
| | | -R : Recurse subdirectories | |
|
||||||
| | | -Y : Dont't Prompt For Override | |
|
| | | -Y : Dont't Prompt For Override | |
|
||||||
@ -207,7 +207,7 @@ note : '$VAR' does NOT expand Variable
|
|||||||
| | | -R : Recurse subdirectories | |
|
| | | -R : Recurse subdirectories | |
|
||||||
| CHGRP | In Progress | -C : Continue On Error | 0.9 |
|
| CHGRP | In Progress | -C : Continue On Error | 0.9 |
|
||||||
| | | -R : Recurse subdirectories | |
|
| | | -R : Recurse subdirectories | |
|
||||||
| FORMAT | In Progress | -L : Low-Level Format | 0.9 |
|
| FORMAT | In Progress | -L : Low-Level Format | 0.9.1 |
|
||||||
| EDIT | Working | still missing : find/replace | 0.9 |
|
| EDIT | Working | still missing : find/replace | 0.9 |
|
||||||
| NSCUTIL | Working | Tool for setting time in NSC/DL1216E | 0.9 |
|
| NSCUTIL | Working | Tool for setting time in NSC/DL1216E | 0.9 |
|
||||||
| ---- | ------ | ------- | ----- |
|
| ---- | ------ | ------- | ----- |
|
||||||
|
@ -4,52 +4,6 @@ LOMEM $A00
|
|||||||
INC 1
|
INC 1
|
||||||
AUTO 6
|
AUTO 6
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # GetFullPath.YA
|
|
||||||
* ## In :
|
|
||||||
* Y,A = Filename (C-String)
|
|
||||||
* ## Out :
|
|
||||||
* CC : success
|
|
||||||
* Y,A = FullPath (C-String)
|
|
||||||
* X = hMem of FullPath
|
|
||||||
* CS : A = Error Code
|
|
||||||
*\--------------------------------------
|
|
||||||
K.GetFullPath.YA
|
|
||||||
>STYA ZPPtr1
|
|
||||||
|
|
||||||
ldx #$ff
|
|
||||||
|
|
||||||
lda (ZPPtr1)
|
|
||||||
beq .10
|
|
||||||
|
|
||||||
cmp #'/' full path starting with '/'?
|
|
||||||
beq .2 yes, do not append to current prefix
|
|
||||||
|
|
||||||
.10 ldy #S.PS.hPREFIX
|
|
||||||
lda (pPs),y
|
|
||||||
jsr K.GetMemPtr.A
|
|
||||||
>STYA ZPPtr2
|
|
||||||
|
|
||||||
ldy #$ff
|
|
||||||
|
|
||||||
.1 iny
|
|
||||||
inx
|
|
||||||
lda (ZPPtr2),y
|
|
||||||
sta K.Buf256,x
|
|
||||||
bne .1
|
|
||||||
|
|
||||||
dex
|
|
||||||
|
|
||||||
.2 ldy #$ff
|
|
||||||
|
|
||||||
.3 iny
|
|
||||||
inx
|
|
||||||
lda (ZPPtr1),y
|
|
||||||
sta K.Buf256,x
|
|
||||||
bne .3
|
|
||||||
|
|
||||||
.8 >LDYAI K.Buf256
|
|
||||||
jmp K.NewStr.YA
|
|
||||||
*/--------------------------------------
|
|
||||||
* # LoadFile
|
* # LoadFile
|
||||||
* ## In:
|
* ## In:
|
||||||
* PUSHW = AUXTYPE (Handled by....
|
* PUSHW = AUXTYPE (Handled by....
|
||||||
|
@ -63,7 +63,7 @@ K.SYSCALL.JMP .DA 0 $00
|
|||||||
.DA 0
|
.DA 0
|
||||||
|
|
||||||
.DA 0 $60
|
.DA 0 $60
|
||||||
.DA K.GetFullPath.YA
|
.DA 0
|
||||||
.DA K.LoadFile
|
.DA K.LoadFile
|
||||||
.DA K.SaveFile
|
.DA K.SaveFile
|
||||||
.DA K.ChTyp
|
.DA K.ChTyp
|
||||||
|
@ -208,33 +208,33 @@ K.RealPath.YA >STYA ZPPtr1
|
|||||||
ldx #$ff
|
ldx #$ff
|
||||||
|
|
||||||
lda (ZPPtr1)
|
lda (ZPPtr1)
|
||||||
beq .10
|
beq .1
|
||||||
|
|
||||||
cmp #'/' full path starting with '/'?
|
cmp #'/' full path starting with '/'?
|
||||||
beq .2 yes, do not append to current prefix
|
beq .3 yes, do not append to current prefix
|
||||||
|
|
||||||
.10 ldy #S.PS.hPREFIX
|
.1 ldy #S.PS.hPREFIX
|
||||||
lda (pPs),y
|
lda (pPs),y
|
||||||
jsr K.GetMemPtr.A
|
jsr K.GetMemPtr.A
|
||||||
>STYA ZPPtr2
|
>STYA ZPPtr2
|
||||||
|
|
||||||
ldy #$ff
|
ldy #$ff
|
||||||
|
|
||||||
.1 iny
|
.2 iny
|
||||||
inx
|
inx
|
||||||
lda (ZPPtr2),y
|
lda (ZPPtr2),y
|
||||||
sta K.Buf256,x
|
sta K.Buf256,x
|
||||||
bne .1
|
bne .2
|
||||||
|
|
||||||
dex
|
dex
|
||||||
|
|
||||||
.2 ldy #$ff
|
.3 ldy #$ff
|
||||||
|
|
||||||
.3 iny
|
.4 iny
|
||||||
inx
|
inx
|
||||||
lda (ZPPtr1),y
|
lda (ZPPtr1),y
|
||||||
sta K.Buf256,x
|
sta K.Buf256,x
|
||||||
bne .3
|
bne .4
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* X=LEN, K.Buf256 = /dir1../file(/) /x0
|
* X=LEN, K.Buf256 = /dir1../file(/) /x0
|
||||||
|
|
||||||
@ -282,16 +282,16 @@ K.RealPath.YA >STYA ZPPtr1
|
|||||||
|
|
||||||
jsr K.RealPath.RemoveAtX remove "/.."
|
jsr K.RealPath.RemoveAtX remove "/.."
|
||||||
|
|
||||||
.11 dex
|
.10 dex
|
||||||
|
|
||||||
lda K.Buf256,x go to "/dir"
|
lda K.Buf256,x go to "/dir"
|
||||||
cmp #'/'
|
cmp #'/'
|
||||||
bne .11
|
bne .10
|
||||||
|
|
||||||
jsr K.RealPath.RemoveAtX ...remove "/dir"
|
jsr K.RealPath.RemoveAtX ...remove "/dir"
|
||||||
|
|
||||||
.80 txa
|
.80 txa
|
||||||
beq .89
|
beq .89 Empty path!!! go put back "/" an exit
|
||||||
dex
|
dex
|
||||||
bra .5
|
bra .5
|
||||||
|
|
||||||
@ -316,11 +316,18 @@ K.RealPath.RemoveAtX
|
|||||||
|
|
||||||
.3 lda K.Buf256,y
|
.3 lda K.Buf256,y
|
||||||
sta K.Buf256,x
|
sta K.Buf256,x
|
||||||
beq .8
|
beq .4
|
||||||
iny
|
iny
|
||||||
inx
|
inx
|
||||||
bne .3
|
bne .3
|
||||||
|
|
||||||
|
.4 txa
|
||||||
|
bne .8
|
||||||
|
|
||||||
|
lda #'/' Make sure we have a least '/' in the buffer
|
||||||
|
sta K.Buf256
|
||||||
|
stz K.Buf256+1
|
||||||
|
|
||||||
.8 plx
|
.8 plx
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -86,12 +86,12 @@ K.StrMatch jsr PullPtr1Ptr2
|
|||||||
|
|
||||||
bra .21
|
bra .21
|
||||||
|
|
||||||
.1 inc ZPPtr2 Make PTR2 advance to next char
|
.1 inc ZPPtr2 Make PTR2 (pattern) advance to next char
|
||||||
bne .2
|
bne .2
|
||||||
inc ZPPtr2+1
|
inc ZPPtr2+1
|
||||||
|
|
||||||
.2 lda (ZPPtr2) get pattern char
|
.2 lda (ZPPtr2) get pattern char
|
||||||
beq .41
|
beq .41 end of pattern...
|
||||||
|
|
||||||
.21 cmp #'*'
|
.21 cmp #'*'
|
||||||
beq .5
|
beq .5
|
||||||
@ -105,26 +105,27 @@ K.StrMatch jsr PullPtr1Ptr2
|
|||||||
cmp (ZPPtr1),y Regular Char, compare with string at Y
|
cmp (ZPPtr1),y Regular Char, compare with string at Y
|
||||||
bne .9 no match, exit
|
bne .9 no match, exit
|
||||||
|
|
||||||
iny advance to next char to compare
|
.4 iny advance to next char to compare
|
||||||
|
bra .1 continue if remaining char in pattern
|
||||||
.4 dex char matched, check if end of pattern
|
|
||||||
bne .1 continue if remaining char in pattern
|
|
||||||
|
|
||||||
.41 lda (ZPPtr1),y end of pattern, but end of string ?
|
.41 lda (ZPPtr1),y end of pattern, but end of string ?
|
||||||
|
|
||||||
beq .8 yes, string matched entirely
|
beq .8 yes, string matched entirely
|
||||||
bra .9 no, remaining char in string, no match
|
* no, remaining char in string, no match
|
||||||
|
.9 sec
|
||||||
|
rts
|
||||||
|
|
||||||
.5 inc ZPPtr2 Make PTR2 advance to next char
|
.5 inc ZPPtr2 Make PTR2 advance to next char
|
||||||
bne .6
|
bne .6
|
||||||
inc ZPPtr2+1
|
inc ZPPtr2+1
|
||||||
lda (ZPPtr2) we have '*', last char of pattern ?
|
|
||||||
|
.6 lda (ZPPtr2) we have '*', last char of pattern ?
|
||||||
beq .8 yes, match everything, including empty string
|
beq .8 yes, match everything, including empty string
|
||||||
|
|
||||||
.6 lda (ZPPtr2) get next char of pattern
|
lda (ZPPtr2) get next char of pattern
|
||||||
cmp #'*' another '*' ?
|
cmp #'*' another '*' ?
|
||||||
beq .5 yes, '**' = '*', go next char
|
beq .5 yes, '**' = '*', go next char
|
||||||
cmp #'?' '*?' ??? we must match a least one char
|
cmp #'?' '*?' ? we must match a least one char
|
||||||
beq .3
|
beq .3
|
||||||
|
|
||||||
.7 lda (ZPPtr1),y we need at least one remaining char in string, check if at end of string
|
.7 lda (ZPPtr1),y we need at least one remaining char in string, check if at end of string
|
||||||
@ -135,13 +136,11 @@ K.StrMatch jsr PullPtr1Ptr2
|
|||||||
cmp (ZPPtr1),y compare with char in string
|
cmp (ZPPtr1),y compare with char in string
|
||||||
bne .7 not equal to next non wildcard in pattern
|
bne .7 not equal to next non wildcard in pattern
|
||||||
|
|
||||||
bra .4 go check remaining char in pattern...
|
iny
|
||||||
|
bra .1 go check remaining char in pattern...
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.9 sec
|
|
||||||
rts
|
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # StrUpr.YA/StrLwr.YA
|
* # StrUpr.YA/StrLwr.YA
|
||||||
* Convert string to UPPERCASE/lowercase
|
* Convert string to UPPERCASE/lowercase
|
||||||
|
Loading…
x
Reference in New Issue
Block a user