mirror of
https://github.com/A2osX/A2osX.git
synced 2025-03-20 13:32:23 +00:00
Kernel 0.93+
This commit is contained in:
parent
a447e582aa
commit
25a904276f
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -439,6 +439,7 @@ WRITE php
|
||||
eor #$ff
|
||||
|
||||
adc #0
|
||||
|
||||
.1 ora #L91C96.2.MMUCR.ALLOC
|
||||
sta L91C96.2.MMUCR,x
|
||||
|
||||
@ -493,7 +494,7 @@ WRITE php
|
||||
adc #$00
|
||||
sta L91C96.2.DATA,x
|
||||
|
||||
ldy #2
|
||||
ldy #0
|
||||
|
||||
.5 inc Counter
|
||||
bne .51
|
||||
@ -517,6 +518,7 @@ WRITE php
|
||||
sta L91C96.2.DATA,x
|
||||
iny
|
||||
bne .5
|
||||
|
||||
inc ZPBufPtr+1
|
||||
bra .5
|
||||
|
||||
|
@ -6,9 +6,6 @@ TOP.MAX .EQ 32
|
||||
REP.MAX .EQ 1+254
|
||||
BL.MIN .EQ 3
|
||||
BL.MAX .EQ 3+63
|
||||
|
||||
STR.MIN .EQ 127 DISABLED
|
||||
STR.MAX .EQ 3+15
|
||||
*--------------------------------------
|
||||
PAK.B.BYTE8.W .EQ 1
|
||||
PAK.B.BYTE8 .EQ %0
|
||||
@ -26,9 +23,6 @@ PAK.B.REP.W .EQ 6
|
||||
PAK.B.REP .EQ %111110
|
||||
PAK.B.BL.W .EQ 6
|
||||
PAK.B.BL .EQ %111111
|
||||
|
||||
PAK.B.STR.W .EQ 6 DISABLED
|
||||
PAK.B.STR .EQ %01.0000
|
||||
*--------------------------------------
|
||||
* Shunk Header :
|
||||
* WORD : Target UNCompressed Length
|
||||
@ -49,11 +43,10 @@ S.PAKSTAT.TOP16 .EQ 6
|
||||
S.PAKSTAT.TOP24 .EQ 8
|
||||
S.PAKSTAT.TOP32 .EQ 10
|
||||
S.PAKSTAT.BYTE8 .EQ 12
|
||||
S.PAKSTAT.STR .EQ 14
|
||||
S.PAKSTAT.REPN .EQ 16
|
||||
S.PAKSTAT.BL .EQ 18
|
||||
S.PAKSTAT.REPN .EQ 14
|
||||
S.PAKSTAT.BL .EQ 16
|
||||
*
|
||||
S.PAKSTAT .EQ 20
|
||||
S.PAKSTAT .EQ 18
|
||||
*--------------------------------------
|
||||
LIBPAK.Pak .EQ 4
|
||||
*--------------------------------------
|
||||
|
146
LIB/LIBPAK.S.txt
146
LIB/LIBPAK.S.txt
@ -16,8 +16,6 @@ ZPStatPtr .EQ ZPLIB+4
|
||||
ZPSrcBLPtr .EQ ZPLIB+8
|
||||
ZPCnt .EQ ZPLIB+10
|
||||
ZPBLCnt .EQ ZPLIB+12
|
||||
|
||||
|
||||
*--------------------------------------
|
||||
* File Header (16 Bytes)
|
||||
*--------------------------------------
|
||||
@ -107,8 +105,6 @@ Pak >PULLW Pak.SrcPtr
|
||||
Pak.Run >LDYA Pak.SrcPtr
|
||||
>STYA ZPSrcPtr
|
||||
|
||||
stz Pak.Str.Longest
|
||||
|
||||
stz Pak.Rep.Longest
|
||||
|
||||
stz Pak.BL.Longest
|
||||
@ -128,8 +124,6 @@ Pak.Run >LDYA Pak.SrcPtr
|
||||
stz Pak.RepCnt
|
||||
stz Pak.LastByte
|
||||
|
||||
stz Pak.Out.StrLen
|
||||
|
||||
ldx #S.PAKSTAT.PASS1
|
||||
bit Pak.bPass2
|
||||
bpl .1
|
||||
@ -181,7 +175,7 @@ Pak.Run.1 inc Pak.SrcCnt
|
||||
inc Pak.SrcCnt+1
|
||||
bmi .1
|
||||
|
||||
.8 jmp Pak.Out.Flush
|
||||
.8 clc
|
||||
|
||||
.9 rts
|
||||
|
||||
@ -301,10 +295,13 @@ Pak.ScanBL >LDYA Pak.SrcPtr Start at beginning of Src buf
|
||||
rts
|
||||
*--------------------------------------
|
||||
Pak.ComputeLenBits
|
||||
ldx #8
|
||||
lda Pak.Rep.Longest
|
||||
|
||||
dec
|
||||
tax
|
||||
dec Longest=1, one bit
|
||||
beq .15
|
||||
|
||||
ldx #8
|
||||
|
||||
.14 asl
|
||||
bcs .15
|
||||
@ -415,7 +412,8 @@ Pak.BuildTOPTable
|
||||
cpy #TOP.MAX
|
||||
bne .1
|
||||
|
||||
.8 tya
|
||||
.8 sty Pak.TOP.Count
|
||||
tya
|
||||
ora Pak.Shnk+S.PAKSHNK.TOPCNT
|
||||
sta Pak.Shnk+S.PAKSHNK.TOPCNT
|
||||
|
||||
@ -436,10 +434,7 @@ Pak.PutRep ldx #S.PAKSTAT.REPN
|
||||
clc
|
||||
rts
|
||||
|
||||
Pak.PutRep.2 jsr Pak.Out.Flush
|
||||
bcs .9
|
||||
|
||||
ldy #PAK.B.REP.W
|
||||
Pak.PutRep.2 ldy #PAK.B.REP.W
|
||||
lda #PAK.B.REP
|
||||
jsr Pak.Out.PutYBits
|
||||
bcs .9
|
||||
@ -484,10 +479,7 @@ Pak.PutBL ldx #S.PAKSTAT.BL
|
||||
clc
|
||||
rts
|
||||
|
||||
.20 jsr Pak.Out.Flush
|
||||
bcs .9
|
||||
|
||||
ldy #PAK.B.BL.W
|
||||
.20 ldy #PAK.B.BL.W
|
||||
lda #PAK.B.BL
|
||||
jsr Pak.Out.PutYBits
|
||||
bcs .9
|
||||
@ -524,42 +516,42 @@ Pak.PutByte8 sta Pak.LastByte
|
||||
|
||||
inc Pak.CntH,x
|
||||
|
||||
.6 ldx #S.PAKSTAT.PASS1
|
||||
.6 ldx #S.PAKSTAT.BYTE8
|
||||
jsr Pak.UpdateStats
|
||||
|
||||
ldx #S.PAKSTAT.BYTE8
|
||||
ldx #S.PAKSTAT.PASS1
|
||||
jsr Pak.UpdateStats
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
Pak.PutByte8.2 ldy Pak.Shnk+S.PAKSHNK.TOPCNT
|
||||
Pak.PutByte8.2 ldy Pak.TOP.Count
|
||||
|
||||
.1 cmp Pak.Shnk+S.PAKSHNK.TOPBYTES-1,y
|
||||
beq .3
|
||||
dey
|
||||
bne .1
|
||||
|
||||
inc Pak.Out.StrLen
|
||||
ldy Pak.Out.StrLen
|
||||
sta Pak.Out.StrBuf,y
|
||||
cpy #STR.MAX
|
||||
bcc .9
|
||||
ldx #S.PAKSTAT.BYTE8
|
||||
jsr Pak.UpdateStats
|
||||
|
||||
jmp Pak.Out.Flush
|
||||
|
||||
.3 phy
|
||||
jsr Pak.Out.Flush
|
||||
ply
|
||||
pha
|
||||
ldy #PAK.B.BYTE8.W
|
||||
lda #PAK.B.BYTE8
|
||||
jsr Pak.Out.PutYBits
|
||||
pla
|
||||
bcs .9
|
||||
|
||||
dey Range 0-23
|
||||
ldy #8
|
||||
jmp Pak.Out.PutYBits
|
||||
|
||||
.3 dey Range 0-31
|
||||
|
||||
tya
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
tax Range 0-2
|
||||
tax Range 0-3
|
||||
|
||||
tya
|
||||
and #7
|
||||
@ -591,15 +583,13 @@ Pak.Out.Init lda Pak.Shnk+S.PAKSHNK.BLBITS
|
||||
bcs .9
|
||||
|
||||
iny
|
||||
cpy Pak.Shnk+S.PAKSHNK.TOPCNT
|
||||
cpy Pak.TOP.Count
|
||||
bne .1
|
||||
|
||||
lda #$80
|
||||
sta Pak.Out.Mask
|
||||
stz Pak.Out.Byte
|
||||
|
||||
stz Pak.Out.StrLen
|
||||
|
||||
clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
@ -610,69 +600,6 @@ Pak.Out.Close bit Pak.Out.Mask
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
Pak.Out.Flush lda Pak.Out.StrLen
|
||||
beq .8
|
||||
|
||||
cmp #STR.MIN
|
||||
bcs .2
|
||||
|
||||
ldx #0
|
||||
|
||||
.1 ldy #PAK.B.BYTE8.W
|
||||
lda PAK.B.BYTE8
|
||||
jsr Pak.Out.PutYBits
|
||||
bcs .9
|
||||
|
||||
inc Pak.Stat+S.PAKSTAT.BYTE8
|
||||
bne .10
|
||||
|
||||
inc Pak.Stat+S.PAKSTAT.BYTE8+1
|
||||
|
||||
.10 inx
|
||||
lda Pak.Out.StrBuf,x
|
||||
ldy #8
|
||||
jsr Pak.Out.PutYBits
|
||||
bcs .9
|
||||
|
||||
cpx Pak.Out.StrLen
|
||||
bne .1
|
||||
|
||||
bra .7
|
||||
|
||||
.2 dec
|
||||
dec
|
||||
dec
|
||||
ora #PAK.B.STR
|
||||
|
||||
ldy #PAK.B.STR.W
|
||||
jsr Pak.Out.PutYBits
|
||||
bcs .9
|
||||
|
||||
ldx #0
|
||||
|
||||
.3 inx
|
||||
lda Pak.Out.StrBuf,x
|
||||
|
||||
ldy #8
|
||||
jsr Pak.Out.PutYBits
|
||||
bcs .9
|
||||
|
||||
cpx Pak.Out.StrLen
|
||||
bne .3
|
||||
|
||||
cpx Pak.Str.Longest
|
||||
bcc .7
|
||||
|
||||
stx Pak.Str.Longest
|
||||
|
||||
ldx #S.PAKSTAT.STR
|
||||
jsr Pak.UpdateStats
|
||||
|
||||
.7 stz Pak.Out.StrLen
|
||||
|
||||
.8 clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
Pak.Out.PutYBits
|
||||
phy
|
||||
|
||||
@ -753,9 +680,6 @@ Pak.PrintStats lda Pak.BL.OfsBitsL
|
||||
>PUSHB Pak.REP.Longest
|
||||
>PUSHW Pak.Stat+S.PAKSTAT.REPN
|
||||
|
||||
>PUSHB Pak.Str.Longest
|
||||
>PUSHW Pak.Stat+S.PAKSTAT.STR
|
||||
|
||||
ldx #S.PAKSTAT.BYTE8
|
||||
|
||||
.1 >PUSHW Pak.Stat,x
|
||||
@ -763,16 +687,18 @@ Pak.PrintStats lda Pak.BL.OfsBitsL
|
||||
dex
|
||||
bpl .1
|
||||
|
||||
>PUSHBI 28
|
||||
>PUSHBI 25
|
||||
>LDYA L.MSG.Stats
|
||||
>SYSCALL printf
|
||||
|
||||
ldx #TOP.MAX
|
||||
ldx #TOP.MAX-1
|
||||
|
||||
.2 >PUSHB Pak.Shnk+S.PAKSHNK.TOPCNT,x
|
||||
.2 >PUSHB Pak.Shnk+S.PAKSHNK.TOPBYTES,x
|
||||
dex
|
||||
bpl .2
|
||||
|
||||
>PUSHB Pak.TOP.Count
|
||||
|
||||
>PUSHBI TOP.MAX+1
|
||||
>LDYA L.MSG.TopBytes
|
||||
>SYSCALL printf
|
||||
@ -818,10 +744,9 @@ MSG.Stats .AS "\r\nPass 1 : %5D\r\n"
|
||||
.AS "Top 24 : %5D\r\n"
|
||||
.AS "Top 32 : %5D\r\n"
|
||||
.AS "Byte 8 : %5D\r\n"
|
||||
.AS "String : %5D, Longest : %d\r\n"
|
||||
.AS "Rep : %5D, Longest : %d (%d bits)\r\n"
|
||||
.AZ "BL : %5D, Longest : %d (%d bits), Farest : %D (%d bits)\r\n"
|
||||
MSG.TopBytes .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%h%h%h%h%h%h%h%h\r\n"
|
||||
MSG.TopBytes .AZ "Top : %2d:%h%h%h%h%h%h%h%h%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,#PAK.B.TOP32
|
||||
TOP.BitCnt .DA #PAK.B.TOP8.W,#PAK.B.TOP16.W,#PAK.B.TOP24.W,#PAK.B.TOP32.W
|
||||
TOP.Stat .DA #S.PAKSTAT.TOP8,#S.PAKSTAT.TOP16,#S.PAKSTAT.TOP24,#S.PAKSTAT.TOP32
|
||||
@ -833,6 +758,8 @@ Pak.DstCnt .BS 2
|
||||
|
||||
Pak.bPass2 .BS 1
|
||||
|
||||
Pak.TOP.Count .BS 1
|
||||
|
||||
Pak.BL.Longest .BS 1
|
||||
Pak.BL.Farest .BS 2
|
||||
|
||||
@ -847,9 +774,7 @@ Pak.BestBL .BS 2
|
||||
Pak.Cnt .BS 2
|
||||
Pak.bStop .BS 1
|
||||
|
||||
Pak.Str.Longest .BS 1
|
||||
Pak.Rep.Longest .BS 1
|
||||
|
||||
Pak.Rep.LenBits .BS 1
|
||||
|
||||
Pak.RepCnt .BS 1
|
||||
@ -857,9 +782,6 @@ Pak.LastByte .BS 1
|
||||
|
||||
Pak.Out.Byte .BS 1
|
||||
Pak.Out.Mask .BS 1
|
||||
|
||||
Pak.Out.StrLen .BS 1
|
||||
Pak.Out.StrBuf .BS STR.MAX
|
||||
*--------------------------------------
|
||||
Pak.CntL .BS 256
|
||||
Pak.CntH .BS 256
|
||||
|
@ -153,10 +153,10 @@ STDLIB.realpath.I
|
||||
|
||||
>STYA ZPPtr1
|
||||
stx .99+1 save expanded buffer hMem
|
||||
|
||||
ldx #$ff
|
||||
|
||||
lda (ZPPtr1)
|
||||
beq .1
|
||||
|
||||
cmp #'/' full path starting with '/'?
|
||||
beq .3 yes, do not append to current prefix
|
||||
@ -189,52 +189,41 @@ STDLIB.realpath.I
|
||||
*--------------------------------------
|
||||
* X=LEN, K.Buf256 = /dir1/./../file(/)\0
|
||||
*--------------------------------------
|
||||
ldx #1 skip leading /
|
||||
ldx #0 will skip leading /
|
||||
|
||||
.5 ldy #0 reset dot counter=0
|
||||
|
||||
.6 inx
|
||||
lda K.Buf256,x
|
||||
beq .8
|
||||
|
||||
.5 ldy #0 dot counter=0
|
||||
|
||||
.6 cmp #'/'
|
||||
.7 cmp #'/'
|
||||
beq .8
|
||||
|
||||
cmp #'.'
|
||||
bne .7
|
||||
bne .5
|
||||
|
||||
iny
|
||||
.HS 2C BIT ABS, skip "LDY #0"
|
||||
.7 ldy #0 not a dot....reset dot counter
|
||||
|
||||
inx
|
||||
lda K.Buf256,x
|
||||
bne .6 we have /dir\0
|
||||
bra .6
|
||||
|
||||
.8 tya
|
||||
beq .80 Y was 0....nothing to do...
|
||||
|
||||
dey "./" ?
|
||||
dey one dot ?
|
||||
bne .9 no..
|
||||
|
||||
lda K.Buf256-2,x
|
||||
cmp #'/' "/./" ?
|
||||
bne .80
|
||||
|
||||
dex
|
||||
dex
|
||||
jsr K.RealPath.RemoveAtX we found "/./", remove,useless....
|
||||
jsr K.RealPath.RemoveAtX we found "/.", remove,useless....
|
||||
bra .80
|
||||
|
||||
.9 dey "../" ?
|
||||
bne .99 ".../" ??!!...mmm...syntax error
|
||||
|
||||
lda K.Buf256-3,x
|
||||
cmp #'/' "/../" ?
|
||||
bne .80
|
||||
.9 dey "/.." ?
|
||||
bne .99 "/..." ??!!...syntax error
|
||||
|
||||
dex
|
||||
dex
|
||||
dex
|
||||
txa we found "/../"
|
||||
txa we found "/.."
|
||||
beq .99 at the beginning of string...cannot remove /dir/..
|
||||
|
||||
jsr K.RealPath.RemoveAtX remove "/.."
|
||||
@ -245,8 +234,8 @@ STDLIB.realpath.I
|
||||
bne .10
|
||||
|
||||
jsr K.RealPath.RemoveAtX ...remove "/dir"
|
||||
.80 inx
|
||||
lda K.Buf256,x
|
||||
|
||||
.80 lda K.Buf256,x was / or \0 ?
|
||||
bne .5
|
||||
*--------------------------------------
|
||||
.81 jsr .99
|
||||
@ -274,16 +263,21 @@ K.RealPath.RemoveAtX
|
||||
.1 iny
|
||||
lda K.Buf256,y
|
||||
beq .2 found /something\0
|
||||
|
||||
cmp #'/'
|
||||
bne .1 found /something/
|
||||
|
||||
.2 phx save X for exit
|
||||
|
||||
.3 iny K.Buf256,y=/ or 0
|
||||
inx
|
||||
lda K.Buf256-1,y
|
||||
sta K.Buf256-1,x
|
||||
bne .3
|
||||
|
||||
txa
|
||||
bne .8
|
||||
|
||||
lda #'/' Make sure we have a least '/' in the buffer
|
||||
sta K.Buf256
|
||||
stz K.Buf256+1
|
||||
|
Loading…
x
Reference in New Issue
Block a user