User Tools

Site Tools


f3dex2

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
f3dex2 [2018/05/03 06:40]
trenavix [05: G_TRI1]
f3dex2 [2020/02/26 14:17] (current)
jesusyoshi54 [01: G_VTX]
Line 1: Line 1:
  
 ====== Fast3DEX2 Display List Commands ====== ====== Fast3DEX2 Display List Commands ======
-The Fast3DEX2 display list commands are microcode that are passed to the RSP for rendering. ​The are all 8 bytes long.+The Fast3DEX2 display list commands are microcode that are passed to the RSP for rendering. ​They are all 8 bytes long.
  
 ===== Fast3DEX2 Commands ===== ===== Fast3DEX2 Commands =====
  
 ==== 00: G_SPNOOP ==== ==== 00: G_SPNOOP ====
-No operation. This should only be used for debugging purposes.+Stalls the signal processor (the RSP), and as a consequence,​ the RDP too. This should only be used for debugging purposes.
  
 ''​00 00 00 00 00 00 00 00''​ ''​00 00 00 00 00 00 00 00''​
Line 17: Line 17:
  
 | <color #​22b14c>​N</​color>​ | Number of vertices to write | | <color #​22b14c>​N</​color>​ | Number of vertices to write |
-| <color #​ed1c24>​I</​color>​ | Where to start writing vertices inside the vertex buffer (*2 + <color #​22b14c>​N</​color>​*2) |+| <color #​ed1c24>​I</​color>​ | Where to start writing vertices inside the vertex buffer (start = <color #​ed1c24>​II</​color>​ - <color #​22b14c>​N</​color>​*2) |
 | <color #​A946F2>​S</​color>​ | Segmented address to load vertices from | | <color #​A946F2>​S</​color>​ | Segmented address to load vertices from |
  
Line 102: Line 102:
  
 This formula cannot be reversed for the value provided in the microcode, since the necessary information is absent. (Since the values are provided in the macro call generating this opcode, there'​s no guarantee any of the values match what they'​re "​supposed"​ to be, e.g. //<color #​ed1c24>​near</​color>//​ could be set to something far different from the location of the actual near clipping plane.) This formula cannot be reversed for the value provided in the microcode, since the necessary information is absent. (Since the values are provided in the macro call generating this opcode, there'​s no guarantee any of the values match what they'​re "​supposed"​ to be, e.g. //<color #​ed1c24>​near</​color>//​ could be set to something far different from the location of the actual near clipping plane.)
 +
 +**Note:** This command works differently in F3DZEX.
 ---- ----
 ==== 05: G_TRI1 ==== ==== 05: G_TRI1 ====
Line 114: Line 116:
 Example: Render a triangle using the vertex data specified at the vertex buffer positions 0, 1 (0x02 / 0x02) and 2 (0x04 / 0x02). Example: Render a triangle using the vertex data specified at the vertex buffer positions 0, 1 (0x02 / 0x02) and 2 (0x04 / 0x02).
  
-  05 00 02 04 00 00 02 04+  05 00 02 04 00 00 00 00
  
 ---- ----
Line 200: Line 202:
 ''<​color #​c3c3c3>​xx</​color>​ = 00<color #​c400da>​LL L</​color><​color #​00a2e8>​ddd</​color>''​ ''<​color #​c3c3c3>​xx</​color>​ = 00<color #​c400da>​LL L</​color><​color #​00a2e8>​ddd</​color>''​
  
-| <color #​ff7f27>​n</​color>​ | Enable/​Disable Tile Descriptor (1=enable, 0=disable) |+| <color #​ff7f27>​n</​color>​ | Enable/​Disable Tile Descriptor (__**2**__=enable, 0=disable) |
 | <color #​ed1c24>​s</​color>​ | Scaling factor for S axis (horizontal) | | <color #​ed1c24>​s</​color>​ | Scaling factor for S axis (horizontal) |
 | <color #​22b14c>​t</​color>​ | Scaling factor for T axis (vertical) | | <color #​22b14c>​t</​color>​ | Scaling factor for T axis (vertical) |
Line 209: Line 211:
  
 Examples: Examples:
-  D7 00 00 01 FF FF FF FF : Standard - at start for extremely close to 1 scaling enabled on tile desc 0. +  D7 00 00 02 FF FF FF FF : Standard - at start for extremely close to 1 scaling enabled on tile desc 0. 
-  D7 00 00 01 80 00 80 00 : Standard - at start for 0.5 scaling enabled on tile desc 0. +  D7 00 00 02 80 00 80 00 : Standard - at start for 0.5 scaling enabled on tile desc 0. 
-  D7 00 00 01 0F 80 07 C0 : Scale for environment mapping 64x32 and enable tile desc 0.+  D7 00 00 02 0F 80 07 C0 : Scale for environment mapping 64x32 and enable tile desc 0.
   D7 00 00 00 FF FF FF FF : Disable tile descriptor 0 (end of DL).   D7 00 00 00 FF FF FF FF : Disable tile descriptor 0 (end of DL).
  
Line 221: Line 223:
 ''​D8380002 <color #​00a2e8>​aaaaaaaa</​color>''​ ''​D8380002 <color #​00a2e8>​aaaaaaaa</​color>''​
  
-| <color #​00a2e8>​a</​color>​ | The number of matrices to pop |+| <color #​00a2e8>​a</​color>​ | (The number of matrices to pop) * 64|
  
 ---- ----
Line 230: Line 232:
 ''​D9 [<color #​22b14c>​CC CC CC</​color>​] [<color purple>​SS SS SS SS</​color>​]''​ ''​D9 [<color #​22b14c>​CC CC CC</​color>​] [<color purple>​SS SS SS SS</​color>​]''​
  
-| <color #​22b14c>​C</​color>​ | Various parameters to clear |+| <color #​22b14c>​C</​color>​ | ~(Various parameters to clear|
 | <color purple>​S</​color>​ | Various parameters to set | | <color purple>​S</​color>​ | Various parameters to set |
 +
 +Note: Parameters that are cleared have their bits inverted in the opcode. FF FF FF, for example, would disable nothing.
  
 Parameters:​\\ ​ Parameters:​\\ ​
Line 241: Line 245:
 Apply transformation matrix. Used in HUD text printing code to translate textures, as well as copious other transformations including animations. Apply transformation matrix. Used in HUD text printing code to translate textures, as well as copious other transformations including animations.
  
-''​DA [<color darkred>​PP</​color>​] ​00 00 [<color purple>​AA AA AA AA</​color>​]''​+''​DA ​38 00 [<color darkred>​PP</​color>​] [<color purple>​AA AA AA AA</​color>​]''​
  
-| <color darkred>​P</​color>​ | Parameters |+| <color darkred>​P</​color>​ | Parameters ​**^** G_MTX_PUSH ​|
 | <color purple>​A</​color>​ | Segmented address of vectors | | <color purple>​A</​color>​ | Segmented address of vectors |
  
 Parameters (can be OR'd together): Parameters (can be OR'd together):
-0x01 | projection (default: model view) |+0x04 | projection (default: model view) |
 | 0x02 | load (default: multiply) | | 0x02 | load (default: multiply) |
-0x04 | push (default: no push) |+0x01 | push (default: no push) |
  
 Example: Push matrix and and multiply by matrix at 0x00213DF8; Multiply by matrix at 0x00213DB8 Example: Push matrix and and multiply by matrix at 0x00213DF8; Multiply by matrix at 0x00213DB8
-  DA 04 00 40 00 21 3D F8 +  DA 38 00 00 00 21 3D F8 
-  DA 00 00 40 00 21 3D B8+  DA 38 00 01 00 21 3D B8
  
 ---- ----
Line 337: Line 341:
  
 ==== E0: G_NOOP ==== ==== E0: G_NOOP ====
-Does nothing. Seemingly different from 00; judging by the names of this opcode and 00, this opcode stalls the RSP, whereas the other stalls the RDP.+Does nothing. Seemingly different from 00; judging by the names and position ​of this opcode and 00, this opcode stalls the RDP, whereas the other stalls the RSP.
  
 ''​E0 00 00 00 00 00 00 00''​ ''​E0 00 00 00 00 00 00 00''​
Line 359: Line 363:
 ''​E2 00 [<color #​ed1c24>​ss</​color>​] [<color #​22b14c>​nn</​color>​] [<color #​00a2e8>​dd dd dd dd</​color>​]''​ ''​E2 00 [<color #​ed1c24>​ss</​color>​] [<color #​22b14c>​nn</​color>​] [<color #​00a2e8>​dd dd dd dd</​color>​]''​
  
-| <color #​ed1c24>​s</​color>​ | Amount mode-bits are shifted by, or number ​of LSb of mode bits to be changed ​+| <color #​ed1c24>​s</​color>​ | 32 - (Amount mode-bits are shifted by) - (Number ​of bits affected) ​
-| <color #​22b14c>​n</​color>​ | Number of mode-bits affected |+| <color #​22b14c>​n</​color>​ | (Number of mode-bits affected) - 1 |
 | <color #​00a2e8>​d</​color>​ | Mode-bits | | <color #​00a2e8>​d</​color>​ | Mode-bits |
  
Line 383: Line 387:
 ''​E3 00 [<color #​ed1c24>​ss</​color>​] [<color #​22b14c>​nn</​color>​] [<color #​00a2e8>​dd dd dd dd</​color>​]''​ ''​E3 00 [<color #​ed1c24>​ss</​color>​] [<color #​22b14c>​nn</​color>​] [<color #​00a2e8>​dd dd dd dd</​color>​]''​
  
-| <color #​ed1c24>​s</​color>​ | Amount mode-bits are shifted by, or number ​of LSb of mode bits to be changed ​+| <color #​ed1c24>​s</​color>​ | 32 - (Amount mode-bits are shifted by) - (Number ​of bits affected) ​
-| <color #​22b14c>​n</​color>​ | Number of mode-bits affected |+| <color #​22b14c>​n</​color>​ | (Number of mode-bits affected) - 1 |
 | <color #​00a2e8>​d</​color>​ | Mode-bits | | <color #​00a2e8>​d</​color>​ | Mode-bits |
  
Line 416: Line 420:
  
 ''​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>​]''​\\ ''​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>​]''​\\
-''​F1 00 00 00 [<color #​BF9F00>​SS SS</​color>​] [<color #​8F3F10>​TT TT</​color>​]''​\\ +''​E1 00 00 00 [<color #​BF9F00>​SS SS</​color>​] [<color #​8F3F10>​TT TT</​color>​]''​\\ 
-''​02 00 00 00 [<color #​3F3FFF>​DD DD</​color>​] [<color darkcyan>​EE EE</​color>​]''​+''​F1 00 00 00 [<color #​3F3FFF>​DD DD</​color>​] [<color darkcyan>​EE EE</​color>​]''​
  
 | <color darkred>​xxx</​color>​ | Lower-right corner X coordinate | | <color darkred>​xxx</​color>​ | Lower-right corner X coordinate |
Line 435: Line 439:
  
 ''​E5 [<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>​]''​\\ ''​E5 [<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>​]''​\\
-''​F1 00 00 00 [<color #​BF9F00>​SS SS</​color>​] [<color #​8F3F10>​TT TT</​color>​]''​\\ +''​E1 00 00 00 [<color #​BF9F00>​SS SS</​color>​] [<color #​8F3F10>​TT TT</​color>​]''​\\ 
-''​02 00 00 00 [<color #​3F3FFF>​DD DD</​color>​] [<color darkcyan>​EE EE</​color>​]''​+''​F1 00 00 00 [<color #​3F3FFF>​DD DD</​color>​] [<color darkcyan>​EE EE</​color>​]''​
  
 | <color darkred>​xxx</​color>​ | Lower-right corner X coordinate | | <color darkred>​xxx</​color>​ | Lower-right corner X coordinate |
Line 533: Line 537:
 Sets the scissoring rectangle. Sets the scissoring rectangle.
  
-''​ED [<color #​00a2e8>​xx x</​color>​][<​color #​22b14c>​y yy</​color>​] [<color #​ff7f27>​m</​color>​][<color #​ed1c24>​vv v</​color>​][<​color #​B755FF>​w ww</​color>​]''​+''​ED [<color #​00a2e8>​xx x</​color>​][<​color #​22b14c>​y yy</​color>​] ​0[<color #​ff7f27>​m</​color>​] [<color #​ed1c24>​vv v</​color>​][<​color #​B755FF>​w ww</​color>​]''​
  
 | <color #​00a2e8>​x</​color>​ | Upper-left X coordinate of rectangle | | <color #​00a2e8>​x</​color>​ | Upper-left X coordinate of rectangle |
Line 567: Line 571:
 | <color #​00a2e8>​L</​color>​ | Settings for other mode lower word bits | | <color #​00a2e8>​L</​color>​ | Settings for other mode lower word bits |
  
-<color #​ff7f27>​H</​color>​ is similar to using BA, and <color #​00a2e8>​L</​color>​ is similar to using B9.+<color #​ff7f27>​H</​color>​ is similar to using E3, and <color #​00a2e8>​L</​color>​ is similar to using E2.
  
-The difference from either ​BA or B9 is that this command sets all the bits in both halves of the RDP word (that is, this opcode has no way of limiting what bits are actually affected).+The difference from either ​E3 or E2 is that this command sets all the bits in both halves of the RDP word (that is, this opcode has no way of limiting what bits are actually affected).
  
 The RSP Geometry Mode word bits' parameters can be found [[https://​hack64.net/​wiki/​doku.php?​id=rcpstructs#​setothermode|under the RCP structs page.]] The RSP Geometry Mode word bits' parameters can be found [[https://​hack64.net/​wiki/​doku.php?​id=rcpstructs#​setothermode|under the RCP structs page.]]
Line 584: Line 588:
  
 (Note: the count is quadrupled likely due to how palettes are stored in TMEM. Not sure where details on that would be appropriate,​ though.) (Note: the count is quadrupled likely due to how palettes are stored in TMEM. Not sure where details on that would be appropriate,​ though.)
 +----
 +
 +==== F1: G_RDPHALF_2 ====
 +This opcode sets the low half of the generic RDP word.
 +
 +''​F1 00 00 00 [<color #​ff7f27>​LL LL LL LL</​color>​]''​
 +
 +| <color #​ff7f27>​L</​color>​ | New value of low word |
 +
 +Note: the referenced function also generates opcode E1. See the section on E1 for info on that.
 +
 ---- ----
  
Line 589: Line 604:
 Sets the texture coordinates and size Sets the texture coordinates and size
  
-''​F2 ​00 00 00 00 [<color darkred>​WW W</​color>​][<​color ​darkgreen>H HH</​color>​]''​+''​F2 [<color darkred>SS S</​color>​][<​color darkgreen>​T TT</​color>​] 0[<color #​00a2e8>​I</​color>​] [<color purple>WW W</​color>​][<​color ​darkcyan>H HH</​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 #​00a2e8>​I</​color>​ | Tile descriptor to load into |
 | <color darkred>​W</​color>​ | (width - 1) << 2 | | <color darkred>​W</​color>​ | (width - 1) << 2 |
-| <color darkgreen>​H</​color>​ | (hieght ​- 1) << 2 |+| <color darkgreen>​H</​color>​ | (height ​- 1) << 2 | 
  
 Examples: Examples:
f3dex2.1525329625.txt.gz · Last modified: 2018/05/03 06:40 by trenavix