LZSS Compression: Difference between revisions

m
consistency
>Aruki
No edit summary
>Aruki
m (consistency)
Line 83: Line 83:
== Example C Decompression Function ==
== Example C Decompression Function ==


<syntaxhighlight lang="c" line start="1">bool DecompressLZSS(char *src, unsigned long src_len, char *dst, unsigned long dst_len)
<syntaxhighlight lang="c" line start="1">bool DecompressLZSS(u8 *src, u32 src_len, u8 *dst, u32 dst_len)
{
{
     char *src_end = src + src_len;
     u8 *src_end = src + src_len;
     char *dst_end = dst + dst_len;
     u8 *dst_end = dst + dst_len;


     // Read compressed buffer header
     // Read compressed buffer header
Line 139: Line 139:


             // With the count and length calculated, we'll set a pointer to where we want to read back data from:
             // With the count and length calculated, we'll set a pointer to where we want to read back data from:
             char *seek = dst - length;
             u8 *seek = dst - length;


             // count refers to how many byte groups to read back; the size of one byte group varies depending on mode
             // count refers to how many byte groups to read back; the size of one byte group varies depending on mode
Anonymous user