This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
super_mario_64:fast3d_display_list_commands [2016/04/05 06:27] tarek701 [FC: G_SETCOMBINE] |
super_mario_64:fast3d_display_list_commands [2025/10/18 21:21] (current) |
||
|---|---|---|---|
| Line 4: | Line 4: | ||
| ===== Fast3D Commands ===== | ===== Fast3D Commands ===== | ||
| - | ==== 03: F3D_MOVEMEM ==== | + | ==== 00: G_NOOP ==== |
| - | Used in Super Mario 64 to load vector normals (shading) RGB values. | + | No operation. This should only be used for debugging purposes. |
| - | ''03 [<color darkgrey>TT</color>] 00 00 [<color purple>AA AA AA AA</color>]'' | + | ''00 00 00 00 00 00 00 00'' |
| - | | <color darkgrey>T</color> | If 86, loads light values. If 88, loads dark values | | + | ==== 01: G_MTX ==== |
| + | Apply transformation matrix. Used in HUD text printing code to translate textures. | ||
| + | |||
| + | ''01 [<color darkred>PP</color>] 00 00 [<color purple>AA AA AA AA</color>]'' | ||
| + | |||
| + | | <color darkred>P</color> | Parameters | | ||
| | <color purple>A</color> | Segmented address of vectors | | | <color purple>A</color> | Segmented address of vectors | | ||
| - | Example: Loads light RGB from 0x0 in RAM bank 0x0E; loads dark RGB from 0x08 in RAM Bank 0x0E | + | Parameters (can be OR'd together): |
| - | 03 86 00 00 0E 00 00 00 | + | | 0x01 | projection (default: model view) | |
| - | 03 88 00 00 0E 00 00 08 | + | | 0x02 | load (default: multiply) | |
| + | | 0x04 | push (default: no push) | | ||
| + | |||
| + | Example: Push matrix and and multiply by matrix at 0x00213DF8; Multiply by matrix at 0x00213DB8 | ||
| + | 01 04 00 40 00 21 3D F8 | ||
| + | 01 00 00 40 00 21 3D B8 | ||
| + | |||
| + | ==== 03: F3D_MOVEMEM ==== | ||
| + | Used in Super Mario 64 to load vector lighting ambient/diffuse RGBA values. | ||
| + | |||
| + | ''03 [<color darkgrey>TT</color>] 00 10 [<color purple>AA AA AA AA</color>]'' | ||
| + | |||
| + | | <color darkgrey>T</color> | If 0x86, loads diffuse(light) values. If 0x88, loads ambient(dark) values | | ||
| + | | <color purple>A</color> | Segmented address of RGBA | | ||
| + | |||
| + | Example: Loads diffuse RGBA from 0x0 in RAM bank 0x0E; loads ambient RGBA from 0x08 in RAM Bank 0x0E | ||
| + | 03 86 00 10 0E 00 00 00 | ||
| + | 03 88 00 10 0E 00 00 08 | ||
| ---- | ---- | ||
| Line 36: | Line 58: | ||
| Signifies the start of a Display List. May be used to link data and branch the current DL. | Signifies the start of a Display List. May be used to link data and branch the current DL. | ||
| - | ''06 00 00 00 [<color purple>AA AA AA AA</color>]'' | + | ''06 [<color blue>AA</color>] 00 00 [<color purple>BB BB BB BB</color>]'' |
| - | | <color purple>A</color> | Segmented Address to branch to | | + | | <color blue>AA</color> | 00 = store return address, 01 = don't store (end DL after branch) | |
| + | | <color purple>B</color> | Segmented Address to branch to | | ||
| Example: Loads a display list from 0xA50 in bank 0x07. | Example: Loads a display list from 0xA50 in bank 0x07. | ||
| Line 75: | Line 98: | ||
| | 0x00001000 | cull front facing triangles | | | 0x00001000 | cull front facing triangles | | ||
| | 0x00002000 | cull back facing triangles | | | 0x00002000 | cull back facing triangles | | ||
| - | | 0x00004000 | Crystal effect? | | ||
| | 0x00010000 | Fog | | | 0x00010000 | Fog | | ||
| | 0x00020000 | Enable lighting? Vertex colors? | | | 0x00020000 | Enable lighting? Vertex colors? | | ||
| Line 128: | Line 150: | ||
| Renders one triangle according to the vertices inside the vertex buffer | Renders one triangle according to the vertices inside the vertex buffer | ||
| - | ''BF 00 00 00 [<color darkred>AA</color>] [<color darkgreen>BB</color>] [<color darkblue>CC</color>]'' | + | ''BF 00 00 00 00 [<color darkred>AA</color>] [<color darkgreen>BB</color>] [<color darkblue>CC</color>]'' |
| | <color darkred>A</color> | First vertex to use for the triangle (* 0x0A) | | | <color darkred>A</color> | First vertex to use for the triangle (* 0x0A) | | ||
| Line 136: | Line 158: | ||
| Example: Render a triangle using the vertex data specified at the vertex buffer positions 0, 1 (0x0A / 0x0A) and 2 (0x14 / 0x0A). | Example: Render a triangle using the vertex data specified at the vertex buffer positions 0, 1 (0x0A / 0x0A) and 2 (0x14 / 0x0A). | ||
| - | BF 00 00 00 00 0A 14 | + | BF 00 00 00 00 00 0A 14 |
| + | |||
| + | ---- | ||
| + | |||
| + | ==== E4: G_TEXRECT ==== | ||
| + | Draws a textured 2D rectangle on the screen | ||
| + | |||
| + | ''E4 [<color darkred>xx x</color>][<color darkgreen>y yy</color>] 0[<color darkblue>I</color>] [<color red>XX X</color>][<color green>Y YY</color>]''\\ | ||
| + | ''B3 00 00 00 [<color #BF9F00>SS SS</color>] [<color #8F3F10>TT TT</color>]''\\ | ||
| + | ''B2 00 00 00 [<color #3F3FFF>DD DD</color>] [<color darkcyan>EE EE</color>]'' | ||
| + | |||
| + | | <color darkred>xxx</color> | Lower-right corner X coordinate | | ||
| + | | <color darkgreen>yyy</color> | Lower-right corner Y coordinate | | ||
| + | | <color darkblue>I</color> | Tile descriptor to use for rectangle | | ||
| + | | <color red>XXX</color> | Upper-left corner X coordinate | | ||
| + | | <color green>YYY</color> | Upper-left corner Y coordinate | | ||
| + | | <color #BF9F00>SSSS</color> | Texture S coordinate at upper-left corner | | ||
| + | | <color #8F3F10>TTTT</color> | Texture T coordinate at upper-left corner | | ||
| + | | <color #3F3FFF>DDDD</color> | Change in S coordinate over change in X coordinate | | ||
| + | | <color darkcyan>EEEE</color> | Change in T coordinate over change in Y coordinate | | ||
| ---- | ---- | ||
| Line 158: | Line 199: | ||
| Determines how much data to load after SETTIMG | Determines how much data to load after SETTIMG | ||
| - | ''F3 00 00 00 ?? ?? ?? ??'' | + | ''F3 [<color darkred>SS S</color>][<color darkgreen>T TT</color>] 0[<color darkblue>I</color>] [<color purple>XX X</color>][<color darkcyan>D DD</color>]'' |
| + | |||
| + | | <color darkred>SSS</color> | Upper-left corner of texture to load, S-axis | | ||
| + | | <color darkgreen>TTT</color> | Upper-left corner of texture to load, T-axis | | ||
| + | | <color darkblue>I</color> | Tile descriptor to load into | | ||
| + | | <color purple>XXX</color> | Number of texels to load to TMEM, minus one | | ||
| + | | <color darkcyan>DDD</color> | Change in T-axis per scanline | | ||
| Examples: | Examples: | ||
| Line 169: | Line 216: | ||
| Sets the texture properties (ex. mirroring) | Sets the texture properties (ex. mirroring) | ||
| - | ''F5 ?? ?? ?? ?? ?? ?? ??'' | + | ''F5 [<color darkred>XX XX XX XX XX XX XX</color>]'' |
| + | |||
| + | | <color darkred>X</color> | Bit-wise parameters | | ||
| + | |||
| + | Bit-wise parameters: | ||
| + | |||
| + | ''[<color red>fff</color>] [<color blue>ii</color>] 0 [<color green>nnnnnnnnn</color>] [<color #BF9F00>mmmmmmmmm</color>] 00000 [<color purple>ttt</color>] [<color #3F3FFF>pppp</color>] [<color orange>cc</color>] [<color darkred>aaaa</color>] [<color darkblue>ssss</color>] [<color darkgreen>dd</color>] [<color #8F3F10>bbbb</color>] [<color darkcyan>uuuu</color>]'' | ||
| + | | <color red>fff</color> | Sets color format | | ||
| + | | <color blue>ii</color> | Sets bit size of pixel | | ||
| + | | <color green>nnnnnnnnn</color> | Number of 64-bit values per row | | ||
| + | | <color #BF9F00>mmmmmmmmm</color> | Offset of texture in TMEM | | ||
| + | | <color purple>ttt</color> | Tile descriptor being modified | | ||
| + | | <color #3F3FFF>pppp</color> | Which palette to use for colors (if relevant) | | ||
| + | | <color orange>cc</color> | Clamp and Mirror flags for the T axis | | ||
| + | | <color darkred>aaaa</color> | Sets how much of T axis is shown before wrapping | | ||
| + | | <color darkblue>ssss</color> | Sets the amount to shift T axis values after perspective division | | ||
| + | | <color darkgreen>dd</color> | Clamp and Mirror flags for the S axis | | ||
| + | | <color #8F3F10>bbbb</color> | Sets how much of S axis is shown before wrapping | | ||
| + | | <color darkcyan>uuuu</color> | Sets the amount to shift S axis values after perspective division | | ||
| + | |||
| + | |Color formats||| | ||
| + | | 0 | RGBA | Color and alpha | | ||
| + | | 1 | YUV | | | ||
| + | | 2 | CI | Index and look-up pallet | | ||
| + | | 3 | IA | Grayscale and alpha | | ||
| + | | 4 | I | Grayscale | | ||
| + | |||
| + | |Bit sizes||| | ||
| + | | 0 | 4-bit | I, IA, and CI | | ||
| + | | 1 | 8-bit | I, IA, and CI | | ||
| + | | 2 | 16-bit | RGBA, IA, and YUV | | ||
| + | | 3 | 32-bit | RGBA | | ||
| Examples: | Examples: | ||
| Line 177: | Line 255: | ||
| F5 10 20 00 07 01 40 60 : Normal for 64x32 textures after G_SETTILESIZE | F5 10 20 00 07 01 40 60 : Normal for 64x32 textures after G_SETTILESIZE | ||
| F5 70 10 00 07 01 40 50 : Grayscale for 32x32 textures after G_SETTILESIZE | F5 70 10 00 07 01 40 50 : Grayscale for 32x32 textures after G_SETTILESIZE | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== F6: G_FILLRECT ==== | ||
| + | Draws a colored rectangle on the screen. Use command 0xF7 to set the color of the rectangle. | ||
| + | |||
| + | ''F6 [<color darkred>VV V</color>][<color darkblue>W WW</color>] 00 [<color darkgreen>XX X</color>][<color purple>Y YY</color>]'' | ||
| + | |||
| + | | <color darkred>VVV</color> | Lower-right corner of rectangle, X-axis | | ||
| + | | <color darkblue>WWW</color> | Lower-right corner of rectangle, Y-axis | | ||
| + | | <color darkgreen>XXX</color> | Upper-left corner of rectangle, X-axis | | ||
| + | | <color purple>YYY</color> | Upper-left corner of rectangle, Y-axis | | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== F7: G_SETFILLCOLOR ==== | ||
| + | Sets the fill color for use in fill mode. | ||
| + | |||
| + | ''F7 00 00 00 [<color darkred>CC CC CC CC</color>]'' | ||
| + | |||
| + | | <color darkred>CCCCCCCC</color> | Fill value for use in fill mode | | ||
| ---- | ---- | ||
| Line 219: | Line 318: | ||
| | <color green>X</color> | Equation for blending. Mask is bitwise. | | | <color green>X</color> | Equation for blending. Mask is bitwise. | | ||
| - | Bitwise mask for e: | + | Bitwise mask for X: |
| ''[<color blue>**aaaa**</color>] [<color #808080>**ccccc**</color>] [<color #339999>**eee**</color>] [<color darkorange>**ggg**</color>] [<color #99CCCC>**iiii**</color>] [<color #663333>**kkkkk**</color>] [<color #FF29B8>**bbbb**</color>] [<color #29B8FF>**jjjj**</color>] [<color #FFC2A3>**mmm**</color>] [<color #999900>**ooo**</color>] [<color #4D2673>**ddd**</color>] [<color #57822B>**fff**</color>] [<color #2B2B82>**hhh**</color>] [<color #D0D071>**lll**</color>] [<color #990000>**nnn**</color>] [<color #00BDBD>**ppp**</color>]'' | ''[<color blue>**aaaa**</color>] [<color #808080>**ccccc**</color>] [<color #339999>**eee**</color>] [<color darkorange>**ggg**</color>] [<color #99CCCC>**iiii**</color>] [<color #663333>**kkkkk**</color>] [<color #FF29B8>**bbbb**</color>] [<color #29B8FF>**jjjj**</color>] [<color #FFC2A3>**mmm**</color>] [<color #999900>**ooo**</color>] [<color #4D2673>**ddd**</color>] [<color #57822B>**fff**</color>] [<color #2B2B82>**hhh**</color>] [<color #D0D071>**lll**</color>] [<color #990000>**nnn**</color>] [<color #00BDBD>**ppp**</color>]'' | ||
| Line 268: | Line 367: | ||
| * http://level42.ca/projects/ultra64/Documentation/man/pro-man/pro25/25-01.html | * http://level42.ca/projects/ultra64/Documentation/man/pro-man/pro25/25-01.html | ||
| * http://wiki.spinout182.com/w/F3DEX2 | * http://wiki.spinout182.com/w/F3DEX2 | ||
| + | * http://wiki.cloudmodding.com/oot/F3DZEX/Opcode_Details | ||