Difference between revisions of "YAZ0 (File Format)"

From Custom Mario Kart
Jump to navigation Jump to search
Line 2: Line 2:
  
 
== Data structure ==
 
== Data structure ==
=== Header ===
+
== Header ==
 +
 
 +
The header of a Yaz0 file is always 16 bytes long. All numeric values stored as [[ big endian]] values.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Offset
 +
! Type
 +
! Description
 +
|-
 +
| 0x00 || char[4] || always "Yaz0"
 +
|-
 +
| 0x04 || u32 || size of the umompressed data
 +
|-
 +
| 0x08 || char[16] || always zero (padding)
 +
|}
 +
 
 +
;GNU C example:
 +
<pre>
 +
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;
 +
</pre>
 +
 
 
=== Data Groups ===
 
=== Data Groups ===
  

Revision as of 20:29, 6 April 2011

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