User Tools


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
geometry_layout_commands [2015/12/02 15:45]
queueram Add See Also and References sections
— (current)
Line 1: Line 1:
-======== Geometry Layout Commands ======== 
  
-The geometry layout commands define how geometric shapes are drawn. ​ Some geo layouts are contained after the Level data blocks and some are loaded with [[Level Commands#​17:​ Load ROM to Segment|Level Command 0x17]] The first byte of the geo layout command is the command type.  Unlike the level commands, there is no length byte specified in the command. ​ Most geo layout commands are constant length, however, some depend on the values set. 
- 
-===== Drawing Layers ===== 
- 
-^ Layer ^ Description ^ 
-| 00 | Unused | 
-| 01 | Entirely Solid | 
-| 02 | Unused | 
-| 03 | Unused | 
-| 04 | Transparent pixels, no semi transparency. Allows perfect layering with other transparencies around it. | 
-| 05 | Semi transparency enabled. Layering must be handled with the order of drawn faces. | 
-| 06 | Semi transparency enabled. Layering must be handled with the order of drawn faces. This layer is always drawn behind layer 05, usually for shadows. | 
- 
-===== Geometry Layout Commands ===== 
-==== 01: Terminate Geometry Layout ==== 
-The ending command to close. 
- 
-''​01 00 00 00''​ 
- 
-Length: 4 
- 
----- 
- 
-==== 02: Branch Geometry Layout ==== 
-Branches the current geo layout to another area within a RAM bank. 
- 
-''​02 01 00 00 [<color darkred>​SS SS SS SS</​color>​]''​ 
- 
-| <color darkred>​S</​color>​ | Segmented address to branch to | 
- 
-Length: 8 
- 
----- 
- 
-==== 03: Return From Branch ==== 
-Ends the current geometry layout branch and returns to the area following the 0x02 command. 
- 
-''​03 00 00 00''​ 
- 
-Length: 4 
- 
----- 
- 
-==== 04: Open Node ==== 
-If you don't understand nodes, this is basically like a sub-folder. 
- 
-''​04 00 00 00''​ 
- 
-Length: 4 
- 
----- 
- 
-==== 05: Close Node ==== 
-Used at the end of the data within the opened node. 
- 
-''​05 00 00 00''​ 
- 
-Length: 4 
- 
----- 
- 
-==== 0B: Start Geo Layout ==== 
-Starts geometry layout with no parameters whatsoever. Seems to use a pre-set render area. 
- 
-''​0B 00 00 00''​ 
- 
-Length: 4 
- 
----- 
- 
-==== 0E: Switch Case ==== 
-Loads ASM in RAM that switches between the receding display lists within the node. 
- 
-''​0E 00 00 [<color darkgray>​NN</​color>​] [<color purple>​AA AA AA AA</​color>​]''​ 
- 
-| <color darkgray>​N</​color>​ | Number of cases/​display lists, starting at 01 | 
-| <color purple>​A</​color>​ | ASM Function | 
- 
-Length: 8 
- 
----- 
- 
-==== 13: Load Display List ==== 
-Loads display list with drawing layer and offsets the model 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>​]''​ 
- 
-| <color darkgray>​L</​color>​ | Drawing layer | 
-| <color darkred>​X</​color>​ | Offset on X axis (s16) | 
-| <color darkgreen>​Y</​color>​ | Offset on Y axis (s16) | 
-| <color darkblue>​Z</​color>​ | Offset on Z axis (s16) | 
-| <color purple>​A</​color>​ | Segmented address with display list | 
- 
-Length: C 
- 
----- 
- 
-==== 14: Billboard Model ==== 
-Billboards the model without needing the use of 0x21 in the behavior script. 
- 
-''​14 00 00 00 00 00 00 00''​ 
- 
-Length: 8 
- 
----- 
- 
-==== 15: Load Display List ==== 
-Loads display list with drawing layer and no other properties. 
- 
-''​15 [<color darkgray>​LL</​color>​] 00 00 [<color purple>​AA AA AA AA</​color>​]''​ 
- 
-| <color darkgray>​L</​color>​ | Drawing layer | 
-| <color purple>​A</​color>​ | Segmented address with display list | 
- 
-Length: 8 
- 
----- 
- 
-==== 16: Start Geo Layout with Shadow ==== 
-Used at start of the geo layout, with shadow type, solidity, and size. 
- 
-''​16 00 00 [<color darkred>​AA</​color>​] 00 [<color darkgreen>​BB</​color>​] [<color darkblue>​CC CC</​color>​]''​ 
- 
-| <color darkred>​A</​color>​ | Shadow type | 
-| <color darkgreen>​B</​color>​ | Shadow solidity (00=invisible,​ FF=black) | 
-| <color darkblue>​C</​color>​ | Shadow scale | 
- 
-Length: 8 
- 
----- 
- 
-==== 18: Load Polygons ASM ==== 
-Used in some original objects to point to ASM in RAM, for misc. effects such as vertex rippling. 
- 
-''​18 00 00 00 [<color darkblue>​AA AA AA AA</​color>​]''​ 
- 
-| <color darkred>​A</​color>​ | ASM RAM Address | 
- 
-Length: 8 
- 
----- 
- 
-==== 1D: Scale Model ==== 
-Scales the receding data uniformly. 
- 
-''​1D [<color darkred>​A</​color>​][<​color darkgreen>​B</​color>​] 00 00 [<color darkblue>​SS SS SS SS</​color>​] {?? ?? ?? ??​}''​ 
- 
-| <color darkred>​A</​color>​ | If MSbit is set, load B and ?? | 
-| <color darkgreen>​B</​color>​ | If MSbit of <color darkred>​A</​color>​ is set, use for A2 to 8037B940 | 
-| <color darkblue>​S</​color>​ | Scale percentage (0x10000 = 100%) | 
-| ?? | optional word used if the MSbit of <color darkred>​A</​color>​ is set | 
- 
-Length: 8-C (variable) 
- 
----- 
- 
-==== 20: Start Geo Layout with Render Area ==== 
-Starts the geometry layout with no shadow and a render area. 
- 
-''​20 00 [<color darkred>​AA AA</​color>​]''​ 
- 
-| <color darkred>​A</​color>​ | Render distance? | 
- 
-Length: 4 
- 
-===== See Also ===== 
-[[Level Commands]] 
- 
-===== References ===== 
-  * http://​origami64.net/​showthread.php?​tid=9 
-  * http://​www.smwcentral.net/?​p=viewthread&​t=74776 
-  * http://​qubedstudios.rustedlogic.net/​Mario64_HackingDoc1.5.txt