Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-02-29 15:06:28 +01:00
parent e356259cb5
commit bebf9f1712
20 changed files with 354 additions and 239 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -48,7 +48,6 @@ EXP.Eval.Next stz SRC.ACC.F
>LDA.G MAC.StkPtr
bne .9 illegal OUTSIDE macro
jsr EXP.GetLocal
bra .13
.12 cmp #':'
@ -57,9 +56,9 @@ EXP.Eval.Next stz SRC.ACC.F
>LDA.G MAC.StkPtr
beq .9 illegal OUTSIDE macro
jsr EXP.GetLocal
.13 jsr EXP.GetLocal
.13 bcs .19
bcs .19
jmp EXP.EvalOperator
.19 rts

View File

@ -405,15 +405,18 @@ CS.RUN ldy #S.PS.hStdIn
CS.DOEVENT sec
rts
*--------------------------------------
CS.QUIT jsr FIO.FileClose
bne CS.QUIT
>LDA.G DST.hREFNUM
CS.QUIT >LDA.G SRC.Depth
beq .1
jsr FIO.FileClose
bra CS.QUIT
.1 >LDA.G DST.hREFNUM
beq .2
>SYSCALL FClose
.1 jsr MAC.Quit
.2 jsr MAC.Quit
jsr SYM.Quit

View File

@ -28,7 +28,7 @@ MSG.USAGE .AS "Usage : CP [Src File/Dir, *,? wildcards allowed]\r\n"
.AS " -R : Recurse subdirectories\r\n"
.AZ " -Y : Dont't prompt for override\r\n"
MSG.DIR .AZ "CP Dir :%s to %s..."
MSG.FILE .AZ "CP File:%s to %s..."
MSG.REG .AZ "CP File:%s to %s..."
MSG.OVERWRITE .AZ "Overwrite %s [Yes,No,All]?"
MSG.OK .AZ "[OK]"
MSG.ERR .AS "[%h]"

View File

@ -201,9 +201,9 @@ CS.RUN.GetDevStatus
lda bCustomBlkSize
bmi .8
>PUSHB hDevID
>PUSHEA.G DIB
lda hDevID
>SYSCALL GetDevStatus
bcs .9
@ -234,10 +234,10 @@ CS.RUN.LL >LDA.G DIB+S.DIB.T
>SYSCALL PrintF
bcs .9
>PUSHEA.G IOCTL
>PUSHB hDevID
>PUSHBI IOCTL.FORMAT
lda hDevID
>PUSHEA.G IOCTL
>SYSCALL IOCTL
.9 rts
@ -335,10 +335,10 @@ CS.RUN.WriteCat >PUSHW L.MSG.WRITECAT
>PUSHBI 0
>SYSCALL PrintF
.1 >PUSHEA.G IOCTL
>PUSHBI IOCTL.WRITEBLOCK
lda hDevID
.1 >PUSHB hDevID
>PUSHBI IOCTL.WRITEBLOCK
>PUSHEA.G IOCTL
>SYSCALL IOCTL
bcs .9

View File

