Introduction
A .tpl file is a texture file of GameCube and Wii software. It holds
textures together with their palettes, and one file can hold many textures. Other
layouts also use the extension; this page covers the files that start with the bytes
00 20 AF 30.
Structure
The file starts with a 12-byte header:
| Offset | Bytes | Field |
|---|---|---|
| 0 | 4 | signature 00 20 AF 30 |
| 4 | 4 | number of textures |
| 8 | 4 | header size, $0C |
A table follows with 8 bytes for each texture: the offset of its texture header and the offset of its palette header, which is 0 when the texture has no palette.
A texture header holds, in order, the height and the width (2 bytes each), the format code and the offset of the image data (4 bytes each), settings for wrapping, filtering and level-of-detail bias (4 bytes each), and four single bytes: edge level of detail, minimum and maximum level of detail, and a field named unpacked. A palette header holds the number of entries (2 bytes), an unpacked byte, a padding byte, the palette format and the offset of the palette data (4 bytes each).
| Code | Texture format |
|---|---|
| 0, 1 | I4 and I8: intensity |
| 2, 3 | IA4 and IA8: intensity with alpha |
| 4 | RGB565 |
| 5 | RGB5A3 |
| 6 | RGBA8 |
| 8, 9, 10 | CI4, CI8 and CI14X2: palette indices |
| 14 | CMP: S3TC block compression |
Palette format 0 is IA8, 1 is RGB565 and 2 is RGB5A3. The image data is arranged in small tiles whose size depends on the format.
Not described
Known, not yet covered
- Reference: the byte layout of each texture format, the tile order, the values of the sampling fields and the other layouts that use the extension are not yet described.
- Viewer: the site has no viewer for TPL textures.
Links
Reference
- Yet Another Gamecube Documentation, chapter 15 – GameCube file formats, with the TPL headers and format codes
- gvrtex – notes of a texture library on TPL and the related GVR files