Page 1 of 1

APack decompression for Z80!

Posted: Thu 06 Jan, 2005 7:20 am
by Dwedit
I've just ported the APack decompressor to Z80. The size of the decompressor is exactly 250 bytes large (about half the size of pucrunch decompressor), and the compression rates provided by APack are often better than Pucrunch!

For example, the game plus chapters of The Verdante Forest are about 70k in size. Apack gets it down to 41.3k, and Pucrunch gets it down to 40.7k. So pucrunch wins in one case, but...

Other games (like Joltima and Dying Eyes) favor Apack over pucrunch. Dying eyes gets 500 bytes smaller if compressed with Apack instead of Pucrunch, while Joltima gets 250 bytes smaller.

Here's a sample program that merely draws a picture, but it also includes the full decompression code and compression tool.
http://home.comcast.net/~alanweiss3/dwe ... k_demo.zip

Posted: Thu 06 Jan, 2005 8:06 am
by tr1p1ea
Wow, nice work DWedit, this might come in handy :).

Posted: Thu 06 Jan, 2005 9:31 am
by Duck
Have you tested it on uncompressed highly-redundant levelsets yet? I'm wondering if it could be used as a RLE replacement...

Posted: Thu 06 Jan, 2005 10:02 am
by Kozak
Will you be implementing this in COS or is it for individual programmers? A method which get's TVF down by 30k is 8) .

Posted: Thu 06 Jan, 2005 10:17 pm
by Madskillz
Wow nice Dwedit! I can certainly use this! :D

Posted: Tue 11 Jan, 2005 10:16 pm
by Kerey
Cool. Can APack be used to decompress arbitrary offsets in the bitstream, (ie: like my on-the-fly Huffman routines) or is it adaptive? I couldn't find any papers on the algorithm and don't feel like reading code at the moment.

Posted: Tue 11 Jan, 2005 11:59 pm
by Dwedit
It's LZ based, and it works by storing references to data that has occurred previously in the file.

While decompressing, the entire output file must be intact up to the current decompression pointer.

You can also overlap the input file with the output file, just as long as the output is written before the input, and the output never overwrites the current input file position. I used that on the GBA to run big roms in pocketnes.

Apack uses some crazy hybrid of a bit stream, and byte aligned data. It makes reading bytes faster, since they are always aligned.

From what I see, an uncompressed byte that has not occurred within 15 bytes back is encoded with 9 bits, while an uncompressed byte that has appeared within 15 bytes back is encoded with 7 bits. This is exculding all the LZ compression stuff it also does.

Re: APack decompression for Z80!

Posted: Fri 15 May, 2009 12:49 pm
by darkstone knight
sorry for the necropost :excited: , but the site is down... and i cant seem to find the program on ticalc or google

i may use this to compress supaplex levels (RLE compresses by about 62% (21 possible tiles), i need 80...)

Re: APack decompression for Z80!

Posted: Fri 15 May, 2009 5:33 pm
by benryves

Re: APack decompression for Z80!

Posted: Sat 16 May, 2009 10:27 am
by Dwedit
Now rehosted on my domain:
http://www.dwedit.org/files/apack_demo.zip

Also attached here too.