This is an old revision of the document!
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 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.
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. |
The ending command to close.
01 00 00 00
Length: 4
Branches the current geo layout to another area within a RAM bank.
02 01 00 00 [SS SS SS SS]
S | Segmented address to branch to |
Length: 8
Ends the current geometry layout branch and returns to the area following the 0x02 command.
03 00 00 00
Length: 4
If you don't understand nodes, this is basically like a sub-folder.
04 00 00 00
Length: 4
Used at the end of the data within the opened node.
05 00 00 00
Length: 4
Only used in geo layout of levels.
08 00 00 [AA] [XX XX] [YY YY] [WW WW] [HH HH]
A | Either 00 (mario face) or 0A (all other levels) |
X | X position |
Y | Y position |
W | Width of screen |
H | Height of screen |
Length: C
Only used in geo layout of levels.
09 00 00 [AA]
A | Always 0x64 |
Length: 4
Set camera frustum properties. Only used in geo layout of levels.
0A [AA] [BB BB] [NN NN] [FF FF] {EE EE EE EE}
A | Use ASM code defined by E |
B | Camera FOV (0x2D = 45) |
N | Camera Near |
F | Camera Far |
E | optional ASM function if A is non-zero (always 8029AA3C) |
Length: 8-C (variable)
Starts geometry layout with no parameters whatsoever. Seems to use a pre-set render area.
0B 00 00 00
Length: 4
Used mostly in levels
0C [AA] 00 00
A | Either 00 or 01, passed to A2 of 8037B4AC |
Length: 4
Used in WF, CCM, TTM, SSL levels and some geo layouts.
0D 00 00 00 [AA AA] [BB BB]
A | s16?, passed through A2 to 8037B530 |
B | s16? passed through A3 to 8037B530 |
Length: 8
Loads ASM in RAM that switches between the receding display lists within the node.
0E 00 00 [NN] [AA AA AA AA]
N | Number of cases/display lists, starting at 01 |
A | ASM Function |
Length: 8
0F 00 [TT TT] [XX XX] [YY YY] [ZZ ZZ] [UU UU] [VV VV] [WW WW] [AA AA AA AA]
T | ?? |
X | ?? (s16) |
Y | ?? (s16) |
Z | ?? (s16) |
U | ?? (s16) |
V | ?? (s16) |
W | ?? (s16) |
A | ASM function. Always 80287D30 (levels) or 00 (menus) |
Length: 0x14
Loads display list with drawing layer and offsets the model on X/Y/Z axis.
13 [LL] [XX XX] [YY YY] [ZZ ZZ] [AA AA AA AA]
L | Drawing layer |
X | Offset on X axis (s16) |
Y | Offset on Y axis (s16) |
Z | Offset on Z axis (s16) |
A | Segmented address with display list |
Length: C
Billboards the model without needing the use of 0x21 in the behavior script.
14 00 00 00 00 00 00 00
Length: 8
Loads display list with drawing layer and no other properties.
15 [LL] 00 00 [AA AA AA AA]
L | Drawing layer |
A | Segmented address with display list |
Length: 8
Used at start of the geo layout, with shadow type, solidity, and size.
16 00 00 [AA] 00 [BB] [CC CC]
A | Shadow type |
B | Shadow solidity (00=invisible, FF=black) |
C | Shadow scale |
Length: 8
Sets up rendering for 3D Objects? Without it, 0x24 objects placed in level do not render.
17 00 00 00
Length: 4
Used in some original objects to point to ASM in RAM, for misc. effects such as vertex rippling.
18 00 00 00 [AA AA AA AA]
A | ASM RAM Address |
Length: 8
Doesn't do anything, nop. This command is never used in any of the scripts.
Length: 8
Scales the receding data uniformly.
1D [A][B] 00 00 [SS SS SS SS] {?? ?? ?? ??}
A | If MSbit is set, load B and ?? |
B | If MSbit of A is set, use for A2 to 8037B940 |
S | Scale percentage (0x10000 = 100%) |
?? | optional word used if the MSbit of A is set |
Length: 8-C (variable)
Doesn't do anything, nop. This command is never used in any of the scripts.
Length: 8
Doesn't do anything, nop. This command is never used in any of the scripts.
Length: 0x10
Starts the geometry layout with no shadow and a render area.
20 00 [AA AA]
A | Render distance? |
Length: 4