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

Next revision
Previous revision
Last revision Both sides next revision
kirby64_the_crystal_shards:geometry_blocks [2019/09/27 20:21]
shygoo created
kirby64_the_crystal_shards:geometry_blocks [2020/05/27 11:19]
jesusyoshi54 [SUB HEADER]
Line 9: Line 9:
   - G_SETTIMG REFERENCES   - G_SETTIMG REFERENCES
   - G_VTX REFERENCES   - G_VTX REFERENCES
-  - DISPLAY LIST GROUP DEFINITIONS +  - ENTRY POINTS 
-  - LAYOUT+  - LAYOUTS
   - TEXTURE SCROLL SETTINGS   - TEXTURE SCROLL SETTINGS
-  - UNKNOWN ​DATA+  - TEXTURE SCROLL ​DATA BLOCKS
  
 ---- ----
Line 20: Line 20:
 struct GeometryBlockHeader struct GeometryBlockHeader
 { {
-    /*0x00*/ segptr layout; ​     // segment-offset pointer to the LAYOUT section +    /*0x00*/ segptr layout; ​        ​// segment-offset pointer to the LAYOUT section 
-    /*0x04*/ segptr texScroll; ​  ​// segment-offset pointer to the TEXTURE SCROLL section +    /*0x04*/ segptr texScroll; ​     // segment-offset pointer to the TEXTURE SCROLL section 
-    /*0x08*/ int    layoutMode; ​ // interpretation mode of the LAYOUT section +    /*0x08*/ int    layoutMode; ​    ​// interpretation mode of the LAYOUT section 
-    /*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    ​lenUnkData;  // defines length of the UNKNOWN ​DATA section +    /*0x14*/ int    ​lenScrollData;  // defines length of the Scroll ​DATA section 
-    /*0x18*/ segptr ​unkData;     // segment-offset pointer to the UNKNOWN ​DATA section +    /*0x18*/ segptr ​scrollData;     // segment-offset pointer to the Scroll ​DATA section 
-    /*0x1C*/ int    ​unk1C      ​// unknown+    /*0x1C*/ int    ​lenLayout     // length of the Layout section
 }; };
 </​code>​ </​code>​
Line 50: Line 50:
  
 ---- ----
-===== DISPLAY LIST GROUP DEFINITIONS ​=====+===== ENTRY POINTS ​=====
 This is an optional section that is enabled when using layout mode 0x18 (and possibly others). When enabled, it contains of a list of display list "​groups"​. This is an optional section that is enabled when using layout mode 0x18 (and possibly others). When enabled, it contains of a list of display list "​groups"​.
  
 Each group is an array of the following structure: Each group is an array of the following structure:
 <code C> <code C>
-struct ​GeoGroupMember+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
Line 75: Line 75:
   * 0x18: An array of GeoTransformGroup structures.   * 0x18: An array of GeoTransformGroup structures.
   * 0x1B: Unknown, only used for developer test level   * 0x1B: Unknown, only used for developer test level
-  * 0x1C: Unknown, only used for developer ​test level+  * 0x1C: Unknown, only used for test level, 5-4-7 and 5-4-8
  
 <code C> <code C>
 struct GeoTransformGfx ​ // Transform single display list struct GeoTransformGfx ​ // Transform single display list
 { {
-    ​int    ​command;​+    ​u16    flag; 
 +    u16    ​command;​
     segptr displayList;​ // segment-offset pointer to display list in the DISPLAY LISTS section     segptr displayList;​ // segment-offset pointer to display list in the DISPLAY LISTS section
     vec3f  position; ​   // x, y, z position     vec3f  position; ​   // x, y, z position
-    vec3f  rotation; ​   // x, y, z rotation+    vec3f  rotation; ​   // x, y, z rotation ​radians
     vec3f  scale; ​      // x, y, z scale     vec3f  scale; ​      // x, y, z scale
 }; };
Line 91: Line 92:
 struct GeoTransformGroup // Transform group of display lists struct GeoTransformGroup // Transform group of display lists
 { {
-    ​int    ​command;​ +    ​u16    flag; 
-    segptr displayListGroup;​ /segment-offset pointer to a display list group definition in the +    u16    ​command;​ 
-                                DISPLAY LIST GROUP DEFINITIONS section */+    segptr displayListGroup;​ /segment-offset pointer to an entry point
     vec3f  position; ​        // x, y, z position     vec3f  position; ​        // x, y, z position
-    vec3f  rotation; ​        // x, y, z rotation+    vec3f  rotation; ​        // x, y, z rotation ​radians
     vec3f  scale; ​           // x, y, z scale     vec3f  scale; ​           // x, y, z scale
 }; };
 </​code>​ </​code>​
 +
 +A command of 0 is used to start a layout, and a command of 12 is used to end it. If the msb of the Display List of Entry Point pointer is set, afterwards
 +another series of layouts will be used for environment effects. These environment effects dont have any pointers but are just placements of Loc, Rot, Scale.
  
 ---- ----
 ===== TEXTURE SCROLL SETTINGS ===== ===== TEXTURE SCROLL SETTINGS =====
