This shows you the differences between two versions of the page.
— |
yoshis_story:level_data [2019/10/04 17:10] (current) shygoo created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Level Data ====== | ||
+ | The main level list is at 0x000A84A0 in ROM as an array of 177 "LevelEntry" structs. | ||
+ | ===== LevelEntry struct ===== | ||
+ | This struct simply points to a LevelInfo struct. | ||
+ | <code C> | ||
+ | struct LevelEntry | ||
+ | { | ||
+ | /*00*/ u32 unk00; | ||
+ | /*04*/ u32 boLevelInfo; // bank-offset of LevelInfo struct | ||
+ | }; | ||
+ | </code> | ||
+ | |||
+ | ===== LevelInfo struct ===== | ||
+ | This struct contains a pointer to an ObjectPlacementListInfo struct. The rest of the data hasn't been studied yet. | ||
+ | <code C> | ||
+ | struct LevelInfo | ||
+ | { | ||
+ | /*00*/ u8 unk00[8]; | ||
+ | /*08*/ f32 unk08; | ||
+ | /*0C*/ u8 unk0C[24]; | ||
+ | /*24*/ void *unk24; | ||
+ | /*28*/ u8 unk28[4]; | ||
+ | /*2C*/ f32 unk2C; | ||
+ | /*30*/ f32 unk30; | ||
+ | /*34*/ u8 unk34[4]; | ||
+ | /*38*/ f32 unk38; | ||
+ | /*3C*/ f32 unk3C; | ||
+ | /*40*/ u8 unk40[4]; | ||
+ | /*44*/ f32 unk44; | ||
+ | /*48*/ f32 unk48; | ||
+ | /*4C*/ f32 unk4C; | ||
+ | /*50*/ u8 unk50[4]; | ||
+ | /*54*/ f32 unk54; | ||
+ | /*58*/ u8 unk58[4]; | ||
+ | /*5C*/ u32 boObjectPlacementListInfoPtr; // bank-offset of bank-offset of ObjectPlacementListInfo | ||
+ | /*60*/ u16 unk60[0x98]; // seems to be a list of objectId's to preload? terminated by 0xFFFF? unknown size | ||
+ | /*F8*/ u8 unkF8[28]; | ||
+ | }; | ||
+ | </code> | ||
+ | |||
+ | ===== ObjectPlacementListInfo struct ===== | ||
+ | This struct simply references an array of ObjectPlacement structs. | ||
+ | <code C> | ||
+ | struct ObjectPlacementListInfo | ||
+ | { | ||
+ | /*00*/ u16 numObjects; // number of ObjectPlacement structs in the array | ||
+ | /*02*/ u16 unk02; // probably padding | ||
+ | /*04*/ u32 boObjectPlacements; // bank-offset of ObjectPlacement array | ||
+ | }; | ||
+ | </code> | ||
+ | |||
+ | ===== ObjectPlacement struct ===== | ||
+ | This struct contains the object ID, tag(?), and position of an object to be placed in a level. | ||
+ | <code C> | ||
+ | struct ObjectPlacement | ||
+ | { | ||
+ | u16 objectId; // object ID | ||
+ | u16 tag; // purpose seems to depend on the type of object | ||
+ | f32 x; // x coordinate in level | ||
+ | f32 y; // y coordinate in level | ||
+ | }; | ||
+ | </code> |