mirror of
https://github.com/emmanuel-marty/lzsa.git
synced 2025-02-16 17:30:44 +00:00
Make 6809 depacker for LZSA1 smaller/faster
This commit is contained in:
parent
3ce9a2b36e
commit
1d0427ecae
@ -1,4 +1,4 @@
|
|||||||
; unlzsa1.s - 6809 decompression routine for raw LZSA1 - 125 bytes
|
; unlzsa1.s - 6809 decompression routine for raw LZSA1 - 121 bytes
|
||||||
; compress with lzsa -r <original_file> <compressed_file>
|
; compress with lzsa -r <original_file> <compressed_file>
|
||||||
;
|
;
|
||||||
; in: x = start of compressed data
|
; in: x = start of compressed data
|
||||||
@ -40,11 +40,11 @@ lz1token ldb ,x+ ; load next token into B: O|LLL|MMMM
|
|||||||
|
|
||||||
ldb ,x+ ; load low 8 bits of little-endian literals count
|
ldb ,x+ ; load low 8 bits of little-endian literals count
|
||||||
lda ,x+ ; load high 8 bits of literal count
|
lda ,x+ ; load high 8 bits of literal count
|
||||||
jmp lz1gotlt ; we now have the complete count, go copy
|
bra lz1gotlt ; we now have the complete count, go copy
|
||||||
|
|
||||||
lz1midlt tfr b,a ; copy high part of literals count into A
|
lz1midlt tfr b,a ; copy high part of literals count into A
|
||||||
ldb ,x+ ; load low 8 bits of literals count
|
ldb ,x+ ; load low 8 bits of literals count
|
||||||
jmp lz1gotlt ; we now have the complete count, go copy
|
bra lz1gotlt ; we now have the complete count, go copy
|
||||||
|
|
||||||
lz1declt lsrb ; shift literals count into place
|
lz1declt lsrb ; shift literals count into place
|
||||||
lsrb
|
lsrb
|
||||||
@ -67,7 +67,7 @@ lz1nolt puls b ; restore token
|
|||||||
|
|
||||||
ldb ,x+ ; O clear: load 8 bit (negative, signed) offset
|
ldb ,x+ ; O clear: load 8 bit (negative, signed) offset
|
||||||
lda #$ff ; set high 8 bits
|
lda #$ff ; set high 8 bits
|
||||||
jmp lz1gotof
|
bra lz1gotof
|
||||||
|
|
||||||
lz1bigof ldb ,x+ ; O set: load long 16 bit (negative, signed) offset
|
lz1bigof ldb ,x+ ; O set: load long 16 bit (negative, signed) offset
|
||||||
lda ,x+ ; (little endian)
|
lda ,x+ ; (little endian)
|
||||||
@ -106,4 +106,4 @@ lz1cpymt lda ,u+ ; copy matched byte
|
|||||||
bne lz1cpymt ; loop until all matched bytes are copied
|
bne lz1cpymt ; loop until all matched bytes are copied
|
||||||
|
|
||||||
puls x ; restore source compressed data pointer
|
puls x ; restore source compressed data pointer
|
||||||
jmp lz1token ; go decode next token
|
bra lz1token ; go decode next token
|
||||||
|
Loading…
x
Reference in New Issue
Block a user