User Tools

Site Tools


kirby64_the_crystal_shards:levels

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
kirby64_the_crystal_shards:levels [2020/01/20 23:47]
jesusyoshi54 [Levels]
kirby64_the_crystal_shards:levels [2021/01/08 00:42] (current)
someone2639 [Level List] updated struct and added a list of defines
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.
-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>​ </​code>​
 The pointer to the main stage table is gotten by using this formula: The pointer to the main stage table is gotten by using this formula:
 +
 WORLD*48+LEVEL*4 loaded from offset 0x800d1f98(table of ptrs) WORLD*48+LEVEL*4 loaded from offset 0x800d1f98(table of ptrs)
 +
 Each Area is then just an additional 0x24 from that level pointer. Each Area is then just an additional 0x24 from that level pointer.
 ---- ----
Line 30: Line 34:
   /*0x10*/ u32   ​biAreaSetup; ​     // Bank-index of area stup block    /*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   /*0x14*/ u16   Death Camera; ​    // Determines how far the camera follows kirby when falling into void/death
-  /*0x16*/ u16   unk16           // Cutscene related?+  /*0x16*/ u16   levelType       // See the next table
   /*0x18*/ u32   ​biDustSettings; ​  // Bank-index of Dust particle settings   /*0x18*/ u32   ​biDustSettings; ​  // Bank-index of Dust particle settings
   /*0x1C*/ u32   ​biDustImg; ​       // Bank-index of Dust particle image   /*0x1C*/ u32   ​biDustImg; ​       // Bank-index of Dust particle image
Line 37: Line 41:
 </​code>​ </​code>​
  
----- +The `levelType` field can be one of these values: 
-===== Area Setup Blocks =====+^Value ​      ^ Description ​         ^ 
 +|  0  | "​Normal"​ gameplay | 
 +|  1  | DDD/​Adeleine Boss (1-2-6,1-3-9) | 
 +|  2  | End of World Boss | 
 +|  3  | End of stage (carpet with prizes) | 
 +|  4  | Ride water on log/Log Flume(3-2-4) | 
 +|  5  | Ride sled(5-1-3) | 
 +|  6  | Minecart stage (4-2-2) | 
 +|  7  | unused | 
 +|  8  | Ride DDD (4-4-3,​2-2-6,​5-4-3) | 
 +|  9  | 0-2 Boss (7-1-3) | 
 +|  10  | MiniBoss (enlarged enemy) |
  
-Area setup blocks define the camera settings, collisions, and object placements for areas. The high level structure is as follows (in order): 
  
-  ​HEADER +----
-  ​UNKNOWN1 +
-  ​UNKNOWN2 +
-  ​HEADER2 +
-  - OBJECTS +
-  +
-==== HEADER ====+
  
-<code C> +===== Level List Locations ===== 
-struct AreaSettingsHeader +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.
-+
-    /*0x00*/ u32 offsUnkown2; ​  // relative offset ​of UNKNOWN2 section +
-    /*0x04*/ u32 offsHeader2; ​  // relative offset of HEADER2 section +
-    /*0x08*/ u32 offsObjects; ​  // relative offset of OBJECTS section +
-}; +
-</​code>​+
  
-==== UNKNOWN1 ==== +The Table that has these locations is located at 0x7A1E8 in the ROM and 0x800d1f98 in RAM 
- +== LEVEL LOCATION TABLE== 
-==== UNKNOWN2 ==== +^Stage^RAM Address^ROM Address^ 
- +| 1-1 | 0x800D01A4 | 0x783F4 |  
-==== HEADER2 ==== +| 1-2 | 0x800D027C | 0x784CC |  
-Collision and camera related. +| 1-3 | 0x800D039C | 0x785EC |  
- +| 1-4 | 0x800D0528 | 0x78778 |  
-==== OBJECTS ==== +| 2-1 | 0x800D0570 | 0x787C0 |  
-This section defines how objects are placed in an area. It contains an array of the following struct: +| 2-2 | 0x800D066C | 0x788BC |  
- +| 2-3 | 0x800D078C | 0x789DC |  
-<code C> +| 2-4 | 0x800D08F4 | 0x78B44 |  
-struct ObjectPlacement // 0x2C bytes each +| 2-5 | 0x800D0A5C | 0x78CAC |  
-{ +| 3-1 | 0x800D0AA4 | 0x78CF4 |  
-   /*0x00*/ u8  unk00; +| 3-2 | 0x800D0BC4 | 0x78E14 |  
-   /*0x01*/ u8  unk01; +| 3-3 | 0x800D0CE4 | 0x78F34 |  
-   /*0x02*/ u8  objectId; +| 3-4 | 0x800D0E28 | 0x79078 |  
-   /*0x04*/ u8  unk04; +| 3-5 | 0x800D0F48 | 0x79198 |  
-   /*0x05*/ u8  unk05; +| 4-1 | 0x800D0F90 | 0x791E0 |  
-   /*0x06*/ u16 unk06; +| 4-2 | 0x800D10B0 | 0x79300 |  
-   /*....*/ +| 4-3 | 0x800D11F4 | 0x79444 |  
-   /*0x20*/ f32 scale; +| 4-4 | 0x800D12F0 | 0x79540 |  
-   /*0x24*/ xPos; +| 4-5 | 0x800D1434 | 0x79684 |  
-   /*....*/ +| 5-1 | 0x800D147C | 0x796CC |  
-}; +| 5-2 | 0x800D159C | 0x797EC |  
-</​code>​ +| 5-3 | 0x800D16BC | 0x7990C |  
- +| 5-| 0x800D1824 | 0x79A74 |  
-There is a 4-byte end marker (0x99999999) at the end of the array. +| 5-5 | 0x800D1968 | 0x79BB8 |  
-The function at 0x800FC9C0 is used to spawn objects when Kirby is within range. +| 6-1 | 0x800D19B0 | 0x79C00 |  
- +| 6-2 | 0x800D1A64 | 0x79CB4 |  
-----+| 6-3 | 0x800D1B84 | 0x79DD4 |  
 +| 6-4 | 0x800D1D58 | 0x79FA8 |  
 +| 7-1 | 0x800D1DA0 | 0x79FF0 |  
 +| 7-2 | 0x800D1E30 | 0x7A080 |  
 +| 7-3 | 0x800D1E9C | 0x7A0EC |  
 +| 7-4 | 0x800D1EE4 | 0x7A134 | 
 ===== 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]]]
  
kirby64_the_crystal_shards/levels.1579564037.txt.gz · Last modified: 2020/01/20 23:47 by jesusyoshi54