YBZ & YLZ (File Formats)

From Custom Mario Kart
Revision as of 10:56, 10 March 2024 by Wiimm (talk | contribs)
Jump to navigation Jump to search

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.

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

File header

???