Hack64 Wiki
Other Titles
Hack64 Wiki
Other Titles
Below are definitions of some of the notable data structures found in Mission Impossible (N64).
Burp headers describe a series of compressed and/or uncompressed data blocks in ROM. Compressed data blocks are encoded using the DEFLATE algorithm.
struct BurpHeader { char signature[4]; // "Burp" u32 numBlocks; struct BurpBlock blocks[]; };
struct BurpBlock { u32 dstSize; u32 srcSize; u32 unk08; u32 offset; // relative to start of BurpHeader u8 type; // 0x00 if uncompressed, 0x04 if compressed using headerless DEFLATE u8 _pad[3]; // structure padding };
struct Object { /*0x00*/ void *unk00; /*0x04*/ void *unk04; /*0x08*/ u32 unk08; /*0x0C*/ u32 unk0C; /*0x10*/ u8 unk10[2]; /*0x12*/ u16 unk12; /*0x14*/ u16 unk14; /*0x16*/ u16 unk16; /*0x18*/ vec3f position; /*0x24*/ u8 unk24[0x0E]; /*0x32*/ u16 unk16; /*0x34*/ u8 unk34[0x0C]; /*0x40*/ vec3f rotation; /*0x4C*/ s32 timer; // copied from the VI counter /*0x50*/ u8 unk50[2]; /*0x52*/ u16 unk52; // some flags? unsetting bit 5 makes object invisible /*0x54*/ s32 unk54; // maybe an animation counter, but locking it seems to have no effect /*0x58*/ u8 unk58[4]; /*0x5C*/ s32 unk5C; /*0x60*/ struct Object *unk60; /*0x64*/ u8 unk64[4]; /*0x68*/ s16 unk68; /*0x68*/ s16 unk6A; /*0x6C*/ s32 unk6C; /*0x70*/ u8 unk70[8]; /*0x78*/ u16 unk78; /*0x7A*/ u16 unk7A; /*0x7C*/ u8 unk7C[4]; };
/*80086190*/ struct Object *gLevelObjects; /*80093840*/ s16 gNumLevelObjects;
Below is the header struct for level object placement data. When a level is loaded, one of these structs is decompressed from ROM along with ObjectPosRot and ObjectPosArray structs that follow. All pointer members of this struct are initially offsets relative to the beginning of the struct, but the game converts them to virtual addresses in-place.
struct ObjectPlacements { /*0x00*/ s32 numPlacements0; /*0x04*/ struct ObjectPosRot *placements0; /*0x08*/ s32 numPlacements1; /*0x0C*/ struct ObjectPosRot *placements1; /*0x10*/ s32 numPlacements2; /*0x14*/ struct ObjectPosRot *placements2; // unconfirmed type /*0x18*/ s32 numPlacements3; /*0x1C*/ struct ObjectPosArray *placements3[]; };
struct ObjectPosRot { /*0x00*/ u8 unk00[2]; /*0x02*/ vec3s position; /*0x08*/ vec3s rotation; };
struct ObjectPosArray { /*0x00*/ s32 numPositions; /*0x04*/ vec3s positions[]; };
/*0x800A98CC*/ struct ObjectPlacements *gObjectPlacements;
Breakdown of object placement data for the first mission: https://pastebin.com/raw/657rL7jD