THP (File Format)

From Custom Mario Kart
Revision as of 18:59, 7 August 2016 by Wexos (talk | contribs) (Created page with basic info)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Under Construction
This article is not finished. Help improve it by adding accurate information or correcting grammar and spelling.

THP files are video files used in many Wii games.

File Format

Header

Offset Type Description
0x00 String File magic
0x04 UInt32 Version number. Mario Kart Wii uses 0x11000
0x08 UInt32 Max buffer size
0x0C UInt32 Max audio samples
0x10 Float Frames per second
0x14 UInt32 Number of frames in this file
0x18 UInt32 Length of the first frame
0x1C UInt32 Length of all frames
0x20 UInt32 Offset to components
0x24 UInt32 OffsetsDataOffset. Unknown meaning
0x28 UInt32 First frame offset
0x2C UInt32 Last frame offset

Component structure

Offset Type Description
0x00 UInt32 Number of components
0x04 SByte[16] Component types (0 = video, 1 = audio, -1 = none)

Video

Offset Type Description
0x00 UInt32 Width
0x04 UInt32 Height
0x08 UInt32 Video format (only used in version 0x11000)

Audio

Offset Type Description
0x00 UInt32 A = Number of audio channels
0x04 UInt32 Frequentie
0x08 UInt32 Number of samples
0x0C UInt32 Number of datas (only used in version 0x11000)

Frame

A frame start with a frame header.

Offset Type Description
0x00 UInt32 Next total size
0x04 UInt32 Previous total size
0x08 UInt32 D = Image size
0x0C UInt32 Audio size (only exist if the frame contains audio)
0x0C or 0x10 Image data

Video

Offset Type Description
0x00 Byte[D] Image data
D End of image data

Audio

Offset Type Description
0x00 UInt32 C = Channel size
0x04 UInt32 Number of samples
0x08 Int16[16] Table 1
0x28 Int16[16] Table 2
0x48 Int16 Channel 1 previous 1
0x4A Int16 Channel 1 previous 2
0x4C Int16 Channel 2 previous 1
0x50 Int16 Channel 2 previous 2
0x52 Audio Data
Offset Type Description
0x00 Byte[D * A] Audio data
D * A End of audio data

Tools

The following tools can handle THP files:

  • (none)