@ -23,6 +23,7 @@ ZPPtr1 .BS 2
ZPPtr2 .BS 2
ZPFileName .BS 2
ZPFileStat .BS 2
ZPPW .BS 2
ZS.END
.ED
@ -47,12 +48,13 @@ CS.START cld
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.MSG.DEVEXT .DA MSG.DEVEXT
L.MSG.REG .DA MSG.REG
L.MSG.REGEXT .DA MSG.REGEXT
L.MSG.DIR .DA MSG.DIR
L.MSG.ENTER .DA MSG.ENTER
L.MSG.DIREXT .DA MSG.DIREXT
L.MSG.FILE .DA MSG.FILE
L.MSG.FILEEXT .DA MSG.FILEEXT
L.MSG.BDEV .DA MSG.BDEV
L.MSG.BDEVEXT .DA MSG.BDEVEXT
L.MSG.ENTER .DA MSG.ENTER
L.MSG.CRLF .DA MSG.CRLF
L.PRODOS.FT.TXT .DA PRODOS.FT.TXT
L.FMT.Date .DA FMT.Date
@ -60,6 +62,14 @@ L.FMT.Time .DA FMT.Time
L.FMT.int16 .DA FMT.int16
L.MSG.Users .DA MSG.Users
L.MSG.Root .DA MSG.Root
J.CS.RUN.PRINT .DA CS.RUN.PRINT.REG
.DA CS.RUN.PRINT.DIR
.DA CS.RUN.PRINT.CDEV
.DA CS.RUN.PRINT.BDEV
.DA CS.RUN.PRINT.CDEV
.DA CS.RUN.PRINT.CDEV
.DA CS.RUN.PRINT.CDEV
.DA CS.RUN.PRINT.CDEV
.DA 0
*--------------------------------------
CS.INIT clc
@ -139,22 +149,21 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
bcs .9
jsr FilterMatch
bcs .8 no match, skip....
.4 ldy #S.STAT.P.DRIVE
lda (ZPFileStat),y ProDOS Device ?
bne .5
ldy #S.STAT.P.TYPE
>LDA.G bAllmostAll
bmi .4
lda (ZPFileName)
cmp #'.'
beq .8
.4 ldy #S.STAT.MODE+1
lda (ZPFileStat),y
cmp #$0F Directory ?
bne .6
jsr CS.RUN.PRINT.DIR
bcs .99
bra .8
.5 jsr CS.RUN.PRINT.DEV
bcs .99
bra .8
.6 jsr CS.RUN.PRINT.FILE
and #$70
lsr
lsr
lsr
tax
jsr CS.RUN.PRINT.JMP
bcs .99
.8 jsr GetNextEntry
@ -178,53 +187,72 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
sec
.99 rts
*--------------------------------------
CS.RUN.PRINT.DEV
>LDA.G bLong
bpl CS.RUN.PRINT.DIR
CS.RUN.PRINT.JMP
jmp (J.CS.RUN.PRINT,x)
*--------------------------------------
CS.RUN.PRINT.REG
ldy #bLong
lda (pData),y
bmi .1
>LDA.G bColumn
bmi .23
>PUSHW L.MSG.DEVEXT
>LDA.G bFullPath
bpl .22
jsr CS.RUN.PRINT.SRCPATH
.23 >LDYA ZPFileName
>SYSCALL PutS
rts
.22 >PUSHW L.MSG.REG
>PUSHW ZPFileName
ldy #S.STAT.P.SLOT
>PUSHB (ZPFileStat),y
iny DRIVE
>PUSHB (ZPFileStat),y
ldy #S.STAT.BLOCKS+1
>PUSHB (ZPFileStat),y
dey
>PUSHB (ZPFileStat),y
ldy #S.STAT.P.DEVBLOCKS+1
>PUSHB (ZPFileStat),y
dey
>PUSHB (ZPFileStat),y
>PUSHBI 8
>PUSHBI 2
>SYSCALL PrintF
bcs .9
jmp CS.RUN.UpdateColCnt
*--------------------------------------
.1 >PUSHW L.MSG.REGEXT
jsr Mod2CSTR
>PUSHEA.G MOD File Mod
ldy #bRecurse
lda (pData),y
bpl .8
>LDYA ZPFileName
jsr EnterSubDirYA
bcs .9
jmp CS.RUN.ENTER.MSG
jsr CS.RUN.PushGidUid
ldy #S.STAT.SIZE+3
ldx #4
.2 lda (ZPFileStat),y
>PUSHA
dey
dex
bne .2
jsr CS.RUN.PUSHDATES
ldy #S.STAT.P.TYPE
lda (ZPFileStat),y
jsr FileType2PSTR
>PUSHYA
ldy #S.STAT.P.AUXTYPE+1
lda (ZPFileStat),y
>PUSHA
dey
lda (ZPFileStat),y
>PUSHA
>PUSHW ZPFileName
>PUSHBI 20
>SYSCALL PrintF
.8 clc
.9 rts
*--------------------------------------
CS.RUN.PRINT.DIR
>LDA.G bAllmostAll
bmi .10
lda (ZPFileName)
cmp #'.'
bne .10
jmp .5
.10 >LDA.G bLong
>LDA.G bLong
bmi .4
>LDA.G bColumn
@ -297,68 +325,97 @@ CS.RUN.PRINT.DIR
jsr EnterSubDirYA
bcs .90
jmp CS.RUN.ENTER.MSG
.80 clc
.90 rts
*--------------------------------------
CS.RUN.PRINT.FILE
ldy #bLong
lda (pData),y
bmi .1
CS.RUN.PRINT.CDEV
clc
rts
*--------------------------------------
CS.RUN.PRINT.BDEV
>LDA.G bLong
bmi .20
>LDA.G bColumn
bmi .23
>LDA.G bFullPath
bpl .22
jsr CS.RUN.PRINT.SRCPATH
.23 >LDYA ZPFileName
>SYSCALL PutS
rts
bcs .9
>LDA.G bRecurse
bpl .8
lda (ZPFileName)
cmp #'.'
beq .8
>LDYA ZPFileName
jmp EnterSubDirYA
.8 clc
.9 rts
.22 >PUSHW L.MSG.FILE
.22 >PUSHW L.MSG.BDEV
>PUSHW ZPFileName
>PUSHBI 2
>SYSCALL PrintF
bcs .9
jmp CS.RUN.UpdateColCnt
ldy #0
.1 iny
lda (ZPFileName),y
bne .1
.11 iny
cpy #19
bcs .2
lda #C.SPACE
phy
>SYSCALL PutChar
ply
bcc .11
rts
.2 jsr CS.RUN.UpdateColCnt
* bcc .5
rts
*--------------------------------------
.1 >PUSHW L.MSG.FILEEXT
jsr Mod2CSTR
>PUSHEA.G MOD File Mod
jsr CS.RUN.PushGidUid
ldy #S.STAT.SIZE+3
ldx #4
.2 lda (ZPFileStat),y
>PUSHA
dey
dex
bne .2
jsr CS.RUN.PUSHDATES
ldy #S.STAT.P.TYPE
lda (ZPFileStat),y
jsr FileType2PSTR
>PUSHYA
ldy #S.STAT.P.AUXTYPE+1
lda (ZPFileStat),y
>PUSHA
dey
lda (ZPFileStat),y
>PUSHA
.20 >PUSHW L.MSG.BDEVEXT
>PUSHW ZPFileName
ldy #S.STAT.P.SLOT
>PUSHB (ZPFileStat),y
iny DRIVE
>PUSHB (ZPFileStat),y
ldy #S.STAT.BLOCKS+1
>PUSHB (ZPFileStat),y
dey
>PUSHB (ZPFileStat),y
ldy #S.STAT.P.DEVBLOCKS+1
>PUSHB (ZPFileStat),y
dey
>PUSHB (ZPFileStat),y
>PUSHBI 8
>PUSHBI 20
>SYSCALL PrintF
bcs .90
.9 rts
ldy #bRecurse
lda (pData),y
bpl .80
>LDYA ZPFileName
jsr EnterSubDirYA
bcs .90
jmp CS.RUN.ENTER.MSG
.80 clc
.90 rts
*--------------------------------------
CS.RUN.PRINT.SRCPATH
ldy #hSrcBasePath
@ -618,12 +675,13 @@ CS.END
OptionList .AS "ACFLRacflr"
OptionVars .DA #bAllmostAll,#bColumn,#bFullPath,#bLong,#bRecurse,#bAllmostAll,#bColumn,#bFullPath,#bLong,#bRecurse
*--------------------------------------
MSG.DEVEXT .AZ "/%15s S%dD%d Blocks Used:%5D Total:%5D\r\n"
MSG.REG .AZ "%19s"
MSG.REGEXT .AZ "%s %6s %6s %10u %s %s %S %H %s\r\n"
MSG.DIR .AZ "\e[32m%s/\e[0m"
MSG.ENTER .AZ "Directory:%s\r\n"
MSG.DIREXT .AZ "%s %6s %6s %s %s <dir> \e[32m%s/\e[0m\r\n"
MSG.FILE .AZ "%19s"
MSG.FILEEXT .AS "%s %6s %6s %10u %s %s %S %H %s"
MSG.BDEV .AZ "\e[32m%s/\e[0m"
MSG.BDEVEXT .AZ "/%15s S%dD%d Blocks Used:%5D Total:%5D\r\n"
MSG.ENTER .AS "Directory:%s"
MSG.CRLF .AZ "\r\n"
*--------------------------------------
PRODOS.FT.HEX .HS 0406FAFCFDE2CBCCCFFF

