Skip to content

Commit

Permalink
Added unpack function to exomiser
Browse files Browse the repository at this point in the history
  • Loading branch information
simondotm committed Jul 6, 2016
1 parent 2631177 commit 48f9cae
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/exomiser.h.6502
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
\\ Plus ZP vars
\\ Exomiser decruncher routine installs empty NMI handler at &0d00

\\ Compress data using:
\\ exomizer.exe raw -c -m 1024 <file.raw> -o <file.exo>

\ ******************************************************************
\ * Space reserved for runtime buffers not preinitialised
Expand Down
21 changes: 21 additions & 0 deletions lib/exomiser.s.6502
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@

.exo_start

; -------------------------------------------------------------------
; Unpack a compressed data stream previously initialized by exo_init_decruncher
; to the memory address specified in X,Y
.exo_unpack
{
STX write_chr+1
STY write_chr+2

.next_chr
JSR exo_get_decrunched_byte
BCS all_done
.write_chr STA &ffff ; **SELF-MODIFIED**
INC write_chr+1
BNE next_chr
INC write_chr+2
BNE next_chr
.all_done
RTS
}

; -------------------------------------------------------------------
; Fetch byte from an exomiser compressed data stream
; for this exo_get_crunched_byte routine to work the crunched data has to be
Expand Down Expand Up @@ -37,6 +57,7 @@ EXO_crunch_byte_hi = exo_get_crunched_byte + 10
; zero page locations and the decrunch tables
; no constraints on register content, however the
; decimal flag has to be #0 (it almost always is, otherwise do a cld)
; X/Y contains address of EXO crunched data stream
; -------------------------------------------------------------------
.exo_init_decruncher ; pass in address of (crunched data-1) in X,Y
{
Expand Down

0 comments on commit 48f9cae

Please sign in to comment.