Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zoalasaurusrawr/0c8a1ae2e218d1c76959765bf9e9c408 to your computer and use it in GitHub Desktop.
Save zoalasaurusrawr/0c8a1ae2e218d1c76959765bf9e9c408 to your computer and use it in GitHub Desktop.

Legend of Zelda: Tears of the Kingdom TXTG File Format

Header

Offset Name Length Expected Value Notes
x00 Magic 8 Bytes x50 x00 x11 x00 x36 x50 x4b x30 The last four bytes always contain 6PK0
x08 Width 2 Bytes Variable Most likely width based upon similarly named sprite sizes
x0A Height 2 Bytes Variable Most likely height based upon similarly named sprite sizes
x0c Unknown 1 Byte If the preceding entries are width and height, this may refer to 'Z' as a dimension, such as with 3d textures
x0E Total Files 1 Byte Variable The number of file entries, starting from 0x50
x50 Decompressed File Checksums 8 Bytes * x0E Variable Each int contains the decompressed file size
(x50 + (8 bytes * x0E)) Compressed File Checksums 8 Bytes * x0E * 2 Variable After reading each int, the next int is a control value of unknown purpose, which is commonly equal to 6
Follows Compressed File Checksums ZSTD Stream Start 4 Bytes x28 xb5 x2f xfd ZSTD magic header. The number of ZSTD headers found in the file should be equal to the value of x0E

Notes

  • The format appears to be a forked version of the 6pack format, except using ZSTD to compress entries instead of fastlz
  • Files are Little-Endian (LE) UTF8.
  • 0x54 appears to indicate that the largest block size is 65536
  • Block sizes were observed to run from the largest possible, decreasing by half until the end of the file
  • Decompressed data resembles the ASTC image format, but attempts to take the decoded data and create ASTC files have not been successful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment