Banner
Views: 700,397,057
Time:
12 users online: o Everest, Flippn'Fences, Fullcannon, GamecraftOriginal, IcyFruit, Impetus, KKevinM, Linkdeadx2, LMPuny, Maarfy, Narcologer, Tobio - Guests: 48 - Bots: 130Users: 36,620 (1,457 active)
Latest: Jcr_neep
Tip: Fix any errors you see before releasing any demos; "I'll fix it later" isn't a good excuse.Not logged in.
Fast3D Display List Commands
Forum Index - Non-SMW Hacking - Super Mario 64 Hacking - Fast3D Display List Commands
Pages: « 1 »
Here, I will explain as many display list commands as I can that are used in Fast3D, aka the graphics engine that is used by Super Mario 64. Geometry layouts point to these scripts. Your imported levels run on this code, your imported models run on this code, all graphics in general almost always run on this. Every command is 8 bytes long.

0x03 F3D_MOVEMEM
Used in Super Mario 64 to load vector normals (shading) RGB values.

Syntax:
03 aa 0000 bbcccccc
-aa: If 86, loads light values. If 88, loads dark values.
-bb: RAM bank value
-cccccc: RAM bank address

Example:
03 86 0000 0E 00 00 00
03 88 0000 0E 00 00 08
Loads light RGB from 0x0 in RAM bank 0x0E; loads dark RGB from 0x08 in RAM Bank 0x0E




0x04 F3D_VTX
Fills the vertex buffer with vertex information (ex. coordinates, color values)

Syntax:
04aabbbb ccdddddd
- aa: (bbbb -) Where to start writing vertices inside the vertex buffer
- bbbb: Amount of vertices to write (* 0x10)
- cc: RAM bank in which vertices are stored
- dddddd: Offset at which vertices are stored in RAM bank

Example:
04E000F0 0E000780: Load 15 (0xF0 / 0x10) vertices from 0x0E000780 - offset 0x780 inside bank 0x0E (current map data) - and put them into the vertex buffer, starting at position 0x10 (15 vertices - 14).

Max amount of bytes to load in F3D is 1 00 (16 vertices)




0x06 F3D_DL
Signifies the start of a Display List. May be used to link data and branch the current DL.

Syntax:
06000000 aabbbbbb
-aa: RAM Bank value
-bbbbbb: RAM Bank adress

Example:
06 00 00 00 07 00 0A 50 - Loads a display list from 0xA50 in bank 0x07.




0xB5 F3D_QUAD
Renders one quad according to the vertices inside the vertex buffer

Syntax:
B5aabbcc XXddeeff
- aa: First vertex to use for the quad (* 0x0A)
- bb: Second vertex to use for the quad (* 0x0A)
- cc: Third vertex to use for the quad (* 0x0A)
- XX: (unused)
- aa: Fourth vertex to use for the quad (* 0x0A)
- bb: Fifth vertex to use for the quad (* 0x0A)
- cc: Sixth vertex to use for the quad (* 0x0A)

Example:
B5000A14 0000141E: Render a quad using the vertex data specified at the vertex buffer positions 0, 1 (0x0A / 0x0A), 2 (0x14 / 0x0A), 0, 2 (0x14 / 0x0A) and 3 (0x1E / 0x0A).




0xB6 F3D_CLEARGEOMETRYMODE
Enables or disables certain geometry parameters (ex. lighting, front-/backface culling, Z-buffer). Used at start of Display List.

Syntax: B6000000 aaaaaaaa
-aaaaaaaa: Various parameters

Examples:
B6 00 00 00 00 02 20 00 - Vertex RGB, no culling
B6 00 00 00 00 02 00 00 - Vertex RGB, culling
B6 00 00 00 00 00 00 00 - No vertex RGB, culling
B6 00 00 00 00 00 22 00 - No vertex RGB, no culling




0xB7 F3D_SETGEOMETRYMODE
Enables or disables certain geometry parameters (ex. lighting, front-/backface culling, Z-buffer). Used at end of Display List.

Syntax: B7000000 aaaaaaaa
-aaaaaaaa: Various parameters

Examples:
B7 00 00 00 00 02 20 00 - Vertex RGB, no culling
B7 00 00 00 00 02 00 00 - Vertex RGB, culling
B7 00 00 00 00 00 00 00 - No vertex RGB, culling
B7 00 00 00 00 00 22 00 - No vertex RGB, no culling




0xB8 F3D_ENDDL
Terminates the current Display List

Usage:
B800000000000000



0xBB F3D_TEXTURE
Sets the texture scaling factor

Syntax: Unknown

Examples:
Standard: Set to BB 00 00 01 FF FF FF FF at start for 1 scaling.
Special case: Set to BB 00 00 01 0F 80 07 C0 at start for environment mapping.
Always reset to BB 00 00 00 FF FF FF FF at end of the DL to reset scale to 0.




0xBF F3D_TRI1
Renders one triangle according to the vertices inside the vertex buffer

Syntax:
BF XXXXXX aabbcc
- XXXXXXXX: (unused)
- aa: First vertex to use for the triangle (* 0x0A)
- bb: Second vertex to use for the triangle (* 0x0A)
- cc: Third vertex to use for the triangle (* 0x0A)

Example:
BF 000000 00 0A 14: Render a triangle using the vertex data specified at the vertex buffer positions 0, 1 (0x0A / 0x0A) and 2 (0x14 / 0x0A).




0xF2 G_SETTILESIZE
Sets the texture coordinates and size

Syntax: Unknown

Examples:
F2 00 00 00 00 07 C0 7C for 32x32 textures
F2 00 00 00 00 0F C0 7C for 64x32
F2 00 00 00 00 07 C0 FC for 32x64 textures




0xF3 G_LOADBLOCK
Determines how much data to load after SETTIMG

Syntax: Unknown

Examples:
F3 00 00 00 07 7F F1 00 for 32x64 or 64x32 RGBA Textures
F3 00 00 00 07 3F F1 00 for 32x32 RGBA Textures




0xF5 G_SETTILE
Sets the texture properties (ex. mirroring)

Syntax: Unknown

Examples:
F5 10 00 00 07 00 00 00 - Always loaded first for normal RGBA, followed by another F5 command
F5 70 00 00 07 00 00 00 - Always loaded first for Grayscale, followed by another F5 command
F5 10 10 00 07 01 40 50 - Normal for 32x32 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




0xF8 G_SETFOGCOLOR
Sets the fog color

Syntax:
F8 000000 RRGGBBAA? (AA is typically left FF)

Example:
F8 00 00 00 00 FF 00 FF - Will set the fog for the following polygons to pure green.




0xFB G_SETENVCOLOR
Sets the environment color for combiner

Syntax:
FB 000000 RRGGBBAA

Example:
FB 00 00 00 FF 00 00 8C - Will make everything loaded underneath the command red, and semi-transparent.




0xFC G_SETCOMBINE
Performs combining operations (ex. multi-texturing)

Syntax: Unknown

Examples:
FC 12 7F FF FF FF F8 38 - Standard usage for solid RGBA textures
FC 12 18 24 FF 33 FF FF - Standard usage for alpha RGBA textures




0xFD G_SETTIMG
Sets the texture image offset

Syntax:
FD100000 aabbbbbb
-aa: RAM bank value
-bbbbbb: RAM bank address

Example:
FD 10 00 00 04 00 00 90
Loads texture position from 0x90 in RAM bank 0x04


Vertex Structure

xxxxyyyyzzzz0000uuuuvvvvrrggbbaa
-xxxx: X Position of vertex
-yyyy: Y Position of vertex
-zzzz: Z Position of vertex
-uuuu: X texture stretch along vertex
-vvvv: Y texture stretch along vertex
-rr: Red channel of vertex, used for vertex colors and/or normals
-gg: Green channel of vertex, used for vertex colors and/or normals
-bb: Blue channel of vertex, used for vertex colors and/or normals
-aa: Alpha channel of vertex, used in vertex colors, ignored in vertex normals

Thanks to Spinout for several notes on F3DEX2, which I just translated to F3D.
Let me know if there are any errors, or commands that you want added.
Very well made. The coloring gives a good psychological effect and makes other people subconsciously recognize that THIS is clearly different from THIS. I do this with my tutorials too, especially when I write about MIPS and assembly:

ADDIU T0, T1, $269D

See, that looks way better than plain black text.

--------------------
Tarek701 is dead.
I wish I knew what all of this meant.
Looks very useful. With this I might be able to manually brighten my title screen (Kaze's replacer darkens it).

EDIT: I somehow managed to brighten my title screen by editing the last three bytes of the 0x03 commands to FF FF FF

--------------------
My Youtube Channel: youtube.com/user/flame8765
Skype: Flame8765
MK8 License:
Pages: « 1 »
Forum Index - Non-SMW Hacking - Super Mario 64 Hacking - Fast3D Display List Commands

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2018 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 21

Menu

Follow Us On

  • Facebook
  • Twitter
  • YouTube

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented