Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-09-19 17:22:14 +02:00
parent a1f446972d
commit 51cf136e46
10 changed files with 206 additions and 68 deletions

Binary file not shown.

View File

@ -1,6 +1,5 @@
NEW NEW
PREFIX AUTO 3,1
AUTO 4,1
.LIST OFF .LIST OFF
.OP 65C02 .OP 65C02
.OR $2000 .OR $2000

View File

@ -1,5 +1,5 @@
NEW NEW
AUTO 4,1 AUTO 3,1
.LIST OFF .LIST OFF
.OP 65C02 .OP 65C02
.OR $2000 .OR $2000
@ -568,7 +568,7 @@ MSG.FILE .AZ "%19s"
MSG.FILEEXT .AS "%15s %S $%H %s %10u %s %s" MSG.FILEEXT .AS "%15s %S $%H %s %10u %s %s"
MSG.CRLF .AZ "\r\n" MSG.CRLF .AZ "\r\n"
*-------------------------------------- *--------------------------------------
PRODOS.FT.HEX .HS 0406FAFCFDE2CBCCFF PRODOS.FT.HEX .HS 0406FAFCFDE2CBCCCFFF
PRODOS.FT.TXT >PSTR "TXT" PRODOS.FT.TXT >PSTR "TXT"
>PSTR "BIN" >PSTR "BIN"
>PSTR "ASM" >PSTR "ASM"
@ -577,6 +577,7 @@ PRODOS.FT.TXT >PSTR "TXT"
>PSTR "ATK" >PSTR "ATK"
>PSTR "PIX" >PSTR "PIX"
>PSTR "FON" >PSTR "FON"
>PSTR "PAK"
>PSTR "SYS" >PSTR "SYS"
PRODOS.FT.DFLT >PSTR "$ " PRODOS.FT.DFLT >PSTR "$ "
MSG.NODATE .AZ " <No-Date> " MSG.NODATE .AZ " <No-Date> "
@ -593,7 +594,6 @@ MOD .BS 11 drwxrwxrwx0
TIME.Create .BS 20 TIME.Create .BS 20
TIME.Mod .BS 20 TIME.Mod .BS 20
hFilter .BS 1
bPause .BS 1 bPause .BS 1
bAllmostAll .BS 1 bAllmostAll .BS 1
bColumn .BS 1 bColumn .BS 1

View File

