User Tools

Site Tools


kirby64_the_crystal_shards:geometry_blocks

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:geometry_blocks [2020/05/27 11:19]
jesusyoshi54 [TEXTURE SCROLL SETTINGS]
kirby64_the_crystal_shards:geometry_blocks [2020/08/18 15:54]
jesusyoshi54
Line 13: Line 13:
   - TEXTURE SCROLL SETTINGS   - TEXTURE SCROLL SETTINGS
   - TEXTURE SCROLL DATA BLOCKS   - TEXTURE SCROLL DATA BLOCKS
 +  - ANIMATION REFERENCES
  
 ---- ----
Line 25: Line 26:
     /*0x0C*/ segptr imgRefs; ​       // segment-offset pointer to the G_SETTIMG REFERENCES section     /*0x0C*/ segptr imgRefs; ​       // segment-offset pointer to the G_SETTIMG REFERENCES section
     /*0x10*/ segptr vtxRefs; ​       // segment-offset pointer to the G_VTX REFERENCES section     /*0x10*/ segptr vtxRefs; ​       // segment-offset pointer to the G_VTX REFERENCES section
-    /*0x14*/ int    ​lenScrollData;  // defines length of the Scroll DATA section +    /*0x14*/ int    ​numAnimations;  // defines length of the ANIMARION REFS section 
-    /*0x18*/ segptr ​scrollData;     // segment-offset pointer to the Scroll DATA section+    /*0x18*/ segptr ​Animations;     // segment-offset pointer to the ANIMATION REFS section
     /*0x1C*/ int    lenLayout; ​     // length of the Layout section     /*0x1C*/ int    lenLayout; ​     // length of the Layout section
 }; };
Line 47: Line 48:
 ===== G_VTX REFERENCES ===== ===== G_VTX REFERENCES =====
 This section is a zero-terminated array of segment-offset pointers to every G_VTX command in the DISPLAY LISTS section. This section is a zero-terminated array of segment-offset pointers to every G_VTX command in the DISPLAY LISTS section.
-It does not seem to be used by the game.+It is used by the game and can be left empty.
  
 ---- ----
Line 57: Line 58:
 struct EntryPoint struct EntryPoint
 { {
-    /*0x00*/ int    marker; ​     // 0x00: start of group, 0x01: continue group, 0x04 end of group +    /*0x00*/ int      marker; ​     // 0x00: start of group, 0x01: continue group, 0x04 end of group 
-    /*0x04*/ segptr displayList;​ /* segment-offset pointer to a display list in the DISPLAY LISTS section+    /*0x04*/ segptr[] displayList;​ /* segment-offset pointer to a display list in the DISPLAY LISTS section
                                     (NULL when marker is 0x04) */                                     (NULL when marker is 0x04) */
 +};
 +</​code>​
 +
 +Sometimes this is replaced simply by an array of display lists.
 +
 +<code C>
 +struct DisplayListArray
 +{
 +    /*0x00*/ segptr[] displayList;​ /* segment-offset pointer to a display list in the DISPLAY LISTS section*/
 }; };
 </​code>​ </​code>​
Line 67: Line 77:
 The interpretation of this section varies depending on the value of the layoutMode field in the HEADER section. The interpretation of this section varies depending on the value of the layoutMode field in the HEADER section.
 Modes 0x13, 0x14, 0x17, 0x18, 0x1B and 0x1C are used by the game. Modes 0x13, 0x14, 0x17, 0x18, 0x1B and 0x1C are used by the game.
 +The layoutMode is interpreted bitwise, with the above modes being the only ones
 +used by the game.
  
 Layout structure for each mode: Layout structure for each mode:
  
-  * 0x13: Unknown +  * 0x13: No layout, instead the layout pointer references a display list. 
-  * 0x14: zero-terminated ​array of segment-offset pointers to display lists in the DISPLAY LISTS section+  * 0x14: No layout, instead a pointer to a DisplayListArray thats zero terminated. 
-  * 0x17: An array of GeoTransformGfx ​structures. +  * 0x17: An array of GeoTransformGroup ​structures. Pointer goes to single display list
-  * 0x18: An array of GeoTransformGroup structures. +  * 0x18: An array of GeoTransformGroup structures. Pointer goes to Entry Point. Length of segptr array is one
-  * 0x1B: Unknown, only used for developer test level +  * 0x1B: An array of GeoTransformGroup structures. Pointer goes to DisplayListArray. Length of segptr array is two. 
-  * 0x1C: Unknown, only used for test level, 5-4-7 and 5-4-8 +  * 0x1C: An array of GeoTransformGroup structures. Pointer goes to Entry Point. Length of segptr array is two.
- +
-<code C> +
-struct GeoTransformGfx ​ // Transform single display list +
-+
-    u16    flag; +
-    u16    command; +
-    segptr displayList;​ // segment-offset pointer ​to display list in the DISPLAY LISTS section +
-    vec3f  position; ​   // x, y, z position +
-    vec3f  rotation; ​   // x, y, z rotation radians +
-    vec3f  scale; ​      // x, y, z scale +
-}; +
-</​code>​+
  
 <code C> <code C>
Line 94: Line 94:
     u16    flag;     u16    flag;
     u16    command;     u16    command;
 +    union{
     segptr displayListGroup;​ // segment-offset pointer to an entry point     segptr displayListGroup;​ // segment-offset pointer to an entry point
 +    segptr EntryPoint;
 +    segptr DisplayListPair;​
 +    };
     vec3f  position; ​        // x, y, z position     vec3f  position; ​        // x, y, z position
     vec3f  rotation; ​        // x, y, z rotation radians     vec3f  rotation; ​        // x, y, z rotation radians
Line 123: Line 127:
 ==== SUB HEADER ==== ==== SUB HEADER ====
  
-Each subheader is an array of segptrs to texture scroll structs. Each su header is terminated by an 0x99999999.+Each subheader is an array of segptrs to texture scroll structs. Each sub header is terminated by an 0x99999999.
  
 ==== TEXTURE SCROLLS ==== ==== TEXTURE SCROLLS ====
Line 178: Line 182:
  
 ---- ----
-===== TEXTURE SCROLL DATA ===== +===== ANIMATION REFS ===== 
-Texture Scroll data is an array of bank-index pairs. The length of the array is defined in the HEADER section'​s ​lenScrollData ​field. +Animations references are an array of bank-index pairs. The length of the array is defined in the HEADER section'​s ​numAnimations ​field. 
-Each Texture Scroll Data section is loaded into bank 0xE on level start and is +When needed, the data for the animation are dma'd by the games file system based on the bank index pair listed. 
-used as graphics data that the uvScrollData structs will be built around.+For info on animations see the animations page.
kirby64_the_crystal_shards/geometry_blocks.txt · Last modified: 2020/08/18 15:54 by jesusyoshi54