Skip to content

Latest commit

 

History

History
 
 

Compress

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Compress


Compression MIPS Code by krom (Peter Lemon).

I have provided examples of LZ77 & Huffman decompression, compatible with the same standards used by
Nintendo GBA/DS bios decompression functions.
The demos decompress image data to RAM, & are copied to VRAM.

The best LZ77/Huffman compressor I have found is called "Nintendo DS/GBA Compressors" by CUE.
You can find it here: http://www.romhacking.net/utilities/826/
It also includes full CPP source code for all of it's compressors.

Here is an url to the best explanation of LZ77/Huffman decompression I have found:
http://nocash.emubase.de/gbatek.htm#biosdecompressionfunctions

P.S The variant of LZ77 on GBA/NDS is sometimes called LZSS hence the naming scheme in this util,
but you will find that it is indeed LZ77 compatible data.

Huffman:
Command line used to compress data: "huffman -e8 Image.bin"
Original data size: Image.bin = 921600 bytes
Compress data size: Image.huff = 200500 bytes

LZ77:
Command line used to compress data: "lzss -ewo Image.bin"
Original data size: Image.bin = 921600 bytes
Compress data size: Image.lz = 137129 bytes

Many thanks to my friend Andy Smith, who helped me understand the Huffman decoding =D