mirror of
https://github.com/A2osX/A2osX.git
synced 2024-07-12 21:31:00 +00:00
Kernel 0.93+
This commit is contained in:
parent
cc5d919c5d
commit
353f376bb9
Binary file not shown.
@ -287,6 +287,7 @@ CS.RUN.FILE jsr FilterMatch
|
|||||||
bra .9
|
bra .9
|
||||||
|
|
||||||
.2 jsr CS.RUN.Pak
|
.2 jsr CS.RUN.Pak
|
||||||
|
>DEBUG
|
||||||
jsr CS.RUN.WriteArcData
|
jsr CS.RUN.WriteArcData
|
||||||
bcc .1
|
bcc .1
|
||||||
|
|
||||||
|
@ -2,11 +2,13 @@ NEW
|
|||||||
AUTO 3,1
|
AUTO 3,1
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
REP.MAX .EQ 8
|
BYTE8.MAX .EQ 1+15
|
||||||
|
REP.MAX .EQ 1+7
|
||||||
BL.MIN .EQ 3
|
BL.MIN .EQ 3
|
||||||
BL.MAX .EQ 252
|
BL.MAX .EQ 3+63
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
PAK.B.BYTE8 .EQ %0
|
PAK.B.BYTE8 .EQ %0.0000
|
||||||
|
PAK.B.BYTE8.W .EQ 5
|
||||||
PAK.B.TOP8 .EQ %10.000
|
PAK.B.TOP8 .EQ %10.000
|
||||||
PAK.B.TOP8.W .EQ 5
|
PAK.B.TOP8.W .EQ 5
|
||||||
PAK.B.TOP16 .EQ %110.000
|
PAK.B.TOP16 .EQ %110.000
|
||||||
|
@ -2,7 +2,7 @@ NEW
|
|||||||
AUTO 3,1
|
AUTO 3,1
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CHNK.SIZE .EQ 4096
|
CHNK.SIZE .EQ 2048
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CHNK.T .EQ 0
|
CHNK.T .EQ 0
|
||||||
CHNK.T.DIR .EQ 1
|
CHNK.T.DIR .EQ 1
|
||||||
@ -24,3 +24,5 @@ CHNK.DATA.PAK.TOPLEN .EQ 3
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MAN
|
MAN
|
||||||
SAVE INC/PAK.I
|
SAVE INC/PAK.I
|
||||||
|
LOAD USR/SRC/BIN/PAK.S
|
||||||
|
ASM
|
||||||
|
140
LIB/LIBPAK.S.txt
140
LIB/LIBPAK.S.txt
@ -124,11 +124,12 @@ Pak.Run >LDYA Pak.SrcPtr
|
|||||||
eor #$ff
|
eor #$ff
|
||||||
sta Pak.SrcCnt+1
|
sta Pak.SrcCnt+1
|
||||||
sta Pak.DstCnt+1
|
sta Pak.DstCnt+1
|
||||||
|
|
||||||
sec
|
stz Pak.RepCnt
|
||||||
ror Pak.RepCnt
|
|
||||||
stz Pak.LastByte
|
stz Pak.LastByte
|
||||||
|
|
||||||
|
stz Pak.Out.ByteCnt
|
||||||
|
|
||||||
ldx #S.PAKSTAT.PASS1
|
ldx #S.PAKSTAT.PASS1
|
||||||
bit Pak.bPass2
|
bit Pak.bPass2
|
||||||
bpl .1
|
bpl .1
|
||||||
@ -147,23 +148,24 @@ Pak.Run.1 inc Pak.SrcCnt
|
|||||||
inc Pak.SrcCnt+1
|
inc Pak.SrcCnt+1
|
||||||
beq .8 0 byte left...
|
beq .8 0 byte left...
|
||||||
|
|
||||||
.1 jsr Pak.ScanRep
|
.1 jsr Pak.ScanBL
|
||||||
bcs .10
|
bcs .2
|
||||||
|
|
||||||
|
jsr Pak.PutBL
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
ldy Pak.BestBLLen
|
||||||
|
bra .6
|
||||||
|
|
||||||
|
.2 jsr Pak.ScanRep
|
||||||
|
bcs .20
|
||||||
|
|
||||||
jsr Pak.PutRep
|
jsr Pak.PutRep
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
ldy Pak.RepCnt
|
ldy Pak.RepCnt
|
||||||
bra .6
|
stz Pak.RepCnt
|
||||||
|
|
||||||
.10 jsr Pak.ScanBL
|
|
||||||
bcs .20
|
|
||||||
|
|
||||||
.2 jsr Pak.PutBL
|
|
||||||
bcs .9
|
|
||||||
|
|
||||||
ldy Pak.BestBLLen
|
|
||||||
|
|
||||||
.6 tya
|
.6 tya
|
||||||
clc
|
clc
|
||||||
adc ZPSrcPtr
|
adc ZPSrcPtr
|
||||||
@ -178,8 +180,9 @@ Pak.Run.1 inc Pak.SrcCnt
|
|||||||
bcc .1
|
bcc .1
|
||||||
inc Pak.SrcCnt+1
|
inc Pak.SrcCnt+1
|
||||||
bmi .1
|
bmi .1
|
||||||
|
|
||||||
|
.8 jmp Pak.Out.Flush
|
||||||
|
|
||||||
.8 clc
|
|
||||||
.9 rts
|
.9 rts
|
||||||
|
|
||||||
.20 lda (ZPSrcPtr) Not found...
|
.20 lda (ZPSrcPtr) Not found...
|
||||||
@ -412,15 +415,18 @@ Pak.PutRep ldx #S.PAKSTAT.REPN
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
Pak.PutRep.2 lda Pak.RepCnt
|
Pak.PutRep.2 jsr Pak.Out.Flush
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
lda Pak.RepCnt
|
||||||
dec remap 1-8 to 0-7 range
|
dec remap 1-8 to 0-7 range
|
||||||
|
|
||||||
ldy #PAK.B.REPn.W
|
ldy #PAK.B.REPn.W
|
||||||
ora #PAK.B.REPn
|
ora #PAK.B.REPn
|
||||||
|
|
||||||
jsr Pak.Out.PutYBits
|
jmp Pak.Out.PutYBits
|
||||||
|
|
||||||
rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.PutBL ldx #S.PAKSTAT.BL
|
Pak.PutBL ldx #S.PAKSTAT.BL
|
||||||
jsr Pak.UpdateStats
|
jsr Pak.UpdateStats
|
||||||
@ -454,9 +460,13 @@ Pak.PutBL ldx #S.PAKSTAT.BL
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.20 ldy #PAK.B.BL.W
|
.20 jsr Pak.Out.Flush
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
ldy #PAK.B.BL.W
|
||||||
lda #PAK.B.BL
|
lda #PAK.B.BL
|
||||||
jsr Pak.Out.PutYBits
|
jsr Pak.Out.PutYBits
|
||||||
|
bcs .9
|
||||||
|
|
||||||
ldy Pak.BL.OfsBitsH
|
ldy Pak.BL.OfsBitsH
|
||||||
beq .2
|
beq .2
|
||||||
@ -475,14 +485,14 @@ Pak.PutBL ldx #S.PAKSTAT.BL
|
|||||||
dec
|
dec
|
||||||
dec
|
dec
|
||||||
dec
|
dec
|
||||||
jsr Pak.Out.PutYBits
|
jmp Pak.Out.PutYBits
|
||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.PutByte8 sta Pak.LastByte
|
Pak.PutByte8 sta Pak.LastByte
|
||||||
|
|
||||||
bit Pak.bPass2
|
bit Pak.bPass2
|
||||||
bmi Pak.PutByte.2
|
bmi Pak.PutByte8.2
|
||||||
|
|
||||||
.5 tax
|
.5 tax
|
||||||
inc Pak.CntL,x
|
inc Pak.CntL,x
|
||||||
@ -499,7 +509,7 @@ Pak.PutByte8 sta Pak.LastByte
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
Pak.PutByte.2 ldy Pak.Shnk+S.PAKSHNK.TOPCNT
|
Pak.PutByte8.2 ldy Pak.Shnk+S.PAKSHNK.TOPCNT
|
||||||
|
|
||||||
.1 cmp Pak.Shnk+S.PAKSHNK.TOPBYTES-1,y
|
.1 cmp Pak.Shnk+S.PAKSHNK.TOPBYTES-1,y
|
||||||
beq .3
|
beq .3
|
||||||
@ -509,10 +519,20 @@ Pak.PutByte.2 ldy Pak.Shnk+S.PAKSHNK.TOPCNT
|
|||||||
ldx #S.PAKSTAT.BYTE8
|
ldx #S.PAKSTAT.BYTE8
|
||||||
jsr Pak.UpdateStats
|
jsr Pak.UpdateStats
|
||||||
|
|
||||||
clc
|
inc Pak.Out.ByteCnt
|
||||||
jmp Pak.Out.PutCA
|
ldy Pak.Out.ByteCnt
|
||||||
|
sta Pak.Out.ByteBuf,y
|
||||||
|
cpy #BYTE8.MAX
|
||||||
|
bcc .9
|
||||||
|
|
||||||
.3 dey Range 0-23
|
jmp Pak.Out.Flush
|
||||||
|
|
||||||
|
.3 phy
|
||||||
|
jsr Pak.Out.Flush
|
||||||
|
ply
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
dey Range 0-23
|
||||||
|
|
||||||
tya
|
tya
|
||||||
lsr
|
lsr
|
||||||
@ -529,6 +549,8 @@ Pak.PutByte.2 ldy Pak.Shnk+S.PAKSHNK.TOPCNT
|
|||||||
pla
|
pla
|
||||||
jsr Pak.UpdateStats
|
jsr Pak.UpdateStats
|
||||||
jmp Pak.Out.PutYBits
|
jmp Pak.Out.PutYBits
|
||||||
|
|
||||||
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.Out.Init lda Pak.Shnk+S.PAKSHNK.BLBITS
|
Pak.Out.Init lda Pak.Shnk+S.PAKSHNK.BLBITS
|
||||||
jsr Pak.Out.PutByte
|
jsr Pak.Out.PutByte
|
||||||
@ -552,6 +574,8 @@ Pak.Out.Init lda Pak.Shnk+S.PAKSHNK.BLBITS
|
|||||||
sta Pak.Out.Mask
|
sta Pak.Out.Mask
|
||||||
stz Pak.Out.Byte
|
stz Pak.Out.Byte
|
||||||
|
|
||||||
|
stz Pak.Out.ByteCnt
|
||||||
|
|
||||||
clc
|
clc
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -562,25 +586,53 @@ Pak.Out.Close bit Pak.Out.Mask
|
|||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.Out.PutCA jsr Pak.Out.PutBitC
|
Pak.Out.Flush lda Pak.Out.ByteCnt
|
||||||
bcs Pak.Out.Put.rts
|
beq .8
|
||||||
|
|
||||||
|
dec
|
||||||
|
ora #PAK.B.BYTE8
|
||||||
|
|
||||||
|
ldy #PAK.B.BYTE8.W
|
||||||
|
jsr Pak.Out.PutYBits
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
|
||||||
|
.1 inx
|
||||||
|
lda Pak.Out.ByteBuf,x
|
||||||
|
|
||||||
ldy #8
|
ldy #8
|
||||||
|
jsr Pak.Out.PutYBits
|
||||||
.1 asl
|
bcs .9
|
||||||
jsr Pak.Out.PutBitC
|
|
||||||
bcs Pak.Out.Put.rts
|
cpx Pak.Out.ByteCnt
|
||||||
dey
|
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
Pak.Out.Put.rts rts
|
stz Pak.Out.ByteCnt
|
||||||
|
|
||||||
|
.8 clc
|
||||||
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.Out.PutYBits
|
Pak.Out.PutYBits
|
||||||
|
phy
|
||||||
|
|
||||||
|
.1 cpy #8
|
||||||
|
beq .2
|
||||||
|
|
||||||
|
asl
|
||||||
|
iny
|
||||||
|
bra .1
|
||||||
|
|
||||||
|
.2 ply
|
||||||
asl
|
asl
|
||||||
jsr Pak.Out.PutBitC
|
jsr Pak.Out.PutBitC
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
dey
|
dey
|
||||||
bne Pak.Out.PutYBits
|
bne Pak.Out.PutYBits
|
||||||
|
|
||||||
|
* clc
|
||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.Out.PutBitC pha
|
Pak.Out.PutBitC pha
|
||||||
@ -590,21 +642,14 @@ Pak.Out.PutBitC pha
|
|||||||
tsb Pak.Out.Byte
|
tsb Pak.Out.Byte
|
||||||
|
|
||||||
.1 lsr Pak.Out.Mask
|
.1 lsr Pak.Out.Mask
|
||||||
bne .8
|
bcc .8
|
||||||
|
|
||||||
ror Pak.Out.Mask
|
ror Pak.Out.Mask
|
||||||
|
|
||||||
jsr Pak.Out.PutByte
|
|
||||||
bcs .9
|
|
||||||
|
|
||||||
|
lda Pak.Out.Byte
|
||||||
|
jsr Pak.Out.PutByte
|
||||||
|
|
||||||
.8 pla
|
.8 pla
|
||||||
* clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
.9 pla
|
|
||||||
* sec
|
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.Out.PutByte inc Pak.DstCnt
|
Pak.Out.PutByte inc Pak.DstCnt
|
||||||
@ -712,7 +757,7 @@ MSG.Stats .AS "\r\nPass 1 : %5D\r\n"
|
|||||||
.AS "Top 24 : %5D\r\n"
|
.AS "Top 24 : %5D\r\n"
|
||||||
.AS "Rep N : %5D, Longest : %d\r\n"
|
.AS "Rep N : %5D, Longest : %d\r\n"
|
||||||
.AZ "BLNK : %5D, Longest : %d (%d bits), Farest : %D (%d bits)\r\n"
|
.AZ "BLNK : %5D, Longest : %d (%d bits), Farest : %D (%d bits)\r\n"
|
||||||
MSG.Top24 .AZ "Top : %d, %h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h\r\n"
|
MSG.Top24 .AZ "Top : %5d, %h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h%h\r\n"
|
||||||
TOP.Bits .DA #PAK.B.TOP8,PAK.B.TOP16,PAK.B.TOP24
|
TOP.Bits .DA #PAK.B.TOP8,PAK.B.TOP16,PAK.B.TOP24
|
||||||
TOP.BitCnt .DA #PAK.B.TOP8.W,#PAK.B.TOP16.W,#PAK.B.TOP24.W
|
TOP.BitCnt .DA #PAK.B.TOP8.W,#PAK.B.TOP16.W,#PAK.B.TOP24.W
|
||||||
TOP.Stat .DA #S.PAKSTAT.TOP8,#S.PAKSTAT.TOP16,#S.PAKSTAT.TOP24
|
TOP.Stat .DA #S.PAKSTAT.TOP8,#S.PAKSTAT.TOP16,#S.PAKSTAT.TOP24
|
||||||
@ -745,6 +790,9 @@ Pak.LastByte .BS 1
|
|||||||
|
|
||||||
Pak.Out.Byte .BS 1
|
Pak.Out.Byte .BS 1
|
||||||
Pak.Out.Mask .BS 1
|
Pak.Out.Mask .BS 1
|
||||||
|
|
||||||
|
Pak.Out.ByteCnt .BS 1
|
||||||
|
Pak.Out.ByteBuf .BS BYTE8.MAX
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.CntL .BS 256
|
Pak.CntL .BS 256
|
||||||
Pak.CntH .BS 256
|
Pak.CntH .BS 256
|
||||||
|
@ -25,8 +25,7 @@ X.Unpak lda (ZPInBufPtr) ULEN LO
|
|||||||
lda (ZPInBufPtr) CHNK.DATA.T
|
lda (ZPInBufPtr) CHNK.DATA.T
|
||||||
beq X.Unpak.T.STORE
|
beq X.Unpak.T.STORE
|
||||||
|
|
||||||
cmp #CHNK.DATA.T.PAK
|
|
||||||
beq X.Unpak.T.PAK
|
|
||||||
|
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
Loading…
Reference in New Issue
Block a user