Hack64 Wiki
Other Titles
Hack64 Wiki
Other Titles
This is an old revision of the document!
The table at 0x000783F4 in ROM (0x800D01A4 in RAM) references data for each stage in the game. For each stage there is an array of area structs. Each array is terminated with an empty struct.
struct StageArea { /*0x00*/ u32 liGeoBlockA; // List-index of primary Geometry Block /*0x04*/ u32 liGeoBlockB; // List-index of secondary Geometry Block /*0x08*/ u16 skyboxId; // Skybox ID /*0x0A*/ u16 background color; // BG color (loaded from color table at 800D478C) /*0x0C*/ int musicId; // Music ID /*0x10*/ u32 biAreaSetup; // Bank-index of area stup block /*0x14*/ u16 Death Camera; // Determines how far the camera follows kirby when falling into void/death /*0x16*/ u16 unk16; // Cutscene related? /*0x18*/ u32 biDustSettings; // Bank-index of Dust particle settings /*0x1C*/ u32 biDustImg; // Bank-index of Dust particle image /*0x20*/ char *areaName; // Pointer to developer ASCII level name };
Area setup blocks define the camera settings, collisions, and object placements for areas. The high level structure is as follows (in order):
struct AreaSettingsHeader { /*0x00*/ u32 offsUnkown2; // relative offset of UNKNOWN2 section /*0x04*/ u32 offsHeader2; // relative offset of HEADER2 section /*0x08*/ u32 offsObjects; // relative offset of OBJECTS section };
Collision and camera related.
This section defines how objects are placed in an area. It contains an array of the following struct:
struct ObjectPlacement // 0x2C bytes each { /*0x00*/ u8 unk00; /*0x01*/ u8 unk01; /*0x02*/ u8 objectId; /*0x04*/ u8 unk04; /*0x05*/ u8 unk05; /*0x06*/ u16 unk06; /*....*/ /*0x20*/ f32 scale; /*0x24*/ xPos; /*....*/ };
There is a 4-byte end marker (0x99999999) at the end of the array. The function at 0x800FC9C0 is used to spawn objects when Kirby is within range.