GHT (File Format)

(Redirected from GHT)

This page describes the .ght format, as found in Filesystem/StaffGhosts. .ght is used for staff ghost files.

File Format

This file format is identical to the inputs portion of ghost .gci files.

Header
Offset Format Description
0x00 UInt8 Character 1 ID
0x01 UInt8 Character 2 ID
0x02 UInt8 Kart ID
0x03 UInt8 Course ID
0x04 4 byte String 3 letter tag + 1 byte padding
0x08 UInt32 Total time (in milliseconds)
0x0C UInt32 Total inputs
0x10 UInt32 Lap 1 split (in milliseconds)
0x14 UInt32 Lap 2 split (in milliseconds) (if applicable, otherwise 0x5b8d7f)
0x18 UInt32 Lap 3 split (in milliseconds) (if applicable, otherwise 0x5b8d7f)
0x1c UInt32 Lap 4 split (in milliseconds) (if applicable, otherwise 0x5b8d7f)
0x20 UInt32 Lap 5 split (in milliseconds) (if applicable, otherwise 0x5b8d7f)
0x24 UInt32 Lap 6 split (in milliseconds) (if applicable, otherwise 0x5b8d7f)
0x26 InputData[totalinputs] Input array
Input data structure
Offset Size Description
0x00 3 bits Analog stick Y Axis
0x00.3 5 bits Analog stick X axis
0x1 1 byte Face button inputs

The stick position is stored as a 5-bit value for the X-axis position and a 3-bit value for the Y-axis position. The X position is stored in the high 5 bits of the byte and the Y position in the low 3 bits. Both values are stored as two's complement integers, with positive numbers representing movement right or up and negative representing movement left or down.

Stick Position
Position Values
Up (weak to strong) 0x1 - 0x3 (1 to 3 decimal)
Down (weak to strong) 0x7 - 0x5 (-1 to -3 decimal)
Left (weak to strong) 0x1E - 0x10 (-1 to -15 decimal)
Right (weak to strong) 0x01 - 0x0F (1 to 15 decimal)

The button values are represented by an array of bits, which are combined into one byte value. A 1 in a position means that the button corresponding to that position is pressed.

Button to Position Table
Start Z R L Y X B A


Tools

References