@ -7,9 +7,23 @@ NEW
*-------------------------------------- *--------------------------------------
.INB INC/MACROS.I .INB INC/MACROS.I
.INB INC/A2OSX.I .INB INC/A2OSX.I
.INB INC/KERNEL.I
.INB INC/MLI.I .INB INC/MLI.I
.INB INC/MLI.E.I .INB INC/MLI.E.I
*-------------------------------------- *--------------------------------------
CHNK.T .EQ 0
CHNK.T.DATA .EQ 0
CHNK.T.DIR .EQ 1
CHNK.T.FILE .EQ 2
*
CHNK.TYPE .EQ 1
CHNK.AUXTYPE .EQ 2
CHNK.FNLEN .EQ 4
*
CHNK.COMPALG .EQ 1
CHNK.ULEN .EQ 2
CHNK.CLEN .EQ 4
*--------------------------------------
X.ENTER.SUBDIR .EQ 0 X.ENTER.SUBDIR .EQ 0
X.COPY.TO.DEST .EQ 0 X.COPY.TO.DEST .EQ 0
X.DELETE.SOURCE .EQ 0 X.DELETE.SOURCE .EQ 0
@ -21,7 +35,14 @@ ZPPtr1 .BS 2
ZPPtr2 .BS 2 ZPPtr2 .BS 2
ZPFileName .BS 2 ZPFileName .BS 2
ZPFileStat .BS 2 ZPFileStat .BS 2
ZPFullPath .BS 2 ZPFullPath .BS 2
ZPRelPath .BS 2
bAppend .BS 1
bRecurse .BS 1
bPause .BS 1
ZS.END .ED ZS.END .ED
*-------------------------------------- *--------------------------------------
* File Header (16 Bytes) * File Header (16 Bytes)
@ -48,6 +69,7 @@ L.MSG.DIR .DA MSG.DIR
L.MSG.FILE .DA MSG.FILE L.MSG.FILE .DA MSG.FILE
L.MSG.OK .DA MSG.OK L.MSG.OK .DA MSG.OK
L.MSG.ERR .DA MSG.ERR L.MSG.ERR .DA MSG.ERR
L.ARC.Header .DA ARC.Header
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
CS.INIT clc CS.INIT clc
@ -62,15 +84,8 @@ CS.RUN >INC.G ArgIndex
cmp #'-' cmp #'-'
bne .4 bne .4
ldy #1 jsr CS.RUN.CheckOpt
lda (ZPPtr1),y bcc CS.RUN
ldx OptionList
.2 cmp OptionList,x
beq .3
dex
bne .2
.9 >PUSHBI 0 .9 >PUSHBI 0
>LDYA L.MSG.USAGE >LDYA L.MSG.USAGE
@ -78,11 +93,6 @@ CS.RUN >INC.G ArgIndex
lda #E.SYN lda #E.SYN
sec sec
.99 rts .99 rts
.3 ldy OptionVars-1,x
lda #$80
sta (pData),y
bra CS.RUN
*-------------------------------------- *--------------------------------------
.4 >LDA.G ArcName .4 >LDA.G ArcName
bne .5 bne .5
@ -111,6 +121,33 @@ CS.RUN >INC.G ArgIndex
>STYA ZPFullPath >STYA ZPFullPath
txa txa
>STA.G hSrcFullPath >STA.G hSrcFullPath
>LDA.G hSrcBasePath
>SYSCALL GetMemPtr
>STYA ZPPtr1
ldy #$ff
.80 iny
lda (ZPPtr1),y
bne .80
tya
clc
adc ZPFullPath
sta ZPRelPath
lda ZPFullPath+1
adc #0
sta ZPRelPath+1
jsr CS.RUN.OpenArc
bcs .99
>LDYAI 4096
>SYSCALL getmem
bcs .99
txa
>STA.G hMem
*-------------------------------------- *--------------------------------------
CS.RUN.LOOP ldy #S.PS.hStdIn CS.RUN.LOOP ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
@ -129,13 +166,14 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
cmp #$13 Ctrl-S cmp #$13 Ctrl-S
bne .1 bne .1
>LDA.G bPause lda bPause
eor #$ff eor #$ff
sta (pData),y sta bPause
bne CS.RUN.LOOP bne CS.RUN.LOOP
.1 >LDA.G bPause .1 lda bPause
bne CS.RUN.LOOP Pause... bne CS.RUN.LOOP Pause...
jsr GetEntry jsr GetEntry
bcs .9 bcs .9
@ -176,7 +214,7 @@ CS.RUN.DEV lda #E.BADPATH
sec sec
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.DIR >LDA.G bRecurse CS.RUN.DIR lda bRecurse
bpl .8 bpl .8
lda (ZPFileName) lda (ZPFileName)
@ -185,39 +223,60 @@ CS.RUN.DIR >LDA.G bRecurse
jsr CS.RUN.GetFilePath jsr CS.RUN.GetFilePath
>PUSHW ZPFullPath >PUSHW ZPRelPath
>PUSHBI 2 >PUSHBI 2
>LDYA L.MSG.DIR >LDYA L.MSG.DIR
>SYSCALL printf >SYSCALL printf
bcs .9 bcs .9
jsr CS.RUN.CheckErr lda #CHNK.T.DIR
jsr CS.RUN.WriteHeader
bcs .9
>LDYA ZPFileName >LDYA ZPFileName
jmp EnterSubDirYA jsr EnterSubDirYA
.9 jmp CS.RUN.CheckErr
.8 clc .8 clc
.9 rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.FILE jsr FilterMatch CS.RUN.FILE jsr FilterMatch
bcs .8 no match, skip.... bcs .8 no match, skip....
>PUSHW ZPFullPath
>LDA.G hArcFile
tay
lda OF.Table.hPath-1,x
>SYSCALL getmemptr
>SYSCALL strcmp
bcc .8
jsr CS.RUN.GetFilePath jsr CS.RUN.GetFilePath
>PUSHW ZPFullPath >PUSHW ZPRelPath
>PUSHBI 2 >PUSHBI 2
>LDYA L.MSG.FILE >LDYA L.MSG.FILE
>SYSCALL printf >SYSCALL printf
bcs .9 bcs .9
lda #CHNK.T.FILE
jsr CS.RUN.WriteHeader
bcs .9
jsr CS.RUN.OpenFile
bcs .9
>LDA.G hFile
jsr CS.RUN.CheckErr >SYSCALL fclose
.9 jsr CS.RUN.CheckErr
.8 clc .8 clc
.9 rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.CheckErr bcs .1 CS.RUN.CheckErr bcs .1
>LDYA L.MSG.OK >LDYA L.MSG.OK
@ -230,11 +289,9 @@ CS.RUN.CheckErr bcs .1
>LDYA L.MSG.ERR >LDYA L.MSG.ERR
>SYSCALL printf >SYSCALL printf
>LDA.G bContinue
eor #$80
asl
pla pla
sec
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.GetFilePath CS.RUN.GetFilePath
@ -251,6 +308,72 @@ CS.RUN.GetFilePath
>SYSCALL StrCat >SYSCALL StrCat
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.OpenArc >PUSHWZ Aux type
>PUSHBI $CF PAK
>PUSHBI O.CREATE+O.WRONLY
>LDA.G ArcName
>SYSCALL Argv
>SYSCALL FOpen
bcs .9
>STA.G hArcFile
>PUSHW L.ARC.Header
>LDA.G hArcFile
>SYSCALL fputs
.9 rts
*--------------------------------------
CS.RUN.WriteHeader
>PUSHA
jsr .8
bcs .9
ldy #S.STAT.P.TYPE
jsr .6
bcs .9
ldy #S.STAT.P.AUXTYPE
jsr .6
bcs .9
ldy #S.STAT.P.AUXTYPE+1
jsr .6
bcs .9
ldy #$ff
.1 iny
lda (ZPRelPath),y
bne .1
tya
jsr .7
bcs .9
>PUSHW ZPRelPath
>LDA.G hArcFile
>SYSCALL fputs
rts
.6 lda (ZPFileStat),y
.7 >PUSHA
.8 >LDA.G hArcFile
>SYSCALL fputc
.9 rts
*--------------------------------------
CS.RUN.OpenFile >PUSHWZ Aux type
>PUSHBI 0 Type
>PUSHBI O.RDONLY
>LDYA ZPFullPath
>SYSCALL FOpen
bcs .9
>STA.G hFile
.9 rts
*--------------------------------------
CS.DOEVENT sec CS.DOEVENT sec
rts rts
*-------------------------------------- *--------------------------------------
@ -262,48 +385,68 @@ CS.QUIT jsr LeaveSubDir
>SYSCALL FreeMem >SYSCALL FreeMem
.1 >LDA.G hSrcFullPath .1 >LDA.G hSrcFullPath
beq .8 beq .2
>SYSCALL FreeMem >SYSCALL FreeMem
.2 >LDA.G hArcFile
beq .3
>SYSCALL fclose
.3 >LDA.G hMem
beq .8
>SYSCALL FreeMem
.8 clc .8 clc
rts rts
*--------------------------------------
CS.RUN.CheckOpt ldy #1
lda (ZPPtr1),y
ldx #OptionVars-OptionList-1
.2 cmp OptionList,x
beq .3
dex
bpl .2
sec
rts
.3 ldy OptionVars,x
lda #$ff
sta 0,y
clc
rts
*-------------------------------------- *--------------------------------------
.INB USR/SRC/BIN/X.FILEENUM.S .INB USR/SRC/BIN/X.FILEENUM.S
*-------------------------------------- *--------------------------------------
CS.END CS.END
*-------------------------------------- *--------------------------------------
OptionList >PSTR "CRcr" OptionList .AS "AaRr"
OptionVars .DA #bContinue,#bRecurse,#bContinue,#bRecurse OptionVars .DA #bAppend,#bAppend,#bRecurse,#bRecurse
*-------------------------------------- *--------------------------------------
MSG.USAGE .AS "Usage : PAK Archive [File *,? wildcards allowed]\r\n" MSG.USAGE .AS "Usage : PAK Archive [File *,? wildcards allowed]\r\n"
.AS " -C : Continue on error\r\n" .AS " -A : Append to archive\r\n"
.AZ " -R : Recurse subdirectories\r\n" .AZ " -R : Recurse subdirectories\r\n"
MSG.OK .AZ "[OK]" MSG.OK .AZ "[OK]"
MSG.ERR .AZ "[%h]\r\n" MSG.ERR .AZ "[%h]\r\n"
MSG.DIR .AZ "Reading Dir:%s..." MSG.DIR .AZ "Reading Dir:%s..."
MSG.FILE .AZ "Adding File:%s..." MSG.FILE .AZ "Adding File:%s..."
ARC.Header .AZ "PAK"
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR 0 .OR 0
DS.START DS.START
ArgIndex .BS 1 ArgIndex .BS 1
bContinue .BS 1
bRecurse .BS 1
ArcName .BS 1 ArcName .BS 1
bPause .BS 1
hFullPath .BS 1
hSrcFullPath .BS 1 hSrcFullPath .BS 1
STAT .BS S.STAT hArcFile .BS 1
Index .BS 1 hFile .BS 1
hDIRs .BS X.MAX.RECURSE hMem .BS 1
hDIRENTs .BS X.MAX.RECURSE
oDIRENTs .BS X.MAX.RECURSE*2
hSrcBasePath .BS 1
hFilter .BS 1
.INB USR/SRC/BIN/X.FILEENUM.G
DS.END DS.END
.ED .ED
*-------------------------------------- *--------------------------------------