View File

@ -28,7 +28,7 @@ MSG.USAGE .AS "Usage : MV [Src File/Dir, *,? wildcards allowed]\r\n"
.AS " -R : Recurse subdirectories\r\n"
.AZ " -Y : Dont't prompt for override\r\n"
MSG.DIR .AZ "MV Dir :%s to %s..."
MSG.FILE .AZ "MV File:%s to %s..."
MSG.REG .AZ "MV File:%s to %s..."
MSG.OVERWRITE .AZ "Overwrite %s [Yes,No,All]?"
MSG.OK .AZ "[OK]"
MSG.ERR .AS "[%h]"

View File

@ -3,7 +3,7 @@ NEW
.LIST OFF
.OP 65C02
.OR $2000
.TF BIN/PAK
.TF bin/pak
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
@ -83,10 +83,22 @@ CS.RUN >INC.G ArgIndex
bne .4
jsr CS.RUN.CheckOpt
bcc CS.RUN
bcs .9
bne CS.RUN
.9 >PUSHBI 0
>LDYA L.MSG.USAGE
>INC.G ArgIndex -X
>SYSCALL ArgV
bcs .9
>SYSCALL StrDup
bcs .9
txa
>STA.G hExclude
bra CS.RUN
.9 >PUSHW L.MSG.USAGE
>PUSHBI 0
>SYSCALL PrintF
lda #E.SYN
sec
@ -112,7 +124,7 @@ CS.RUN >INC.G ArgIndex
>LDA.G hSrcBasePath
beq .9
*--------------------------------------
>LDYAI 256
>SYSCALL GetMem
bcs .99
@ -186,6 +198,9 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
jsr FilterMatch
bcs .8 no match, skip....
jsr ExcludeMatch
bcc .8 match, skip
ldy #S.STAT.P.DRIVE
lda (ZPFileStat),y ProDOS Device ?
beq .5
@ -232,10 +247,10 @@ CS.RUN.DIR lda bRecurse
jsr CS.RUN.BuildFilePath
>PUSHW L.MSG.DIR
>PUSHW ZPRelPath
>PUSHBI 2
>LDYA L.MSG.DIR
>SYSCALL PrintF
bcs .9
@ -260,10 +275,10 @@ CS.RUN.FILE jsr CS.RUN.BuildFilePath
>SYSCALL strcmp
bcc .8
>PUSHW L.MSG.FILE
>PUSHW ZPRelPath
>PUSHBI 2
>LDYA L.MSG.FILE
>SYSCALL PrintF
bcs .9
@ -313,9 +328,11 @@ CS.RUN.CheckErr bcs .1
rts
.1 pha
>PUSHW L.MSG.ERR
pla
pha
>PUSHA
>PUSHBI 1
>LDYA L.MSG.ERR
>SYSCALL PrintF
@ -338,11 +355,10 @@ CS.RUN.BuildFilePath
rts
*--------------------------------------
CS.RUN.OpenFile >PUSHWZ Aux type
>PUSHBI 0 Type
CS.RUN.OpenFile >PUSHW ZPFullPath
>PUSHBI O.RDONLY
>LDYA ZPFullPath
>PUSHBI 0 Type
>PUSHWZ Aux type
>SYSCALL FOpen
bcs .9
@ -377,16 +393,17 @@ CS.RUN.Pak >PUSHEA.G PAKSTAT
>STYA.G Shunk.DstSize
.9 rts
*--------------------------------------
CS.RUN.OpenArc >PUSHWZ Aux type
>PUSHBI $CF PAK
CS.RUN.OpenArc >LDA.G ArcName
>SYSCALL Argv
>PUSHYA
bit bAppend
bmi CS.RUN.AppendArc
>PUSHBI O.CREATE+O.WRONLY
>LDA.G ArcName
>SYSCALL Argv
>PUSHBI $CF PAK
>PUSHWZ Aux type
>SYSCALL FOpen
bcs .9
@ -401,14 +418,15 @@ CS.RUN.OpenArc.RTS
*--------------------------------------
CS.RUN.AppendArc
>PUSHBI O.RDWR+O.APPEND
>LDA.G ArcName
>SYSCALL Argv
>PUSHBI $CF PAK
>PUSHWZ Aux type
>SYSCALL FOpen
bcs CS.RUN.OpenArc.RTS
>STA.G hArcFile
rts
>DEBUG
>PUSHBI SEEK.SET
>PUSHWI 0
>PUSHWI 0
@ -565,63 +583,67 @@ CS.DOEVENT sec
CS.QUIT jsr LeaveSubDir
bcc CS.QUIT
>LDA.G hFilter
ldy #hExclude
jsr .7
ldy #hFilter
jsr .7
ldy #hSrcFullPath
jsr .7
ldy #hDstBuf
jsr .7
ldy #hSrcBuf
jsr .7
>LDA.G hArcFile
beq .1
>SYSCALL FreeMem
.1 >LDA.G hSrcFullPath
beq .2
>SYSCALL FreeMem
.2 >LDA.G hArcFile
beq .3
>SYSCALL FClose
.3 >LDA.G hDstBuf
beq .4
>SYSCALL FreeMem
.4 >LDA.G hSrcBuf
beq .5
>SYSCALL FreeMem
.5 lda hLIB
beq .8
.1 lda hLIB
beq .2
>SYSCALL UnloadLib
.8 clc
.2 clc
rts
.7 lda (pData),y
beq .8
>SYSCALL FreeMem
.8 rts
*--------------------------------------
CS.RUN.CheckOpt ldy #1
lda (ZPPtr1),y
ldx #OptionVars-OptionList-1
.2 cmp OptionList,x
beq .3
.1 cmp OptionList,x
beq .2
dex
bpl .2
bpl .1
sec
rts
.3 ldy OptionVars,x
.2 ldy OptionVars,x
beq .8
lda #$ff
sta 0,y
clc
.8 clc
rts
*--------------------------------------
.INB USR/SRC/BIN/X.FILEENUM.S
*--------------------------------------
CS.END
*--------------------------------------
OptionList .AS "AaRr"
OptionVars .DA #bAppend,#bAppend,#bRecurse,#bRecurse
OptionList .AS "AaRrXx"
OptionVars .DA #bAppend,#bAppend,#bRecurse,#bRecurse,#0,#0
*--------------------------------------
MSG.USAGE .AS "Usage : PAK Archive [File *,? wildcards allowed]\r\n"
.AS " -A : Append to archive\r\n"
.AZ " -R : Recurse subdirectories\r\n"
.AS " -R : Recurse subdirectories\r\n"
.AZ " -X <*,? wildcards allowed> : exclude files \r\n"
MSG.OK .AZ "[OK]"
MSG.ERR .AZ "[%h]\r\n"
MSG.E.IARC .AZ "Invalid/corrupt archive"

