Difference between revisions of "YBZ & YLZ (File Formats)"

From Custom Mario Kart
Jump to navigation Jump to search
 
Line 5: Line 5:
 
Both file formats were developed by [[Wiimm]]. The idea of them is that Mario Kart Wii can handle them normally because of the [[Yaz0]] header. The type of compression must only be recognized during decoding. Therefore, only the {{code|decodeSZS()}} function needs to be overloaded and, if necessary, an alternative decoding method needs to be used.  
 
Both file formats were developed by [[Wiimm]]. The idea of them is that Mario Kart Wii can handle them normally because of the [[Yaz0]] header. The type of compression must only be recognized during decoding. Therefore, only the {{code|decodeSZS()}} function needs to be overloaded and, if necessary, an alternative decoding method needs to be used.  
  
[[LE-CODE]] only supports YLZ as replacement for all Yaz0 files. This includes all SZS files of directories {{code|./Race/Course/}} and {{code|./Scene/UI/}}.
+
[[LE-CODE]] as of build 41 supports file format YLZ as replacement for all Yaz0 files. This includes all SZS files of directories {{code|./Race/Course/}} and {{code|./Scene/UI/}}. File format YBZ is not supported.
  
 
The distinction between the three methods of compression is based on the first bytes of the compressed data.
 
The distinction between the three methods of compression is based on the first bytes of the compressed data.

Latest revision as of 16:29, 10 March 2024

YBZ and YLZ are alternative file formats. They use the Yaz0 header, but bzip2 and LZMA for compression.

Introduction

Both file formats were developed by Wiimm. The idea of them is that Mario Kart Wii can handle them normally because of the Yaz0 header. The type of compression must only be recognized during decoding. Therefore, only the decodeSZS() function needs to be overloaded and, if necessary, an alternative decoding method needs to be used.

LE-CODE as of build 41 supports file format YLZ as replacement for all Yaz0 files. This includes all SZS files of directories ./Race/Course/ and ./Scene/UI/. File format YBZ is not supported.

The distinction between the three methods of compression is based on the first bytes of the compressed data.

  • If the first 3 bytes are BZh (0x42 0x5a 0x68), then it is bzip2 compression.
  • If the first 3 bytes are 0x5d 0x00 0x00, then this is LZMA compression.
  • Otherwise it is Yaz0 compression. This is always clear because bit 0x80 is always set in the first byte in the Yaz0 compression, but not in the other two compression methods.

As these statistics show, YLZ saves more than 39% storage space compared to the classic YAZ0. WLZ files are a little smaller, but require significantly more effort to decompress. In addition, the file auto-add.arc with 18.7 MB is required.

Wiimms SZS Tools since v2.42a will support the new file formats.

File Format

Offset Type Description
0x00 u32 The magic of a YAZ0 file: "Yaz0" = 0x59617a30
0x04 u32 The size in bytes of the decompressed data. Same as YAZ0.
0x08 u32 The size in bytes of the compressed data beginning at offset 0x10. This information is not absolutely necessary, but can be helpful when decoding.
0x0c 4 bytes Copy of the first 4 bytes of the decompressed data, usually the magic of the decompressed data.
0x10 * bzip2 or LZMA compressed data.