This shows you the differences between two versions of the page.
| — |
yoshis_story:smsr00_compression [2019/10/04 17:12] (current) shygoo created |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== SMSR00 Compression ====== | ||
| + | Yoshi's Story uses an LZ77-type compression format called SMSR00 which is very similar to SM64's MIO0 format. In the Yoshi's Story ROM, each SMSR00 block is preceded by a 16-byte 'CMPR' header which contains the size of the encoded block and its destination size. | ||
| + | ===== CMPRHeader struct ===== | ||
| + | <code C> | ||
| + | struct CMPRHeader | ||
| + | { | ||
| + | /*00*/ char cmprSignature[4]; // 'CMPR' | ||
| + | /*04*/ u32 srcSize; // size of encoded data | ||
| + | /*08*/ u32 dstSize; // size of decoded data | ||
| + | /*0C*/ u8 _pad[4]; // structure padding | ||
| + | }; | ||
| + | </code> | ||
| + | |||
| + | ===== SMSRHeader struct ===== | ||
| + | <code C> | ||
| + | struct SMSRHeader | ||
| + | { | ||
| + | /*00*/ char smsrSignature[6]; // 'SMSR00' | ||
| + | /*06*/ u8 _pad[2]; // structure padding | ||
| + | /*08*/ u32 outputSize; // size of decoded data | ||
| + | /*0C*/ u32 dataOffset; // offset of the data section in the smsr00 block | ||
| + | }; | ||
| + | </code> | ||
| + | |||
| + | ===== Decoder implementations ===== | ||
| + | * C: https://raw.githubusercontent.com/shygoo/ys-project/master/tools/src/smsr00.c | ||
| + | * JS: https://raw.githubusercontent.com/shygoo/ys-project/master/webtools/smsr00.js | ||