View File

@ -3,7 +3,7 @@ NEW
.LIST OFF
.OP 65C02
.OR $2000
.TF BIN/PAKME
.TF bin/pakme
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
@ -86,12 +86,13 @@ CS.RUN ldy #S.PS.ARGC
jsr CS.RUN.CheckSrcFile
bcs .99
>PUSHW.G STATBUF+S.STAT.P.AUXTYPE
>PUSHB.G STATBUF+S.STAT.P.TYPE
>PUSHBI O.CREATE+O.WRONLY
lda #2
>SYSCALL ArgV
>PUSHYA
>PUSHBI O.CREATE+O.WRONLY
>PUSHB.G STATBUF+S.STAT.P.TYPE
>PUSHW.G STATBUF+S.STAT.P.AUXTYPE
>SYSCALL FOpen
bcs .99
@ -99,23 +100,22 @@ CS.RUN ldy #S.PS.ARGC
bra CS.RUN.START
.9 >PUSHBI 0
>LDYA L.MSG.USAGE
.9 >PUSHW L.MSG.USAGE
>PUSHBI 0
>SYSCALL PrintF
lda #E.SYN
sec
.99 rts
*--------------------------------------
CS.RUN.START >PUSHW ZPDstTableOfs
>PUSHB.G PAKME.HEADER+7
>PUSHW.G PAKME.HEADER+5
>PUSHW ZPSrcFileSize
CS.RUN.START >PUSHW L.MSG.SRCFILE
lda #1
>SYSCALL ArgV
>PUSHYA
>PUSHW ZPSrcFileSize
>PUSHW.G PAKME.HEADER+5
>PUSHB.G PAKME.HEADER+7
>PUSHW ZPDstTableOfs
>PUSHBI 9
>LDYA L.MSG.SRCFILE
>SYSCALL PrintF
>LDYA ZPDstTableOfs
@ -177,13 +177,13 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
jsr CS.RUN.GetChunk
bcs CS.RUN.RTS
>PUSHW ZPChunkLen
>PUSHW ZPChunkOfs
>PUSHW L.MSG.CHUNK
lda ZPChunkIndex
inc
>PUSHA
>PUSHW ZPChunkOfs
>PUSHW ZPChunkLen
>PUSHBI 5
>LDYA L.MSG.CHUNK
>SYSCALL PrintF
bcs .9
@ -214,19 +214,20 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
.9 rts
*--------------------------------------
CS.RUN.CheckSrcFile
>PUSHWZ Aux type
>PUSHBI 0 Type
>PUSHBI O.RDONLY
lda #1
>SYSCALL ArgV
>PUSHYA
>PUSHBI O.RDONLY
>PUSHBI 0 Type
>PUSHWZ Aux type
>SYSCALL FOpen
bcs .99
sta hSrcFile
>PUSHB hSrcFile
>PUSHEA.G STATBUF
lda hSrcFile
>SYSCALL fstat
.99 bcs .9
@ -444,10 +445,10 @@ CS.RUN.WritePak lda hDstFile
>SYSCALL fwrite
bcs .9
>PUSHW ZPChunkNewOfs
>PUSHW L.MSG.PAKED
>PUSHW ZPChunkPakedLen
>PUSHW ZPChunkNewOfs
>PUSHBI 4
>LDYA L.MSG.PAKED
>SYSCALL PrintF
.9
@ -475,10 +476,10 @@ CS.RUN.WriteStore
>SYSCALL fwrite
bcs .9
>PUSHW ZPChunkNewOfs
>PUSHW L.MSG.STORE
>PUSHW ZPChunkLen
>PUSHW ZPChunkNewOfs
>PUSHBI 4
>LDYA L.MSG.STORE
>SYSCALL PrintF
.9 rts