View File

@ -1,12 +1,10 @@
NEW NEW
PREFIX AUTO 3,1
AUTO 4,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
ArgCount .BS 1 ArgCount .BS 1
bPause .BS 1 bPause .BS 1
hFilter .BS 1
hSrcFile .BS 1 hSrcFile .BS 1
hSrcFullPath .BS 1 hSrcFullPath .BS 1
Count .BS 2 Count .BS 2
@ -30,4 +28,4 @@ hToDelete .BS 1
.FIN .FIN
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/BIN/X.CPMVRM.G SAVE USR/SRC/BIN/X.CPMVRM.G

View File

@ -1,5 +1,5 @@
NEW NEW
AUTO 4,1 AUTO 3,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
X.COPY.BUF.SIZE .EQ 4096 X.COPY.BUF.SIZE .EQ 4096

View File

@ -1,8 +1,7 @@
NEW NEW
PREFIX AUTO 3,1
AUTO 4,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
Index .BS 1 Index .BS 1
hDIRs .BS X.MAX.RECURSE+1 hDIRs .BS X.MAX.RECURSE+1
hDIRENTs .BS X.MAX.RECURSE+1 hDIRENTs .BS X.MAX.RECURSE+1
@ -10,11 +9,10 @@ oDIRENTs .BS X.MAX.RECURSE*2
STAT .BS S.STAT STAT .BS S.STAT
hFullPath .BS 1 hFullPath .BS 1
hSrcBasePath .BS 1 hSrcBasePath .BS 1
hFilter .BS 1
.DO X.COPY.TO.DEST=1 .DO X.COPY.TO.DEST=1
hDstBasePath .BS 1 hDstBasePath .BS 1
.FIN .FIN
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -1,6 +1,5 @@
NEW NEW
PREFIX AUTO 3,1
AUTO 4,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
X.MAX.RECURSE .EQ 8 X.MAX.RECURSE .EQ 8

View File

@ -2,6 +2,8 @@ NEW
AUTO 3,1 AUTO 3,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
STOREMAX .EQ 64
*--------------------------------------
* File Header : * File Header :
*-------------------------------------- *--------------------------------------
S.PAKFILE.LEN .EQ 0 File Length (uncomp) S.PAKFILE.LEN .EQ 0 File Length (uncomp)

View File

@ -1,6 +1,5 @@
NEW NEW
PREFIX AUTO 3,1
AUTO 4,1
.LIST OFF .LIST OFF
.OP 65C02 .OP 65C02
.OR $2000 .OR $2000