YAZ0 (File Format)

From Custom Mario Kart
Revision as of 20:29, 6 April 2011 by Wiimm (talk | contribs) (→‎Header)
Jump to navigation Jump to search

Yaz0 is a run length encoding (RLE compression) method. In Mario Kart Wii most of the SZS files are Yaz0 compressed U8 files.

Data structure

Header

The header of a Yaz0 file is always 16 bytes long. All numeric values stored as big endian values.

Offset Type Description
0x00 char[4] always "Yaz0"
0x04 u32 size of the umompressed data
0x08 char[16] always zero (padding)
GNU C example
typedef struct yaz0_header_t
{
    char	magic[4];		// always "Yaz0"
    be32_t	uncompressed_size;	// total size of uncompressed data
    char	padding[8];		// always 0?
}
__attribute__ ((packed)) yaz0_header_t;

Data Groups

Examples

Decompression

Compression