This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
kirby64_the_crystal_shards:levels [2020/01/20 23:45] jesusyoshi54 [Levels] |
kirby64_the_crystal_shards:levels [2020/09/11 18:39] jesusyoshi54 [Levels] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Levels ====== | ====== Levels ====== | ||
Each level loads a struct of areas using function 0x800F78E4. | Each level loads a struct of areas using function 0x800F78E4. | ||
- | I uses this structure to find the pointer to the current area in the main stage table. | + | The game uses this structure to find the pointer to the current area in the main stage table. Its located at 0x800be500. |
+ | |||
+ | Note: when used to select levels its bytes, but its stored in ram as words. | ||
<code C> | <code C> | ||
- | Level struct (800be500): | + | struct Level |
{ | { | ||
- | /*0X0*/ U32 WORLD | + | /*0X0*/ u8 World; |
- | /*0X4*/ U32 LEVEL | + | /*0X1*/ u8 Level; |
- | /*0X8*/ U32 AREA | + | /*0X2*/ u8 Area; |
- | /*0XC*/ U32 WARP/DIRECTION | + | /*0X3*/ u8 NodeNum; |
+ | }; | ||
+ | </code> | ||
+ | The pointer to the main stage table is gotten by using this formula: | ||
- | } | + | WORLD*48+LEVEL*4 loaded from offset 0x800d1f98(table of ptrs) |
- | </code> | + | |
+ | Each Area is then just an additional 0x24 from that level pointer. | ||
---- | ---- | ||
===== Level List ===== | ===== Level List ===== | ||
Line 36: | Line 42: | ||
---- | ---- | ||
- | ===== Area Setup Blocks ===== | ||
- | Area setup blocks define the camera settings, collisions, and object placements for areas. The high level structure is as follows (in order): | + | ===== Level List Locations ===== |
+ | These are the locations of each level in RAM and ROM. Each area in these levels goes in sequential order. Meaning to get to Level 1-1 Area 2 you need to add 0x24 to 0x800d01a4. | ||
- | - HEADER | + | The Table that has these locations is located at 0x7A1E8 in the ROM and 0x800d1f98 in RAM |
- | - UNKNOWN1 | + | == LEVEL LOCATION TABLE== |
- | - UNKNOWN2 | + | ^Stage^RAM Address^ROM Address^ |
- | - HEADER2 | + | | 1-1 | 0x800D01A4 | 0x783F4 | |
- | - OBJECTS | + | | 1-2 | 0x800D027C | 0x784CC | |
- | + | | 1-3 | 0x800D039C | 0x785EC | | |
- | ==== HEADER ==== | + | | 1-4 | 0x800D0528 | 0x78778 | |
- | + | | 2-1 | 0x800D0570 | 0x787C0 | | |
- | <code C> | + | | 2-2 | 0x800D066C | 0x788BC | |
- | struct AreaSettingsHeader | + | | 2-3 | 0x800D078C | 0x789DC | |
- | { | + | | 2-4 | 0x800D08F4 | 0x78B44 | |
- | /*0x00*/ u32 offsUnkown2; // relative offset of UNKNOWN2 section | + | | 2-5 | 0x800D0A5C | 0x78CAC | |
- | /*0x04*/ u32 offsHeader2; // relative offset of HEADER2 section | + | | 3-1 | 0x800D0AA4 | 0x78CF4 | |
- | /*0x08*/ u32 offsObjects; // relative offset of OBJECTS section | + | | 3-2 | 0x800D0BC4 | 0x78E14 | |
- | }; | + | | 3-3 | 0x800D0CE4 | 0x78F34 | |
- | </code> | + | | 3-4 | 0x800D0E28 | 0x79078 | |
- | + | | 3-5 | 0x800D0F48 | 0x79198 | | |
- | ==== UNKNOWN1 ==== | + | | 4-1 | 0x800D0F90 | 0x791E0 | |
- | + | | 4-2 | 0x800D10B0 | 0x79300 | | |
- | ==== UNKNOWN2 ==== | + | | 4-3 | 0x800D11F4 | 0x79444 | |
- | + | | 4-4 | 0x800D12F0 | 0x79540 | | |
- | ==== HEADER2 ==== | + | | 4-5 | 0x800D1434 | 0x79684 | |
- | Collision and camera related. | + | | 5-1 | 0x800D147C | 0x796CC | |
- | + | | 5-2 | 0x800D159C | 0x797EC | | |
- | ==== OBJECTS ==== | + | | 5-3 | 0x800D16BC | 0x7990C | |
- | This section defines how objects are placed in an area. It contains an array of the following struct: | + | | 5-4 | 0x800D1824 | 0x79A74 | |
- | + | | 5-5 | 0x800D1968 | 0x79BB8 | | |
- | <code C> | + | | 6-1 | 0x800D19B0 | 0x79C00 | |
- | struct ObjectPlacement // 0x2C bytes each | + | | 6-2 | 0x800D1A64 | 0x79CB4 | |
- | { | + | | 6-3 | 0x800D1B84 | 0x79DD4 | |
- | /*0x00*/ u8 unk00; | + | | 6-4 | 0x800D1D58 | 0x79FA8 | |
- | /*0x01*/ u8 unk01; | + | | 7-1 | 0x800D1DA0 | 0x79FF0 | |
- | /*0x02*/ u8 objectId; | + | | 7-2 | 0x800D1E30 | 0x7A080 | |
- | /*0x04*/ u8 unk04; | + | | 7-3 | 0x800D1E9C | 0x7A0EC | |
- | /*0x05*/ u8 unk05; | + | | 7-4 | 0x800D1EE4 | 0x7A134 | |
- | /*0x06*/ u16 unk06; | + | |
- | /*....*/ | + | |
- | /*0x20*/ f32 scale; | + | |
- | /*0x24*/ xPos; | + | |
- | /*....*/ | + | |
- | }; | + | |
- | </code> | + | |
- | + | ||
- | 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. | + | |
- | + | ||
- | ---- | + | |
===== See also ===== | ===== See also ===== | ||
* [[kirby64_the_crystal_shards:file_systems]]] | * [[kirby64_the_crystal_shards:file_systems]]] | ||
* [[kirby64_the_crystal_shards:geometry_blocks]]] | * [[kirby64_the_crystal_shards:geometry_blocks]]] | ||