LZSS Compression: Difference between revisions
→Example C Decompression Function: tried to use this function and it didn't work. oops. fixed.
>Aruki (→Structure: I'm a nitpicker) |
>Aruki (→Example C Decompression Function: tried to use this function and it didn't work. oops. fixed.) |
||
(One intermediate revision by the same user not shown) | |||
Line 21: | Line 21: | ||
|- | |- | ||
| 0x4 | | 0x4 | ||
| colspan=2 | Compressed data starts | | colspan=2 {{unknown|Compressed data starts}} | ||
|} | |} | ||
Line 126: | Line 126: | ||
case 1: | case 1: | ||
count = (bytes[0] >> 4) + 3; | count = (bytes[0] >> 4) + 3; | ||
length = (bytes[0] & 0xF) | bytes[1]; | length = ((bytes[0] & 0xF) << 0x8) | bytes[1]; | ||
break; | break; | ||
case 2: | case 2: | ||
count = (bytes[0] >> 4) + 2; | count = (bytes[0] >> 4) + 2; | ||
length = ((bytes[0] & 0xF) | bytes[1]) << 1; | length = (((bytes[0] & 0xF) << 0x8) | bytes[1]) << 1; | ||
break; | break; | ||
case 3: | case 3: | ||
count = (bytes[0] >> 4) + 1; | count = (bytes[0] >> 4) + 1; | ||
length = ((bytes[0] & 0xF) | bytes[1]) << 2; | length = (((bytes[0] & 0xF) << 0x8) | bytes[1]) << 2; | ||
break; | break; | ||
} | } |