User Tools

Site Tools


super_mario_64:geometry_layout_commands

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
Last revision Both sides next revision
super_mario_64:geometry_layout_commands [2018/10/19 06:06]
David [09: Set Background Frustum Matrix] Added documentation on geometry layout command 0x09
super_mario_64:geometry_layout_commands [2018/10/21 19:10]
David [14: Billboard Model and Translate (and Load Display List or Start Geo Layout)] Added documentation to the geo layout 0x14 command.
Line 89: Line 89:
 ---- ----
  
-==== 06: Unused ====+==== 06: Store Current Node Pointer To Table (Unused==== 
 + 
 +''​06 00 [<color darkred>​XX XX</​color>​]''​ 
 + 
 +Stores the pointer of the last node into the table at address (*0x8038BCAC). This table is usually empty except for the first entry (index 0), which holds the pointer to the node created by the geo layout 0x0F command. The size of the table is defined by the geo layout 0x08 command. 
 + 
 +| <color darkred>​X</​color>​ | Index in table to store pointer | 
 + 
 +  Example in a geometry layout: 
 +  0A 01 002D 0064 4E20 8029AA3C // Set camera frustum (FOV = 45, Near = 100, Far = 20000) 
 +  06 00 00 01 // Store pointer of the 0x0A command node to address ((*0x8038BCAC) + 4)
  
 ---- ----
  
-==== 07: Unused ====+==== 07: Set/OR/AND Node Flags (Unused==== 
 + 
 +''​06 [<color darkred>​OP</​color>​] [<color darkgreen>​VV VV</​color>​]''​ 
 + 
 +Does an operation on the flags of the current node. (Flags are at offset 0x02 of the GraphNode structure) 
 + 
 +| <color darkred>​OP</​color>​ | Operation (0 = Set flags to value, 1 = OR flags with value, 2 = AND flags with value) | 
 +| <color darkgreen>​V</​color>​ | Value | 
 + 
 +  Example in a geometry layout: 
 +  0A 01 002D 0064 4E20 8029AA3C // Set camera frustum (FOV = 45, Near = 100, Far = 20000) 
 +  07 00 00 01 // Set Node flags of 0x0A command to be 0x0001 
 +  07 01 01 00 // OR Node flags with 0x0100 
 +  07 02 00 01 // AND Node flags with 0x0001
  
 ---- ----
Line 102: Line 125:
 ''​08 00 00 [<color darkgrey>​AA</​color>​] [<color darkred>​XX XX</​color>​] [<color darkgreen>​YY YY</​color>​] [<color darkblue>​WW WW</​color>​] [<color purple>​HH HH</​color>​]''​ ''​08 00 00 [<color darkgrey>​AA</​color>​] [<color darkred>​XX XX</​color>​] [<color darkgreen>​YY YY</​color>​] [<color darkblue>​WW WW</​color>​] [<color purple>​HH HH</​color>​]''​
  
-| <color darkgrey>​A</​color>​ | Either 00 (mario faceor 0A (all other levels) |+| <color darkgrey>​A</​color>​ | Number of entries ​(minus 2to allocate in pointer table at address ​(*0x8038BCAC). Usually set to 0x0A for levels, and 0 for mario face. Used with the geometry layout 0x06 command.  ​|
 | <color darkred>​X</​color>​ | X position | | <color darkred>​X</​color>​ | X position |
 | <color darkgreen>​Y</​color>​ | Y position | | <color darkgreen>​Y</​color>​ | Y position |
Line 298: Line 321:
  
 ---- ----
-==== 13: Load Display List ==== +==== 11: Translate Node (and Load Display List or Start Geo Layout) ==== 
-Loads display list with drawing layer and offsets the model on X/Y/Z axis.+Applies translation to the child nodes, and a display list if one is specified. You can start a geometry layout with this command to set the offset for the entire model. You cannot start a geometry layout and load a display list at the same time, as it will cause the game to freeze (white-screen). 
 + 
 + 
 + 
 +''​11 [<color orange>​B</​color>​][<​color lightgrey>​L</​color>​] [<color darkred>​XX XX</​color>​] [<color darkgreen>​YY YY</​color>​] [<color darkblue>​ZZ ZZ</​color>​] {<color purple>​AA AA AA AA</​color>​}''​ 
 + 
 +| <color orange>​B</​color>​ | Include last 4 bytes if set to 8 (command will be C bytes long instead of 8) | 
 +| <color darkgrey>​L</​color>​ | Drawing layer if <color orange>​B</​color>​ is set, otherwise will always be zero | 
 +| <color darkred>​X</​color>​ | X translation offset (s16) | 
 +| <color darkgreen>​Y</​color>​ | Y translation offset (s16) | 
 +| <color darkblue>​Z</​color>​ | Z translation offset (s16) | 
 +| <color purple>​A</​color>​ | Segmented address with display list if <color orange>​B</​color>​ is set. \\ Also creates a joint of some kind? (Does not work with animations?​) | 
 + 
 +Length: 8-C (variable) 
 + 
 +Note: You can't just use the 8-byte version of 0x11 command just anywhere. It seems like the command needs a joint in it's parent node(s) for it to work properly (created from geo layout commands 0x11, 0x12, and 0x13). 
 + 
 +  0B000000 
 +  04000000 
 +    11 00 0000 0100 0000 // This will cause a crash 
 +    04000000 
 +      15 01 00 00 0700A290 
 +    05000000 
 +  05000000 
 +  01000000 
 +   
 +  0B000000 
 +  04000000 
 +    11 80 0000 0100 0000 00000000 // This will work, since it creates a joint. 
 +    04000000 
 +      15 01 00 00 0700A290 
 +    05000000 
 +  05000000 
 +  01000000 
 +   
 +  11 00 0000 0100 0000 // This will also work, since it is starting the geo layout. 
 +  04000000 
 +      15 01 00 00 0700A290 
 +  05000000 
 +  01000000 
 +   
 +  0B000000 
 +  04000000 
 +    ​13 01 0000 0000 0000 00000000 
 +    04000000 
 +      11 00 0000 0100 0000 // This will also work, since there is a joint above it. 
 +      04000000 
 +        15 01 00 00 0700A290 
 +      05000000 
 +    05000000 
 +  05000000 
 +  01000000 
 + 
 +---- 
 +==== 12Rotate Node (and Load Display List or Start Geo Layout) ==== 
 +Applies rotation to the child nodes, and a display list if one is specified. You can start a geometry layout with this command to set the rotation for the entire model. You cannot start a geometry layout and load a display list at the same time, as it will cause the game to freeze (white-screen). 
 + 
 +''​12 [<color orange>​B</​color>​][<​color lightgrey>​L</​color>​] [<color darkred>​RX RX</​color>​] [<color darkgreen>​RY RY</​color>​] [<color darkblue>​RZ RZ</​color>​] {<color purple>​AA AA AA AA</​color>​}''​ 
 + 
 +| <color orange>​B</​color>​ | Include last 4 bytes if set to 8 (command will be C bytes long instead of 8) | 
 +| <color darkgrey>​L</​color>​ | Drawing layer if <color orange>​B</​color>​ is set, otherwise will always be zero | 
 +| <color darkred>​RX</​color>​ | X rotation (s16) | 
 +| <color darkgreen>​RY</​color>​ | Y rotation (s16) | 
 +| <color darkblue>​RZ</​color>​ | Z rotation (s16) | 
 +| <color purple>​A</​color>​ | Segmented address with display list if <color orange>​B</​color>​ is set.\\ Also creates a joint of some kind? (Does not work with animations?​) | 
 + 
 +Length: 8-C (variable) 
 + 
 +Note: You can't just use the 8-byte version of 0x12 command just anywhere. It seems like the command needs a joint in it's parent node(s) for it to work properly (created from geo layout commands 0x11, 0x12, and 0x13). 
 + 
 +(see geo layout command 0x11 for examples) 
 + 
 +---- 
 +==== 13: Load Display List With Offset ​==== 
 +Loads display list with drawing layer and offsets the model and the node's children ​on X/Y/Z axis.
  
 ''​13 [<color darkgray>​LL</​color>​] [<color darkred>​XX XX</​color>​] [<color darkgreen>​YY YY</​color>​] [<color darkblue>​ZZ ZZ</​color>​] [<color purple>​AA AA AA AA</​color>​]''​ ''​13 [<color darkgray>​LL</​color>​] [<color darkred>​XX XX</​color>​] [<color darkgreen>​YY YY</​color>​] [<color darkblue>​ZZ ZZ</​color>​] [<color purple>​AA AA AA AA</​color>​]''​
Line 313: Line 410:
 ---- ----
  
-==== 14: Billboard Model ==== +==== 14: Billboard Model and Translate (and Load Display List or Start Geo Layout) ​==== 
-Billboards ​the model without needing the use of 0x21 in the behavior script.+Almost identical with the geometry layout 0x11 command, except that it will billboard the node and it's children ​without needing the use of 0x21 in the behavior script. You can start a geometry layout with this command to billboard and set the offset for the entire model. You cannot start a geometry layout and load a display list at the same time, as it will cause the game to freeze (white-screen).
  
-''​14 ​00 00 00 00 00 00 00''​+''​14 ​[<color orange>​B</​color>​][<​color lightgrey>​L</​color>​] [<color darkred>​XX XX</​color>​] [<color darkgreen>​YY YY</​color>​] [<color darkblue>​ZZ ZZ</​color>​] {<color purple>​AA AA AA AA</​color>​}''​
  
-Length: 8+| <color orange>​B</​color>​ | Include last 4 bytes if set to 8 (command will be C bytes long instead of 8) | 
 +| <color darkgrey>​L</​color>​ | Drawing layer if <color orange>​B</​color>​ is set, otherwise will always be zero | 
 +| <color darkred>​X</​color>​ | X translation offset (s16) | 
 +| <color darkgreen>​Y</​color>​ | Y translation offset (s16) | 
 +| <color darkblue>​Z</​color>​ | Z translation offset (s16) | 
 +| <color purple>​A</​color>​ | Segmented address with display list if <color orange>​B</​color>​ is set. \\ Also creates a joint of some kind? (Does not work with animations?​) | 
 + 
 +Length: 8-C (variable)
  
 ---- ----
super_mario_64/geometry_layout_commands.txt · Last modified: 2019/11/03 14:23 by jesusyoshi54