libnds
|
Wraps the bios decompress functionality into something a bit easier to use. More...
Enumerations | |
enum | DecompressType { LZ77 , LZ77Vram , HUFF , RLE , RLEVram } |
The types of decompression available. More... | |
Functions | |
void | decompress (const void *data, void *dst, DecompressType type) |
Decompresses data using the suported type. More... | |
void | decompressStream (const void *data, void *dst, DecompressType type, getByteCallback readCB, getHeaderCallback getHeaderCB) |
Decompresses data using the suported type. More... | |
void | decompressStreamStruct (const void *data, void *dst, DecompressType type, void *param, TDecompressionStream *ds) |
Decompresses data using the suported type. More... | |
Wraps the bios decompress functionality into something a bit easier to use.
enum DecompressType |
void decompress | ( | const void * | data, |
void * | dst, | ||
DecompressType | type | ||
) |
Decompresses data using the suported type.
When 'type' is HUFF, this function will allocate 512 bytes in the stack as a temporary buffer.
dst | Destination to decompress to. |
data | Data to decompress. |
type | Type of data to decompress. |
void decompressStream | ( | const void * | data, |
void * | dst, | ||
DecompressType | type, | ||
getByteCallback | readCB, | ||
getHeaderCallback | getHeaderCB | ||
) |
Decompresses data using the suported type.
Only LZ77Vram, HUFF and RLEVram support streaming, but HUFF isn't supported by this function at all, use decompressStreamStruct() instead.
dst | Destination to decompress to. |
data | Data to decompress. |
type | Type of data to decompress. |
readCB | A callback to read the next byte of data. |
getHeaderCB | A callback to read the 32 byte header. |
void decompressStreamStruct | ( | const void * | data, |
void * | dst, | ||
DecompressType | type, | ||
void * | param, | ||
TDecompressionStream * | ds | ||
) |
Decompresses data using the suported type.
Only LZ77Vram, HUFF and RLEVram support streaming.
For HUFF, make sure to pass a 512 byte buffer in 'param' to be used as a temporary buffer by the decompression code.
dst | Destination to decompress to. |
data | Data to decompress. |
type | Type of data to decompress. |
param | A value to be passed to getHeaderCallback(), or a temporary buffer for HUFF. |
ds | A struct with callbacks to be used by the decompression routine. |