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

From Custom Mario Kart
Jump to navigation Jump to search
Line 9: Line 9:
 
* If the first 3 bytes are {{code|0x5d 0x00 0x00}}, then this is LZMA compression.
 
* If the first 3 bytes are {{code|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.
 
* 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 [https://ct.wiimm.de/stat/track-size 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.
 
[[Wiimms SZS Tools]] since v2.42a will support the new file formats.

Revision as of 15:06, 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 only supports YLZ.

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 header

???