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

Next revision
Previous revision
Last revision Both sides next revision
kirby64_the_crystal_shards:levels [2019/09/27 22:37]
shygoo very rough, oh well
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.
 +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>
 +struct Level
 +{
 +/*0X0*/ u8    World;
 +/*0X1*/ u8    Level;
 +/*0X2*/ u8    Area;
 +/*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)
 +
 +Each Area is then just an additional 0x24 from that level pointer.
 ---- ----
 ===== Level List ===== ===== Level List =====
Line 13: Line 30:
   /*0x04*/ u32   ​liGeoBlockB; ​     // List-index of secondary Geometry Block   /*0x04*/ u32   ​liGeoBlockB; ​     // List-index of secondary Geometry Block
   /*0x08*/ u16   ​skyboxId; ​        // Skybox ID   /*0x08*/ u16   ​skyboxId; ​        // Skybox ID
-  /*0x0A*/ u16   unk0A;+  /*0x0A*/ u16   background color// BG color (loaded from color table at 800D478C)
   /*0x0C*/ int   ​musicId; ​         // Music ID   /*0x0C*/ int   ​musicId; ​         // Music ID
   /*0x10*/ u32   ​biAreaSetup; ​     // Bank-index of area stup block    /*0x10*/ u32   ​biAreaSetup; ​     // Bank-index of area stup block 
-  /*0x14*/ u16   unk14;+  /*0x14*/ u16   Death Camera    // Determines how far the camera follows kirby when falling into void/death
   /*0x16*/ u16   ​unk16; ​           // Cutscene related?   /*0x16*/ u16   ​unk16; ​           // Cutscene related?
   /*0x18*/ u32   ​biDustSettings; ​  // Bank-index of Dust particle settings   /*0x18*/ u32   ​biDustSettings; ​  // Bank-index of Dust particle settings
Line 25: Line 42:
  
 ---- ----
-===== Area Setup Blocks ===== 
  
-Area setup blocks define ​the camera settings, collisions, ​and object placements for areasThe high level structure is as follows (in order):+===== Level List Locations ===== 
 +These are the locations of each level in RAM and ROMEach 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]]]
  
kirby64_the_crystal_shards/levels.txt · Last modified: 2021/01/08 00:42 by someone2639