View File

@ -27,7 +27,7 @@ MSG.USAGE .AS "Usage : RM [File/Dir, *,? wildcards allowed]\r\n"
.AS " -Q : Quiet\r\n"
.AZ " -R : Recurse subdirectories\r\n"
MSG.DIR .AZ "RM Dir :%s..."
MSG.FILE .AZ "RM File:%s..."
MSG.REG .AZ "RM File:%s..."
MSG.OK .AZ "[OK]"
MSG.ERR .AS "[%h]"
MSG.CRLF .AZ "\r\n"

View File

@ -412,7 +412,8 @@ CMD.PAUSE lda #$FF
CMD.MD lda (ZPArgVBufPtr)
beq CMD.REN.CSYN
>LDYA ZPArgVBufPtr
>PUSHW ZPArgVBufPtr
>PUSHWI S.STAT.MODE.FO+S.STAT.MODE.FG+S.STAT.MODE.FU
>SYSCALL MKDir
rts
*--------------------------------------
@ -430,7 +431,7 @@ CMD.RD lda (ZPArgVBufPtr)
cmp #S.FI.T.DIR
bne CMD.REN.CSYN
>LDYA ZPArgVBufPtr
>PUSHW ZPArgVBufPtr
>SYSCALL Remove
.99 rts
*--------------------------------------