-This is an optional section that is enabled when (?).+This is an optional section that is enabled when a pointer exists in the Geo Block Header.
 When enabled, the engine uses this section to add G_DL branches and dynamic G_SETTILESIZE commands to RSP segment 0x0E. When enabled, the engine uses this section to add G_DL branches and dynamic G_SETTILESIZE commands to RSP segment 0x0E.
 The display lists in the DISPLAY LISTS section may jump to these commands for texture scrolling effects. The display lists in the DISPLAY LISTS section may jump to these commands for texture scrolling effects.
  
-This section contains ​four subsections (in order):+This section contains ​three subsections (in order):
  
-  - HEADER +  - Main Header 
-  - UNKNOWN STRUCTURES +  - ScrollStruct 
-  - LIST A +  - Sub Headers
-  - LIST B+
  
-==== HEADER ====+==== MAIN HEADER ====
  
-<code C> +The texture scroll header is an array of segptrs terminated by an 0x99999999. Each segptr in this 
-struct TexScrollHeader +section ​points ​to a subheader.
-+
-    /*0x04*/ u32    unk00; +
-    /*0x08*/ segptr listA; // segment-offset pointer to the LIST A section +
-    /*0x0C*/ segptr listB; // segment-offset pointer ​to the LIST B section +
-    /*0x10*/ u32    unk10; +
-}; +
-</​code>​+
  
-==== UNKNOWN STRUCTURES ​==== +==== SUB HEADER ​====
-Contains structures referenced by LIST A and LIST B. Unknown definition.+
  
-==== LIST A ==== +Each subheader ​is an array of segptrs ​to texture scroll structsEach sub header is terminated ​by an 0x99999999.
-This section ​is an array of segment-offsets pointing ​to structures in the UNKNOWN STRUCTURES sectionTerminated ​by 0x99999999.+
  
-==== LIST B ==== +==== TEXTURE SCROLLS ​==== 
-This section is an array of segment-offsets pointing ​to structures ​in the UNKNOWN STRUCTURES sectionTerminated ​by 0x99999999.+ 
 +This section is an array of uvScrollData structs each pointed ​to by an item in the 
 +subheader arraysFollowing this uvScrollData struct is an optional bank-index list to 
 +textures which is also terminated ​by 0x9999. 
 + 
 +<code c> 
 +struct uvScrollData { 
 +    ushort field_0x0;​ 
 +    byte fmt1; 
 +    byte siz1; 
 +    uint * textures; 
 +    ushort stretch; 
 +    ushort sharedOffset;​ 
 +    ushort t0_w; 
 +    ushort t0_h; 
 +    int halve; 
 +    float t0_xShift;​ 
 +    float t0_yShift;​ 
 +    float xScale; 
 +    float yScale; 
 +    float field_0x24;​ 
 +    float field_0x28;​ 
 +    pointer palettes; 
 +    ushort flags; 
 +    byte fmt2; 
 +    byte siz2; 
 +    ushort w2; 
 +    ushort h2; 
 +    ushort t1_w; 
 +    ushort t1_h; 
 +    float t1_xShift;​ 
 +    float t1_yShift;​ 
 +    float field_0x44;​ 
 +    float field_0x48;​ 
 +    int field_0x4c;​ 
 +    struct color prim; 
 +    byte primLODFrac;​ 
 +    byte field_0x55;​ 
 +    byte field_0x56;​ 
 +    undefined field_0x57;​ 
 +    struct color env; 
 +    struct color blend; 
 +    struct color light1; 
 +    struct color light2; 
 +    int field_0x68;​ 
 +    int field_0x6c;​ 
 +    int field_0x70;​ 
 +    int field_0x74;​ 
 +}; 
 +</​code>​
  
 ---- ----
-===== UNKNOWN ​DATA ===== +===== TEXTURE SCROLL ​DATA ===== 
-Unknown ​data. It looks like an array of bank-index pairs. The length of the array is defined in the HEADER section'​s ​lenUnkData ​field.+Texture Scroll ​data is an array of bank-index pairs. The length of the array is defined in the HEADER section'​s ​lenScrollData ​field
 +Each Texture Scroll Data section is loaded into bank 0xE on level start and is 
 +used as graphics data that the uvScrollData structs will be built around.
kirby64_the_crystal_shards/geometry_blocks.txt · Last modified: 2020/08/18 15:54 by jesusyoshi54