mirror of
https://github.com/A2osX/A2osX.git
synced 2025-08-07 11:26:36 +00:00
Kernel 0.9.1 : LIBPAK cleanup...
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -24,7 +24,7 @@
|
|||||||
<Keywords name="Folders in comment, open"></Keywords>
|
<Keywords name="Folders in comment, open"></Keywords>
|
||||||
<Keywords name="Folders in comment, middle"></Keywords>
|
<Keywords name="Folders in comment, middle"></Keywords>
|
||||||
<Keywords name="Folders in comment, close"></Keywords>
|
<Keywords name="Folders in comment, close"></Keywords>
|
||||||
<Keywords name="Keywords1">.BS
.DA
.AS
.AT
.EQ
.MA
.EM
.OR
.TF
.LIST
.HS
.IN
.INB
.OP
.TA
.EM
.PH
.EP
.DUMMY
.ED
.DO
.ELSE
.FIN</Keywords>
|
<Keywords name="Keywords1">.BS
.DA
.AS
.AT
.AZ
.EQ
.MA
.EM
.OR
.TF
.LIST
.HS
.IN
.INB
.OP
.TA
.EM
.PH
.EP
.DUMMY
.ED
.DO
.ELSE
.FIN</Keywords>
|
||||||
<Keywords name="Keywords2">adc
and
asl
bit
brk
clc
cld
cli
clv
cmp
cpx
cpy
dec
dex
dey
eor
inc
inx
iny
lda
ldx
ldy
lsr
nop
ora
rmb
rol
ror
rti
rts
sbc
sec
sed
sei
smb
sta
stp
stx
sty
stz
tax
tay
trb
tsb
tsx
txa
txs
tya
wai</Keywords>
|
<Keywords name="Keywords2">adc
and
asl
bit
brk
clc
cld
cli
clv
cmp
cpx
cpy
dec
dex
dey
eor
inc
inx
iny
lda
ldx
ldy
lsr
nop
ora
rmb
rol
ror
rti
rts
sbc
sec
sed
sei
smb
sta
stp
stx
sty
stz
tax
tay
trb
tsb
tsx
txa
txs
tya
wai</Keywords>
|
||||||
<Keywords name="Keywords3">$
%
/
#
&</Keywords>
|
<Keywords name="Keywords3">$
%
/
#
&</Keywords>
|
||||||
<Keywords name="Keywords4">.1
.2
.3
.4
.5
.6
.7
.8
.9
</Keywords>
|
<Keywords name="Keywords4">.1
.2
.3
.4
.5
.6
.7
.8
.9
</Keywords>
|
||||||
|
22
INC/LIBPAK.I.txt
Normal file
22
INC/LIBPAK.I.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
PR#3
|
||||||
|
PREFIX /A2OSX.BUILD
|
||||||
|
NEW
|
||||||
|
INC 1
|
||||||
|
AUTO 6
|
||||||
|
.LIST OFF
|
||||||
|
.OP 65C02
|
||||||
|
*--------------------------------------
|
||||||
|
S.PAKSTAT.SIZE .EQ 0
|
||||||
|
S.PAKSTAT.BL .EQ 2
|
||||||
|
S.PAKSTAT.REP .EQ 4
|
||||||
|
S.PAKSTAT.S3 .EQ 6
|
||||||
|
S.PAKSTAT.S4 .EQ 8
|
||||||
|
S.PAKSTAT.STORE .EQ 10
|
||||||
|
*
|
||||||
|
S.PAKSTAT .EQ 12
|
||||||
|
*--------------------------------------
|
||||||
|
LIBPAK.Pak .EQ 4
|
||||||
|
LIBPAK.UnPak .EQ 6
|
||||||
|
*--------------------------------------
|
||||||
|
MAN
|
||||||
|
SAVE /A2OSX.BUILD/INC/LIBPAK.I
|
142
LIB/LIBPAK.S.txt
142
LIB/LIBPAK.S.txt
@@ -26,14 +26,6 @@ S.PAKHDR.SHORT3 .EQ 18
|
|||||||
*
|
*
|
||||||
S.PAKHDR .EQ 26
|
S.PAKHDR .EQ 26
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
S.PAKSTAT.BL .EQ 0
|
|
||||||
S.PAKSTAT.REP .EQ 2
|
|
||||||
S.PAKSTAT.S3 .EQ 4
|
|
||||||
S.PAKSTAT.S4 .EQ 6
|
|
||||||
S.PAKSTAT.STORE .EQ 8
|
|
||||||
*
|
|
||||||
S.PAKSTAT .EQ 10
|
|
||||||
*--------------------------------------
|
|
||||||
PIPELEN .EQ 18
|
PIPELEN .EQ 18
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* BITSTREAM :
|
* BITSTREAM :
|
||||||
@@ -57,11 +49,13 @@ PIPELEN .EQ 18
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.INB /A2OSX.BUILD/INC/MACROS.I
|
.INB /A2OSX.BUILD/INC/MACROS.I
|
||||||
.INB /A2OSX.BUILD/INC/A2OSX.I
|
.INB /A2OSX.BUILD/INC/A2OSX.I
|
||||||
|
.INB /A2OSX.BUILD/INC/LIBPAK.I
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.SrcPtr .EQ ZPLIB
|
Pak.SrcPtr .EQ ZPLIB
|
||||||
Pak.SrcBlPtr .EQ ZPLIB+2
|
Pak.SrcBlPtr .EQ ZPLIB+2
|
||||||
Pak.SrcBlPtrT .EQ ZPLIB+4
|
Pak.SrcBlPtrT .EQ ZPLIB+4
|
||||||
Pak.DstPtr .EQ ZPLIB+6
|
Pak.DstPtr .EQ ZPLIB+6
|
||||||
|
Pak.StatPtr .EQ ZPLIB+8
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* File Header (16 Bytes)
|
* File Header (16 Bytes)
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@@ -86,34 +80,43 @@ CS.START cld
|
|||||||
LIB.LOAD
|
LIB.LOAD
|
||||||
LIB.UNLOAD clc
|
LIB.UNLOAD clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*/--------------------------------------
|
||||||
* In :
|
* # Pak
|
||||||
* PULLW = Src PTR
|
* ## In :
|
||||||
* PULLW = Src LEN
|
* PUSHW = Src PTR
|
||||||
* PULLW = Dst PTR Compressed Buffer
|
* PUSHW = Src Length
|
||||||
*--------------------------------------
|
* PUSHW = Dst PTR Output Buffer
|
||||||
Pak >PULLYA
|
* PUSHW = Dst PTR S.PAKSTAT
|
||||||
>STYA Pak.Src Init for pass #1
|
*\--------------------------------------
|
||||||
>STYA Pak.SrcPtr
|
Pak >PULLW Pak.StatPtr
|
||||||
|
|
||||||
|
>PULLW Pak.DstPtr
|
||||||
|
|
||||||
>PULLA Get Src Len LO
|
>PULLA Get Src Len LO
|
||||||
eor #$ff
|
eor #$ff
|
||||||
sta Pak.SrcCnt
|
sta Pak.SrcCnt
|
||||||
sta Pak.Cnt Init for pass #1
|
sta Pak.Cnt Init for pass #1
|
||||||
|
sta Pak.DstCnt
|
||||||
tax
|
tax
|
||||||
|
|
||||||
>PULLA Get Src Len HI
|
>PULLA Get Src Len HI
|
||||||
eor #$ff
|
eor #$ff
|
||||||
sta Pak.SrcCnt+1
|
sta Pak.SrcCnt+1
|
||||||
sta Pak.Cnt+1 Init for pass #1
|
sta Pak.Cnt+1 Init for pass #1
|
||||||
|
sta Pak.DstCnt+1
|
||||||
tay
|
tay
|
||||||
|
|
||||||
>PULLW Pak.DstPtr
|
|
||||||
txa
|
txa
|
||||||
jsr Pak.PutByte
|
jsr Pak.PutByte
|
||||||
tya
|
tya
|
||||||
jsr Pak.PutByte
|
jsr Pak.PutByte
|
||||||
|
|
||||||
|
>PULLYA Get Src PTR
|
||||||
|
>STYA Pak.Src Init for pass #1
|
||||||
|
>STYA Pak.SrcPtr
|
||||||
|
|
||||||
ldx #S.PAKSTAT-1
|
ldx #S.PAKSTAT-1
|
||||||
|
|
||||||
.1 stz PakStat,x Reset Stats
|
.1 stz PakStat,x Reset Stats
|
||||||
dex
|
dex
|
||||||
bpl .1
|
bpl .1
|
||||||
@@ -121,6 +124,7 @@ Pak >PULLYA
|
|||||||
* PASS #1 : Count occurence for each value...
|
* PASS #1 : Count occurence for each value...
|
||||||
|
|
||||||
Pak.1 ldx #0
|
Pak.1 ldx #0
|
||||||
|
|
||||||
.1 stz Pak.CntL,x
|
.1 stz Pak.CntL,x
|
||||||
stz Pak.CntH,x
|
stz Pak.CntH,x
|
||||||
inx
|
inx
|
||||||
@@ -173,7 +177,7 @@ Pak.1 ldx #0
|
|||||||
stz Pak.CntH,x
|
stz Pak.CntH,x
|
||||||
dey
|
dey
|
||||||
bpl .6
|
bpl .6
|
||||||
|
|
||||||
ldx #15
|
ldx #15
|
||||||
|
|
||||||
.9 lda PakHdr+S.PAKHDR.SHORT4,x Store SHORT4 in reverse order
|
.9 lda PakHdr+S.PAKHDR.SHORT4,x Store SHORT4 in reverse order
|
||||||
@@ -203,7 +207,7 @@ Pak.2 >LDYA Pak.Src Init for pass #2
|
|||||||
stz Pak.Byte
|
stz Pak.Byte
|
||||||
|
|
||||||
stz Pak.PipeLen
|
stz Pak.PipeLen
|
||||||
|
|
||||||
Pak.2.LOOP ldx Pak.PipeLen Always fill Bytes in the PIPE until full
|
Pak.2.LOOP ldx Pak.PipeLen Always fill Bytes in the PIPE until full
|
||||||
|
|
||||||
.1 jsr Pak.GetByte Load PIPE....
|
.1 jsr Pak.GetByte Load PIPE....
|
||||||
@@ -222,7 +226,14 @@ Pak.2.LOOP ldx Pak.PipeLen Always fill Bytes in the PIPE until full
|
|||||||
|
|
||||||
jmp Pak.2.Store only one....store it
|
jmp Pak.2.Store only one....store it
|
||||||
|
|
||||||
Pak.2.EXIT clc
|
Pak.2.EXIT ldy #S.PAKSTAT-1
|
||||||
|
|
||||||
|
.1 lda PakStat,y
|
||||||
|
* sta (Pak.StatPtr),y
|
||||||
|
dey
|
||||||
|
bpl .1
|
||||||
|
|
||||||
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
* try finding REPeating same bytes.....
|
* try finding REPeating same bytes.....
|
||||||
@@ -241,6 +252,7 @@ Pak.2.REP ldx #0
|
|||||||
phx REP 1 + 0 or more....save REP count for later....
|
phx REP 1 + 0 or more....save REP count for later....
|
||||||
|
|
||||||
jsr Pak.PutA a = byte to store
|
jsr Pak.PutA a = byte to store
|
||||||
|
bcs .91
|
||||||
|
|
||||||
lda #%11100000
|
lda #%11100000
|
||||||
plx
|
plx
|
||||||
@@ -251,10 +263,13 @@ Pak.2.REP ldx #0
|
|||||||
|
|
||||||
.3 ldy #4
|
.3 ldy #4
|
||||||
jsr Pak.PutYBits
|
jsr Pak.PutYBits
|
||||||
|
bcs .91
|
||||||
|
|
||||||
txa
|
txa
|
||||||
beq .4 if not REP 2 or more no extra count
|
beq .4 if not REP 2 or more no extra count
|
||||||
ldy #4
|
ldy #4
|
||||||
jsr Pak.PutYBits
|
jsr Pak.PutYBits
|
||||||
|
bcs .90
|
||||||
|
|
||||||
.4 pla
|
.4 pla
|
||||||
clc
|
clc
|
||||||
@@ -264,7 +279,12 @@ Pak.2.REP ldx #0
|
|||||||
|
|
||||||
ldx #S.PAKSTAT.REP
|
ldx #S.PAKSTAT.REP
|
||||||
jsr Pak.UpdateStats
|
jsr Pak.UpdateStats
|
||||||
jmp Pak.2.LOOP
|
jmp Pak.2.LOOP
|
||||||
|
|
||||||
|
.91 pla
|
||||||
|
.90 lda #K.E.OOM
|
||||||
|
sec
|
||||||
|
rts
|
||||||
Pak.2.BL
|
Pak.2.BL
|
||||||
* Try finding best matching BackLink between SrcBlPtr and SrcPtr (max 512)
|
* Try finding best matching BackLink between SrcBlPtr and SrcPtr (max 512)
|
||||||
.4 lda Pak.SrcPtr
|
.4 lda Pak.SrcPtr
|
||||||
@@ -306,6 +326,7 @@ Pak.2.BL
|
|||||||
lda #%1100000
|
lda #%1100000
|
||||||
ldy #3
|
ldy #3
|
||||||
jsr Pak.PutYBits
|
jsr Pak.PutYBits
|
||||||
|
bcs .91
|
||||||
|
|
||||||
lda Pak.Limit
|
lda Pak.Limit
|
||||||
sec
|
sec
|
||||||
@@ -314,6 +335,7 @@ Pak.2.BL
|
|||||||
|
|
||||||
ldy #8
|
ldy #8
|
||||||
jsr Pak.PutYBits
|
jsr Pak.PutYBits
|
||||||
|
bcs .92
|
||||||
|
|
||||||
plp
|
plp
|
||||||
lda Pak.Limit+1
|
lda Pak.Limit+1
|
||||||
@@ -321,7 +343,7 @@ Pak.2.BL
|
|||||||
sbc Pak.SrcBlPtrT+1
|
sbc Pak.SrcBlPtrT+1
|
||||||
|
|
||||||
jsr Pak.PutBit
|
jsr Pak.PutBit
|
||||||
|
bcs .91
|
||||||
ply Get back BL len
|
ply Get back BL len
|
||||||
phy
|
phy
|
||||||
|
|
||||||
@@ -336,10 +358,17 @@ Pak.2.BL
|
|||||||
asl
|
asl
|
||||||
ldy #4 store 4 bits len
|
ldy #4 store 4 bits len
|
||||||
jsr Pak.PutYBits
|
jsr Pak.PutYBits
|
||||||
|
bcs .90
|
||||||
|
|
||||||
ldx #S.PAKSTAT.BL
|
ldx #S.PAKSTAT.BL
|
||||||
jsr Pak.UpdateStats
|
jsr Pak.UpdateStats
|
||||||
jmp Pak.2.LOOP
|
jmp Pak.2.LOOP
|
||||||
|
|
||||||
|
.92 pla
|
||||||
|
.91 pla
|
||||||
|
.90 lda #K.E.OOM
|
||||||
|
sec
|
||||||
|
rts
|
||||||
* No match...try starting at next byte
|
* No match...try starting at next byte
|
||||||
.9 inc Pak.SrcBlPtrT
|
.9 inc Pak.SrcBlPtrT
|
||||||
bne .5
|
bne .5
|
||||||
@@ -361,9 +390,11 @@ Pak.2.Store lda Pak.Pipe
|
|||||||
lda #0
|
lda #0
|
||||||
ldy #1
|
ldy #1
|
||||||
jsr Pak.PutYBits write 0
|
jsr Pak.PutYBits write 0
|
||||||
|
bcs .9
|
||||||
|
|
||||||
lda Pak.Pipe ...and byte
|
lda Pak.Pipe ...and byte
|
||||||
jsr Pak.PutA
|
jsr Pak.PutA
|
||||||
|
bcs .9
|
||||||
|
|
||||||
ldy #1
|
ldy #1
|
||||||
jsr Pak.StripPipe
|
jsr Pak.StripPipe
|
||||||
@@ -387,26 +418,39 @@ Pak.2.Store lda Pak.Pipe
|
|||||||
ldy #6
|
ldy #6
|
||||||
|
|
||||||
.8 jsr Pak.PutYBits write 100xxxx
|
.8 jsr Pak.PutYBits write 100xxxx
|
||||||
|
bcs .9
|
||||||
|
|
||||||
ldy #1
|
ldy #1
|
||||||
jsr Pak.StripPipe
|
jsr Pak.StripPipe
|
||||||
jmp Pak.2.LOOP
|
jmp Pak.2.LOOP
|
||||||
|
|
||||||
|
.9 lda #K.E.OOM
|
||||||
|
sec
|
||||||
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.PutA ldy #8
|
Pak.PutA ldy #8
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.PutYBits asl
|
Pak.PutYBits asl
|
||||||
jsr Pak.PutBit
|
jsr Pak.PutBit
|
||||||
|
bcs .9
|
||||||
dey
|
dey
|
||||||
bne Pak.PutYBits
|
bne Pak.PutYBits
|
||||||
rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Pak.PutBit (bit in C)
|
* Pak.PutBit (bit in C)
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.PutBit ldx #$ff
|
Pak.PutBit ldx #$ff SELF MODIFIED
|
||||||
|
|
||||||
pha
|
pha
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
lda Pak.Byte
|
lda Pak.Byte
|
||||||
|
php
|
||||||
|
|
||||||
jsr Pak.PutByte
|
jsr Pak.PutByte
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
plp
|
||||||
stz Pak.Byte
|
stz Pak.Byte
|
||||||
ldx #8
|
ldx #8
|
||||||
|
|
||||||
@@ -414,21 +458,42 @@ Pak.PutBit ldx #$ff
|
|||||||
stx Pak.PutBit+1
|
stx Pak.PutBit+1
|
||||||
bcc .8 Nothing to "light up"
|
bcc .8 Nothing to "light up"
|
||||||
|
|
||||||
lda Pak.Byte
|
|
||||||
lda Pak.BitMask,x
|
lda Pak.BitMask,x
|
||||||
sta Pak.Byte
|
tsb Pak.Byte
|
||||||
|
clc
|
||||||
|
|
||||||
.8 pla
|
.8 pla
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
.9 plp
|
||||||
|
pla
|
||||||
|
sec
|
||||||
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.PutByte sta (Pak.DstPtr)
|
Pak.PutByte inc Pak.DstCnt
|
||||||
inc Pak.DstPtr
|
|
||||||
bne .1
|
bne .1
|
||||||
|
inc Pak.DstCnt+1
|
||||||
|
beq .9
|
||||||
|
|
||||||
|
bra .8
|
||||||
|
|
||||||
|
.1 sta (Pak.DstPtr)
|
||||||
|
inc Pak.DstPtr
|
||||||
|
bne .2
|
||||||
inc Pak.DstPtr+1
|
inc Pak.DstPtr+1
|
||||||
|
|
||||||
.1 inc PakHdr+S.PAKHDR.LEN
|
.2 inc PakHdr+S.PAKHDR.LEN
|
||||||
bne .2
|
bne .3
|
||||||
inc PakHdr+S.PAKHDR.LEN+1
|
inc PakHdr+S.PAKHDR.LEN+1
|
||||||
.2
|
|
||||||
|
.3 inc PakStat+S.PAKSTAT.SIZE
|
||||||
|
bne .8
|
||||||
|
inc PakStat+S.PAKSTAT.SIZE+1
|
||||||
|
|
||||||
|
.8 clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
.9 sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Y = count to remove from PIPE
|
* Y = count to remove from PIPE
|
||||||
@@ -454,9 +519,9 @@ Pak.UpdateStats inc PakStat,x
|
|||||||
inc PakStat+1,x
|
inc PakStat+1,x
|
||||||
.8 rts
|
.8 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Pak.GetByte inc UnPak.Cnt
|
Pak.GetByte inc Pak.Cnt
|
||||||
bne .1
|
bne .1
|
||||||
inc UnPak.Cnt+1
|
inc Pak.Cnt+1
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
.1 lda (Pak.SrcPtr)
|
.1 lda (Pak.SrcPtr)
|
||||||
@@ -634,12 +699,13 @@ CS.END
|
|||||||
Pak.Src .BS 2
|
Pak.Src .BS 2
|
||||||
Pak.SrcCnt .BS 2
|
Pak.SrcCnt .BS 2
|
||||||
Pak.Cnt .BS 2
|
Pak.Cnt .BS 2
|
||||||
|
Pak.DstCnt .BS 2
|
||||||
Pak.CntL .BS 256
|
Pak.CntL .BS 256
|
||||||
Pak.CntH .BS 256
|
Pak.CntH .BS 256
|
||||||
Pak.Byte .BS 1
|
Pak.Byte .BS 1
|
||||||
Pak.Limit .BS 2
|
Pak.Limit .BS 2
|
||||||
Pak.PipeLen .BS 1
|
Pak.PipeLen .BS 1
|
||||||
Pak.Pipe .BS 18
|
Pak.Pipe .BS PIPELEN
|
||||||
Pak.BitMask .HS 0102040810204080
|
Pak.BitMask .HS 0102040810204080
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
PakHdr .BS S.PAKHDR
|
PakHdr .BS S.PAKHDR
|
||||||
|
111
TEST.S.txt
111
TEST.S.txt
@@ -8,6 +8,7 @@ AUTO 4,1
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.INB /A2OSX.BUILD/INC/MACROS.I
|
.INB /A2OSX.BUILD/INC/MACROS.I
|
||||||
.INB /A2OSX.BUILD/INC/A2OSX.I
|
.INB /A2OSX.BUILD/INC/A2OSX.I
|
||||||
|
.INB /A2OSX.BUILD/INC/LIBPAK.I
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* File Header (16 Bytes)
|
* File Header (16 Bytes)
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@@ -28,6 +29,7 @@ CS.START cld
|
|||||||
.DA CS.RUN
|
.DA CS.RUN
|
||||||
.DA CS.DOEVENT
|
.DA CS.DOEVENT
|
||||||
.DA CS.QUIT
|
.DA CS.QUIT
|
||||||
|
L.LIBPAK .DA LIBPAK
|
||||||
L.FLOAT1 .DA FLOAT1
|
L.FLOAT1 .DA FLOAT1
|
||||||
L.FLOAT2 .DA FLOAT2
|
L.FLOAT2 .DA FLOAT2
|
||||||
L.FLOAT3 .DA FLOAT3
|
L.FLOAT3 .DA FLOAT3
|
||||||
@@ -41,12 +43,78 @@ L.MSG2 .DA MSG2
|
|||||||
L.MSG3 .DA MSG3
|
L.MSG3 .DA MSG3
|
||||||
L.MSG4 .DA MSG4
|
L.MSG4 .DA MSG4
|
||||||
L.MSG5 .DA MSG5
|
L.MSG5 .DA MSG5
|
||||||
|
L.MSG6 .DA MSG6
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.INIT clc
|
CS.INIT >LDYA L.LIBPAK
|
||||||
|
>SYSCALL LoadLib.YA
|
||||||
|
bcs .9
|
||||||
|
sta hLIBPAK
|
||||||
|
|
||||||
|
clc
|
||||||
|
.9 rts
|
||||||
|
*--------------------------------------
|
||||||
|
CS.RUN ldy #S.PS.ARGC
|
||||||
|
lda (pPs),y
|
||||||
|
bne CS.RUN.Pak
|
||||||
|
jmp CS.RUN.Math
|
||||||
|
*--------------------------------------
|
||||||
|
CS.RUN.Pak >PUSHWI 0 Aux type
|
||||||
|
>PUSHBI 0
|
||||||
|
>PUSHBI SYS.FOpen.R
|
||||||
|
|
||||||
|
lda #1
|
||||||
|
>SYSCALL GetArg.A
|
||||||
|
>SYSCALL RealPath.YA
|
||||||
|
>PUSHYA
|
||||||
|
txa
|
||||||
|
>STA.G PAK.hFileName
|
||||||
|
|
||||||
|
>SYSCALL LoadFile
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
>STYA.G PAK.FileSize
|
||||||
|
txa
|
||||||
|
>STA.G PAK.hFileBuf
|
||||||
|
|
||||||
|
>LDYA.G PAK.FileSize
|
||||||
|
>SYSCALL GetMem.YA
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
txa
|
||||||
|
>STA.G PAK.hOutBuf
|
||||||
|
|
||||||
|
>LDA.G PAK.hFileBuf
|
||||||
|
>SYSCALL GetMemPtr.A
|
||||||
|
>PUSHYA
|
||||||
|
|
||||||
|
>PUSHW.G PAK.FileSize
|
||||||
|
|
||||||
|
>LDA.G PAK.hOutBuf
|
||||||
|
>SYSCALL GetMemPtr.A
|
||||||
|
>PUSHYA
|
||||||
|
>PUSHEA.G PAK.Stat
|
||||||
|
|
||||||
|
>LIBCALL hLIBPAK,LIBPAK.Pak
|
||||||
|
bcc .1
|
||||||
|
.9 rts
|
||||||
|
|
||||||
|
.1 >PUSHW.G PAK.Stat+S.PAKSTAT.STORE
|
||||||
|
>PUSHW.G PAK.Stat+S.PAKSTAT.S4
|
||||||
|
>PUSHW.G PAK.Stat+S.PAKSTAT.S3
|
||||||
|
>PUSHW.G PAK.Stat+S.PAKSTAT.REP
|
||||||
|
>PUSHW.G PAK.Stat+S.PAKSTAT.BL
|
||||||
|
>PUSHW.G PAK.Stat+S.PAKSTAT.SIZE
|
||||||
|
>PUSHW.G PAK.FileSize
|
||||||
|
|
||||||
|
>LDYA L.MSG6
|
||||||
|
>SYSCALL PrintF.YA
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN >PUSHEA.G ENDPTR
|
CS.RUN.Math >PUSHEA.G ENDPTR
|
||||||
>PUSHW L.CONST2
|
>PUSHW L.CONST2
|
||||||
>PUSHEA.G MYFLOAT2
|
>PUSHEA.G MYFLOAT2
|
||||||
>SYSCALL StrToF
|
>SYSCALL StrToF
|
||||||
@@ -99,7 +167,6 @@ CS.RUN >PUSHEA.G ENDPTR
|
|||||||
>PUSHEA.G MYFLOAT1
|
>PUSHEA.G MYFLOAT1
|
||||||
>LDYA L.MSG5
|
>LDYA L.MSG5
|
||||||
>SYSCALL PrintF.YA
|
>SYSCALL PrintF.YA
|
||||||
*--------------------------------------
|
|
||||||
lda #0
|
lda #0
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
@@ -107,11 +174,32 @@ CS.RUN >PUSHEA.G ENDPTR
|
|||||||
CS.DOEVENT sec
|
CS.DOEVENT sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.QUIT clc
|
CS.QUIT >LDA.G PAK.hFileName
|
||||||
|
beq .1
|
||||||
|
|
||||||
|
>SYSCALL FreeMem.A
|
||||||
|
|
||||||
|
.1 >LDA.G PAK.hFileBuf
|
||||||
|
beq .2
|
||||||
|
|
||||||
|
>SYSCALL FreeMem.A
|
||||||
|
|
||||||
|
.2 >LDA.G PAK.hOutBuf
|
||||||
|
beq .8
|
||||||
|
|
||||||
|
>SYSCALL FreeMem.A
|
||||||
|
|
||||||
|
.8 lda hLIBPAK
|
||||||
|
>SYSCALL UnloadLib.A
|
||||||
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.END
|
CS.END
|
||||||
MSG1 .AZ "PrintF:%e, %e, %e\r\n%e, %e\r\nStrToF:%e, %e\r\n"
|
LIBPAK .AZ "libpak.o"
|
||||||
|
hLIBPAK .BS 1
|
||||||
|
MSG1 .AS "PrintF:%e, %e, %e\r\n"
|
||||||
|
.AS "%e, %e\r\n"
|
||||||
|
.AZ "StrToF:%e, %e\r\n"
|
||||||
FLOAT1 .HS 9B3EBC1FFD 99,999,999.9
|
FLOAT1 .HS 9B3EBC1FFD 99,999,999.9
|
||||||
FLOAT2 .HS 9E6E6B27FD 999,999,999
|
FLOAT2 .HS 9E6E6B27FD 999,999,999
|
||||||
FLOAT3 .HS 9E6E6B2800 1,000,000,000
|
FLOAT3 .HS 9E6E6B2800 1,000,000,000
|
||||||
@@ -124,6 +212,13 @@ MSG2 .AZ "PI/3=%e\r\n"
|
|||||||
MSG3 .AZ "COS(PI/3)=%e\r\n"
|
MSG3 .AZ "COS(PI/3)=%e\r\n"
|
||||||
MSG4 .AZ "Long=%L\r\n"
|
MSG4 .AZ "Long=%L\r\n"
|
||||||
MSG5 .AZ "Float=%e\r\n"
|
MSG5 .AZ "Float=%e\r\n"
|
||||||
|
MSG6 .AS "Src Length : %D\r\n"
|
||||||
|
.AS "Compressed : %D\r\n"
|
||||||
|
.AS "BL Count : %D\r\n"
|
||||||
|
.AS "REP Count : %D\r\n"
|
||||||
|
.AS "S3 Count : %D\r\n"
|
||||||
|
.AS "S4 Count : %D\r\n"
|
||||||
|
.AZ "STO Count : %D\r\n"
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.DUMMY
|
.DUMMY
|
||||||
.OR 0
|
.OR 0
|
||||||
@@ -133,6 +228,12 @@ MYFLOAT2 .BS 5
|
|||||||
MYFLOAT3 .BS 5
|
MYFLOAT3 .BS 5
|
||||||
MYLONG .BS 4
|
MYLONG .BS 4
|
||||||
ENDPTR .BS 2
|
ENDPTR .BS 2
|
||||||
|
|
||||||
|
PAK.hFileName .BS 1
|
||||||
|
PAK.FileSize .BS 2
|
||||||
|
PAK.hFileBuf .BS 1
|
||||||
|
PAK.hOutBuf .BS 1
|
||||||
|
PAK.Stat .BS S.PAKSTAT
|
||||||
DS.END
|
DS.END
|
||||||
.ED
|
.ED
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
Reference in New Issue
Block a user