View File

@ -3,7 +3,7 @@ NEW
.LIST OFF
.OP 65C02
.OR $2000
.TF BIN/UNPAK
.TF bin/unpak
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
@ -108,8 +108,8 @@ CS.RUN >LDYAI CHNK.SIZE
sec
.9 rts
.99 >PUSHBI 0
>LDYA L.MSG.USAGE
.99 >PUSHW L.MSG.USAGE
>PUSHBI 0
>SYSCALL PrintF
lda #E.SYN
sec
@ -228,19 +228,20 @@ CS.RUN.LOOP jsr CS.RUN.GetByte
>SYSCALL PutS
rts
*--------------------------------------
CS.RUN.PrintFN >PUSHW ZPFullPathPtr
CS.RUN.PrintFN >PUSHW L.MSG.DIR,x
>PUSHW ZPFullPathPtr
>PUSHBI 2
>LDYA L.MSG.DIR,x
>SYSCALL PrintF
rts
*--------------------------------------
CS.RUN.OpenArc pha
>PUSHWZ Aux type
>PUSHBI $CF PAK
CS.RUN.OpenArc >PUSHYA
>PUSHBI O.RDONLY
pla
>PUSHBI $CF PAK
>PUSHWZ Aux type
>SYSCALL FOpen
bcs .9
>STA.G hArcFile
pha
>PUSHWI 3
@ -260,8 +261,8 @@ CS.RUN.OpenArc pha
.9 rts
.99
CS.RUN.E.IARC >PUSHBI 0
>LDYA L.MSG.E.IARC
CS.RUN.E.IARC >PUSHW L.MSG.E.IARC
>PUSHBI 0
>SYSCALL PrintF
lda #E.SYN
sec
@ -305,12 +306,13 @@ CS.RUN.GetByte >LDA.G hArcFile
>SYSCALL getc
rts
*--------------------------------------
CS.RUN.CheckDir >PUSHEA.G STAT
>LDYA ZPFullPathPtr
CS.RUN.CheckDir >PUSHW ZPFullPathPtr
>PUSHEA.G STAT
>SYSCALL stat
bcc .1
>LDYA ZPFullPathPtr
>PUSHW ZPFullPathPtr
>PUSHWI S.STAT.MODE.FO+S.STAT.MODE.FG+S.STAT.MODE.FU
>SYSCALL mkdir
rts
@ -326,10 +328,10 @@ CS.RUN.CheckDir >PUSHEA.G STAT
sec
.9 rts
*--------------------------------------
CS.RUN.OpenFile >PUSHW.G FileAuxType
>PUSHB.G FileType
CS.RUN.OpenFile >PUSHW ZPFullPathPtr
>PUSHBI O.CREATE+O.WRONLY+O.TRUNC
>LDYA ZPFullPathPtr
>PUSHB.G FileType
>PUSHW.G FileAuxType
>SYSCALL FOpen
bcs .9
>STA.G hFile

View File

@ -335,7 +335,8 @@ CS.RUN.CheckArg.Next
sta (ZPTmpPtr),y
.8 jmp CS.RUN.CheckArg
*--------------------------------------
CS.RUN.MkDir >LEA.G S.PW.DIR
CS.RUN.MkDir >PUSHEA.G S.PW.DIR
>PUSHWI S.STAT.MODE.RO+S.STAT.MODE.RG+S.STAT.MODE.FU
>SYSCALL MKDir
rts

View File

@ -34,7 +34,7 @@ CS.START cld
.DA CS.QUIT
L.MSG.USAGE .DA MSG.USAGE
L.MSG.DIR .DA MSG.DIR
L.MSG.FILE .DA MSG.FILE
L.MSG.REG .DA MSG.REG
.DO X.COPY.TO.DEST=1
L.MSG.OVERWRITE .DA MSG.OVERWRITE
.FIN
@ -215,13 +215,16 @@ CS.RUN ldy #S.PS.hStdIn
jsr FilterMatch
bcs CS.RUN.NEXT no match, skip....
.4 ldy #S.STAT.P.DRIVE
lda (ZPFileStat),y ProDOS Device ?
bne .6
ldy #S.STAT.P.TYPE
.4 ldy #S.STAT.MODE+1
lda (ZPFileStat),y
cmp #$0F Directory ?
bne .5
and #$70
bne .5 REG file ?
jsr CS.RUN.BuildFilePath
jmp CS.RUN.REG
.5 cmp /S.STAT.MODE.DIR DIR ?
bne .7
>LDA.G bRecurse
bpl CS.RUN.NEXT
@ -231,9 +234,8 @@ CS.RUN ldy #S.PS.hStdIn
jsr CS.RUN.BuildFilePath
jmp CS.RUN.DIR
.5 jsr CS.RUN.BuildFilePath
jmp CS.RUN.FILE
.6 lda #MLI.E.UNSUPST
.7 lda #MLI.E.UNSUPST
sec
.9 rts
*--------------------------------------
@ -287,7 +289,6 @@ CS.RUN.LEAVE.RTS
CS.RUN.DIR .DO X.COPY.TO.DEST=1
jsr CS.RUN.DIR.MSG
bcs CS.RUN.LEAVE.RTS
ldy #hDstFullPath
jsr CS.RUN.GetPathY
@ -300,6 +301,7 @@ CS.RUN.DIR .DO X.COPY.TO.DEST=1
ldy #bNoConfirm
lda (pData),y
bmi .21 no prompt, nothing to create, enter subdir
jsr CS.RUN.OVERWRITE.MSG
bcs CS.RUN.DIR.RTS
.1 >SLEEP
@ -323,9 +325,18 @@ CS.RUN.DIR .DO X.COPY.TO.DEST=1
.21 clc
lda #0
bra .4
.3 ldy #hDstFullPath
jsr CS.RUN.GetPathY
>PUSHYA
ldy #S.STAT.MODE+1
lda (ZPFileStat),y
>PUSHA
dey
lda (ZPFileStat),y
>PUSHA
>SYSCALL MKDir
.4 jsr CS.RUN.CheckErr
bcs CS.RUN.DIR.RTS
jsr CS.RUN.IncCount
@ -339,7 +350,7 @@ CS.RUN.DIR .DO X.COPY.TO.DEST=1
sec
CS.RUN.DIR.RTS rts
*--------------------------------------
CS.RUN.FILE jsr CS.RUN.FILE.MSG
CS.RUN.REG jsr CS.RUN.REG.MSG
bcs CS.RUN.DIR.RTS
.DO X.COPY.TO.DEST=1
@ -416,7 +427,7 @@ CS.RUN.FILE jsr CS.RUN.FILE.MSG
*--------------------------------------
CS.RUN.DIR.MSG sec
.HS 90 bcc opcode
CS.RUN.FILE.MSG clc
CS.RUN.REG.MSG clc
>LDA.G bQuiet
bmi .8
@ -425,7 +436,7 @@ CS.RUN.FILE.MSG clc
>LDYA L.MSG.DIR
bcs .2
.1 >LDYA L.MSG.FILE
.1 >LDYA L.MSG.REG
.2 >PUSHYA
ldy #hSrcFullPath

View File

@ -10,7 +10,7 @@ STAT .BS S.STAT
hFullPath .BS 1
hSrcBasePath .BS 1
hFilter .BS 1
hExclude .BS 1
.DO X.COPY.TO.DEST=1
hDstBasePath .BS 1
.FIN

View File

@ -12,6 +12,7 @@ X.MAX.RECURSE .EQ 8
* hDstBasePath .BS 1 (optional)
* STAT .BS S.STAT
* hFilter .BS 1
* hExclude .BS 1
*--------------------------------------
* Compare a ZPFileName against hFilter (e.g. '*test?.*')
* CC : match
@ -19,10 +20,22 @@ X.MAX.RECURSE .EQ 8
*--------------------------------------
FilterMatch >LDA.G index
dec
bne .8 in a subdir, match everything
bne FilterMatch.CLCRTS in a subdir, match everything
>LDA.G hFilter
beq .8 No filter....
clc
.HS B0 BCS
ExcludeMatch sec
php
lda #hFilter
adc #0
tay
lda (pData),y
plp
tax
beq FilterMatch.RTS No filter....exit with CS excluded
>SYSCALL GetMemPtr
>STYA ZPPtr2
@ -84,8 +97,9 @@ FilterMatch >LDA.G index
iny
bra .1 go check remaining char in pattern...
.8 clc
.8
FilterMatch.CLCRTS
clc
FilterMatch.RTS
rts
*--------------------------------------
@ -592,5 +606,5 @@ GetoDIRENT ldy #index
*--------------------------------------
MAN
SAVE USR/SRC/BIN/X.FILEENUM.S
LOAD USR/SRC/BIN/LS.S
LOAD USR/SRC/BIN/PAK.S
ASM

View File

@ -117,8 +117,11 @@ K.ReadDir.ROOT
jsr K.ReadDir.AddToBuf
jsr SHARED.ClrStat
lda (ZPPtr2)
lda /S.STAT.MODE.BDEV
sta K.S.STAT+S.STAT.MODE+1
lda (ZPPtr2)
asl DRIVE in Carry
pha
lda #0

View File

@ -353,8 +353,8 @@ SHARED.DirEnt2Stat
lda (ZPPtr3)
and #$F0
cmp #$D0 Directory ?
bne .1
cmp #$D0 Vol Hdr, Dir Hdr or Dir ?
bcc .1
lda /S.STAT.MODE.DIR
sta K.S.STAT+S.STAT.MODE+1