Changes

Jump to navigation Jump to search
905 bytes removed ,  19:20, 10 October 2014
Identify commands by their ID, not by some random header they are used with.
Line 30: Line 30:  
=== Parameter masking ===
 
=== Parameter masking ===
   −
Using a value other than 0xF, parts of a word in internal GPU memory can be updated without touching the other bits of it. For example, setting bit 16 to zero indicates that the least significant byte of the parameter will not be overwritten, setting bit 17 to zero indicates that the parameter's second LSB will not be overwritten, etc. This means that for instance commands 0x00020107 and 0x00010107 refer to the same thing but write different parts of the parameter.
+
Using a value other than 0xF, parts of a word in internal GPU memory can be updated without touching the other bits of it. For example, setting bit 16 to zero indicates that the least significant byte of the parameter will not be overwritten, setting bit 17 to zero indicates that the parameter's second LSB will not be overwritten, etc. This means that for instance commands 0x00010107 and 0x00020107 refer to the same thing but write different parts of the parameter.
   −
=== Commands ===
+
=== Command IDs ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  CommandID
 
!  CommandID
Line 38: Line 38:  
!  Description
 
!  Description
 
|-
 
|-
| 0x000F0010
+
| 0x0010
 
| Value is 0x12345678
 
| Value is 0x12345678
 
| This command is always the last command in the buffer.
 
| This command is always the last command in the buffer.
 
|-
 
|-
| 0x000F0110
+
| 0x0110
 
| Value 0x1
 
| Value 0x1
| This command is immediately before CmdID 0x000F0010, this is also used elsewhere for beginning rendering of mesh(es) as well.
+
| This command is immediately before command 0x0010, this is also used elsewhere for beginning rendering of mesh(es) as well.
 
|-
 
|-
| 0x000F0111
+
| 0x0111
 
| Value 0x1
 
| Value 0x1
| This command is immediately before CmdID 0x000F0110, however CmdID 0x000F0110 doesn't always follow this command.
+
| This command is immediately before command 0x0110, however command 0x0110 doesn't always follow this command.
 
|-
 
|-
| 0x000F0040
+
| 0x0040
 
| u32, valid values are 0x1 and 0x2, values 0x0 and 0x3 have the same effect as value 0x2. Only bits 1-0 are used.
 
| u32, valid values are 0x1 and 0x2, values 0x0 and 0x3 have the same effect as value 0x2. Only bits 1-0 are used.
 
| Value 2 = GL_FRONT/GL_CW or GL_BACK/GL_CCW. Value 1 = GL_FRONT/GL_CCW or GL_BACK/GL_CW.
 
| Value 2 = GL_FRONT/GL_CW or GL_BACK/GL_CCW. Value 1 = GL_FRONT/GL_CCW or GL_BACK/GL_CW.
 
|-
 
|-
| 0x000F0041
+
| 0x0041
 
| float24
 
| float24
| VIEWPORT_WIDTH. See command set 0x000F0041.
+
| VIEWPORT_WIDTH. See command set 0x0041.
 
|-
 
|-
| 0x000F0042
+
| 0x0042
 
| float32
 
| float32
| VIEWPORT_WIDTH_INV. See command set 0x000F0041.
+
| VIEWPORT_WIDTH_INV. See command set 0x0041.
 
|-
 
|-
| 0x000F0043
+
| 0x0043
 
| float24
 
| float24
| VIEWPORT_HEIGHT. See command set 0x000F0041.
+
| VIEWPORT_HEIGHT. See command set 0x0041.
 
|-
 
|-
| 0x000F0044
+
| 0x0044
 
| float32
 
| float32
| VIEWPORT_HEIGHT_INV. See command set 0x000F0041.
+
| VIEWPORT_HEIGHT_INV. See command set 0x0041.
 
|-
 
|-
| 0x801F004D
+
| 0x004D
 
|  
 
|  
| See command set 0x801F004D.
+
| See command set 0x004D.
 
|-
 
|-
| 0x000F0068
+
| 0x0068
 
| u32
 
| u32
| VIEWPORT Y/X. See command set 0x000F0041.
+
| VIEWPORT Y/X. See command set 0x0041.
 
|-
 
|-
| 0x000F006D
+
| 0x006D
 
|  
 
|  
| See command set 0x801F004D.
+
| See command set 0x004D.
 
|-
 
|-
| 0x000F006E
+
| 0x006E
 
| u32
 
| u32
| See command set 0x000F0111.
+
| See command set 0x0111.
 
|-
 
|-
| 0x00010080
+
| 0x0080
 
| u32
 
| u32
| See command set 0x00030080.
+
| See command set 0x0080.
 
|-
 
|-
| 0x00030080
+
| 0x0081
| u32
  −
| See command set 0x00030080.
  −
|-
  −
| 0x00040080
  −
| u32
  −
| See command set 0x00030080.
  −
|-
  −
| 0x809F0081
   
|  
 
|  
 
| This is used to set the current texture info used for rendering, see command set [[GPU_Textures|0x809F0081]].
 
| This is used to set the current texture info used for rendering, see command set [[GPU_Textures|0x809F0081]].
 
|-
 
|-
| 0x000F008E
+
| 0x008E
 
| u32 color type
 
| u32 color type
 
| This command sets the texture color type, see command set [[GPU_Textures|0x809F0081]].
 
| This command sets the texture color type, see command set [[GPU_Textures|0x809F0081]].
 
|-
 
|-
| 0x805F0091
+
| 0x0091
 
|  
 
|  
 
| This sets current texture info, see command [[GPU_Textures|0x805F0091]].
 
| This sets current texture info, see command [[GPU_Textures|0x805F0091]].
 
|-
 
|-
| 0x805F0099
+
| 0x0099
 
|  
 
|  
 
| This sets current texture info, see command [[GPU_Textures|0x805F0099]].
 
| This sets current texture info, see command [[GPU_Textures|0x805F0099]].
 
|-
 
|-
| 0x800F00C3
+
| 0x00C3
 
| val<<24
 
| val<<24
 
| Val is usually 0xFF or 0x00, however 0x00-0xFF is valid as well. This is alpha-blending related?
 
| Val is usually 0xFF or 0x00, however 0x00-0xFF is valid as well. This is alpha-blending related?
 
|-
 
|-
| 0x800F00CB
+
| 0x00CB
 
| val<<24
 
| val<<24
 
| Val is usually 0xFF or 0x00, however 0x00-0xFF is valid as well. This is alpha-blending related?
 
| Val is usually 0xFF or 0x00, however 0x00-0xFF is valid as well. This is alpha-blending related?
 
|-
 
|-
| 0x80XF00C0
+
| 0x00C0
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x800F00C4
+
| 0x00C4
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x80XF00C8
+
| 0x00C8
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x800F00CC
+
| 0x00CC
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x80XF00D0
+
| 0x00D0
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x800F00D4
+
| 0x00D4
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x80XF00D8
+
| 0x00D8
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x800F00DC
+
| 0x00DC
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x80XF00F0
+
| 0x00F0
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x800F00F4
+
| 0x00F4
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x80XF00F8
+
| 0x00F8
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x800F00FC
+
| 0x00FC
 
|  
 
|  
| See command set 0x80XF00C0.
+
| See command set 0x00C0.
 
|-
 
|-
| 0x000100E0
+
| 0x00E0
 
| Normally value zero.
 
| Normally value zero.
 
| Unknown, fragment related?
 
| Unknown, fragment related?
 
|-
 
|-
| 0x000500E0
+
| 0x00E0
 
|  
 
|  
| See command set 0x000500E0.
+
| See command set 0x00E0.
 
|-
 
|-
| 0x000F00E1
+
| 0x00E1
 
|  
 
|  
| See command set 0x000500E0.
+
| See command set 0x00E0.
 
|-
 
|-
| 0x000F00E6
+
| 0x00E6
 
| Value zero
 
| Value zero
| See command set 0x000F00E6.
+
| See command set 0x00E6.
 
|-
 
|-
| 0x000F00E8
+
| 0x00E8
 
|  
 
|  
| See command set 0x000F00E6.
+
| See command set 0x00E6.
 
|-
 
|-
| 0x00020100
+
| 0x0100
 
| u32, value is 0x00E40100
 
| u32, value is 0x00E40100
| See command set 0x00020100.
+
| See command set 0x0100.
 
|-
 
|-
| 0x000D0100
+
| 0x0100
 
| <nowiki>0x00E40000 | val</nowiki>.
 
| <nowiki>0x00E40000 | val</nowiki>.
 
| Val0 = unknown, val1 = unknown, val3 = unknown. The default val used here is 0.
 
| Val0 = unknown, val1 = unknown, val3 = unknown. The default val used here is 0.
 
|-
 
|-
| 0x000F0101
+
| 0x0101
 
| u32
 
| u32
| See command set 0x00020100.
+
| See command set 0x0100.
 
|-
 
|-
| 0x000F0103
+
| 0x0103
 
|  
 
|  
| See command set 0x00020100.
+
| See command set 0x0100.
 
|-
 
|-
| 0x000F0104
+
| 0x0104
 
| u32
 
| u32
 
| glAlphaFunc()
 
| glAlphaFunc()
 
|-
 
|-
| 0x00010107
+
| 0x0107
 
|  
 
|  
| See command set CmdID 0x00010107.
+
| See command set command 0x0107.
 
|-
 
|-
| 0x00020107
+
| 0x0107
 
|  
 
|  
| See command set CmdID 0x00010107.
+
| See command set command 0x0107.
 
|-
 
|-
| 0x00030107
+
| 0x0107
 
|  
 
|  
| See command set CmdID 0x00030107.
+
| See command set command 0x0107.
 
|-
 
|-
| 0x000F0116
+
| 0x0116
 
| u32
 
| u32
| DEPTHBUFFER FORMAT. See command set 0x000F0111.
+
| DEPTHBUFFER FORMAT. See command set 0x0111.
 
|-
 
|-
| 0x000F0117
+
| 0x0117
 
| u32
 
| u32
| COLORBUFFER FORMAT/PIXEL. See command set 0x000F0111.
+
| COLORBUFFER FORMAT/PIXEL. See command set 0x0111.
 
|-
 
|-
| 0x000F011C
+
| 0x011C
 
| Physical address>>3
 
| Physical address>>3
| DEPTHBUFFER ADDRESS. See command set 0x000F0111.
+
| DEPTHBUFFER ADDRESS. See command set 0x0111.
 
|-
 
|-
| 0x000F011D
+
| 0x011D
 
| Physical address>>3
 
| Physical address>>3
| COLORBUFFER ADDRESS. See command set 0x000F0111.
+
| COLORBUFFER ADDRESS. See command set 0x0111.
 
|-
 
|-
| 0x000F011E
+
| 0x011E
 
| u32
 
| u32
| COLORBUFFER HEIGHT/WIDTH. See command set 0x000F0111.
+
| COLORBUFFER HEIGHT/WIDTH. See command set 0x0111.
 
|-
 
|-
| 0x803F0112
+
| 0x0112
 
|  
 
|  
 
| ?
 
| ?
 
|-
 
|-
| 0x826F0200
+
| 0x0200
 
|  
 
|  
 
| See command set [[GPU_GL_Arrays|0x826F0200]].
 
| See command set [[GPU_GL_Arrays|0x826F0200]].
 
|-
 
|-
| 0x00080126
+
| 0x0126
 
|  
 
|  
| See command set CmdID 0x00030107.
+
| See command set command 0x0107.
 
|-
 
|-
| 0x000F0227
+
| 0x0227
 
| u32
 
| u32
 
| This specifies the address of an array containing vertex array indices, and the data-type of the indices, used for rendering primitives. See command set [[GPU_GL_Arrays|glDrawElements()]].
 
| This specifies the address of an array containing vertex array indices, and the data-type of the indices, used for rendering primitives. See command set [[GPU_GL_Arrays|glDrawElements()]].
 
|-
 
|-
| 0x000F0228
+
| 0x0228
 
| u32 total elements in the array to use for rendering.
 
| u32 total elements in the array to use for rendering.
 
| See command set [[GPU_GL_Arrays|glDrawElements()]].
 
| See command set [[GPU_GL_Arrays|glDrawElements()]].
 
|-
 
|-
| 0x803F0232
+
| 0x0232
 
|  
 
|  
 
| See command set [[GPU_GL_Arrays|0x826F0200]].
 
| See command set [[GPU_GL_Arrays|0x826F0200]].
 
|-
 
|-
| 0x0002025E
+
| 0x025E
 
| u32, val<<8.
 
| u32, val<<8.
 
| This sets the GL rendering mode, see command set [[GPU_GL_Arrays|0x826F0200]].
 
| This sets the GL rendering mode, see command set [[GPU_GL_Arrays|0x826F0200]].
 
|-
 
|-
| 0x000F02B0
+
| 0x02B0
 
| u32, value is <nowiki>0x7FFF0000 | val</nowiki>.
 
| u32, value is <nowiki>0x7FFF0000 | val</nowiki>.
 
| Texture related?
 
| Texture related?
 
|-
 
|-
| 0x801F02BB
+
| 0x02BB
 
|  
 
|  
 
| See command set [[GPU_GL_Arrays|0x826F0200]].
 
| See command set [[GPU_GL_Arrays|0x826F0200]].
 
|-
 
|-
| 0x000F02BA
+
| 0x02BA
 
| <nowiki>0x7FFF0000 | entrypoint offset</nowiki>
 
| <nowiki>0x7FFF0000 | entrypoint offset</nowiki>
 
| Sets the entrypoint offset for the shader program
 
| Sets the entrypoint offset for the shader program
 
|-
 
|-
| 0x000F02C0
+
| 0x02C0
 
| <nowiki>0x80000000 | Type</nowiki>
 
| <nowiki>0x80000000 | Type</nowiki>
| This is used immediately before CmdID 0xXXXF02C1. This type field controls the command parameter buffer type. This command can also be used to send over (float24 only ?) data directly, without using 0xXXXF02C1. In that case, the first parameter is still Type but with bit 31 not set; the actual data follows.
+
| This is used immediately before command 0xXXXF02C1. This type field controls the command parameter buffer type. This command can also be used to send over (float24 only ?) data directly, without using 0xXXXF02C1. In that case, the first parameter is still Type but with bit 31 not set; the actual data follows.
 
|-
 
|-
| 0xXXXF02C1
+
| 0x02C1
 
| First word in the first entry
 
| First word in the first entry
 
| A list of entries follow this command.
 
| A list of entries follow this command.
 
|-
 
|-
| 0x000F02CB
+
| 0x02CB
 
| Value 0x0 ?
 
| Value 0x0 ?
| This is used immediately before CmdID 0xXXXF02CC. It is used to indicate that shader program data will follow.
+
| This is used immediately before command 0xXXXF02CC. It is used to indicate that shader program data will follow.
 
|-
 
|-
| 0xXXXF02CC
+
| 0x02CC
 
| First word of shader program data chunk.
 
| First word of shader program data chunk.
 
| This command is used to transfer shader program data (as the parameter data). It can be called multiple times in a row if the shader program is too big to fit into a single call.
 
| This command is used to transfer shader program data (as the parameter data). It can be called multiple times in a row if the shader program is too big to fit into a single call.
 
|-
 
|-
| 0x000F02BF
+
| 0x02BF
 
| Value 0x1 ?
 
| Value 0x1 ?
| This is used immediately after a set of CmdID 0xXXXF02CC. It is used to indicate that shader program data transfer is complete.
+
| This is used immediately after a set of command 0xXXXF02CC. It is used to indicate that shader program data transfer is complete.
 
|-
 
|-
| 0x000F02D5
+
| 0x02D5
 
| Value 0x0 ?
 
| Value 0x0 ?
| This is used immediately before CmdID 0xXXXF02d6.
+
| This is used immediately before command 0xXXXF02d6.
 
|-
 
|-
| 0xXXXF02D6
+
| 0x02D6
 
| First entry.
 
| First entry.
 
| This is used to send over the shader program operand descriptor table.
 
| This is used to send over the shader program operand descriptor table.
 
|-
 
|-
| 0x000F004F
+
| 0x004F
 
| Number of shader output attributes
 
| Number of shader output attributes
 
| Sets number of shader output attributes
 
| Sets number of shader output attributes
 
|-
 
|-
| 0x000F0050
+
| 0x0050
 
| First entry
 
| First entry
 
| This command is used to setup shader output registers. The n-th word-long entry is a map of the (n*2)-th output register's components. Each byte of each entry corresponds to where a component is mapped. Value 0x1F indicates that the corresponding component is unused.
 
| This command is used to setup shader output registers. The n-th word-long entry is a map of the (n*2)-th output register's components. Each byte of each entry corresponds to where a component is mapped. Value 0x1F indicates that the corresponding component is unused.
Line 327: Line 319:  
The GPU does not have dedicated commands for clearing the color buffer, therefore applications implement color buffer clearing by rendering a quad. Applications normally store this vertex and color [[GPU_GL_Arrays|array]] in the GSP application heap.
 
The GPU does not have dedicated commands for clearing the color buffer, therefore applications implement color buffer clearing by rendering a quad. Applications normally store this vertex and color [[GPU_GL_Arrays|array]] in the GSP application heap.
   −
===== CmdID 0x809F0081 =====
+
===== Command 0x0081 =====
 
This sets current texture info, see [[GPU Textures|GPU textures]].
 
This sets current texture info, see [[GPU Textures|GPU textures]].
   −
===== CmdID 0x00030080 =====
+
===== Command 0x0080 =====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Command Index
 
!  Command Index
Line 338: Line 330:  
|-
 
|-
 
| 0
 
| 0
| 0x00030080
+
| 0x0080
 
| <nowiki>0x11000 | val</nowiki>, where only bits 2-1 are used in val.
 
| <nowiki>0x11000 | val</nowiki>, where only bits 2-1 are used in val.
| bit0 enables/disables texturing
  −
|-
  −
| 0
  −
| 0x00040080
  −
| Same value as CmdID 0x00030080.
  −
| ?
  −
|-
  −
| 0
  −
| 0x00010080
  −
| Same value as CmdID 0x00030080.
   
| bit0 enables/disables texturing
 
| bit0 enables/disables texturing
 
|}
 
|}
   −
===== CmdID 0x80XF00C0 =====
+
===== Command 0x00C0 =====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Command Index
 
!  Command Index
Line 361: Line 343:  
|-
 
|-
 
| 0
 
| 0
| <nowiki>0x802F0000 | SlotCmdID</nowiki>
+
| <nowiki>SlotCmdID</nowiki>
 
|  
 
|  
 
|  
 
|  
 
|-
 
|-
 
| 1
 
| 1
| <nowiki>0x800F0000 | SlotCmdID + 4</nowiki>
+
| <nowiki>SlotCmdID + 4</nowiki>
 
|  
 
|  
 
|  
 
|  
 
|}
 
|}
   −
This is used for glTexEnv(), for the slot indicated by the CmdID. There's a total of 6 slots, where each slot corresponds to the following u16 CmdIDs: 0xC0, 0xC8, 0xD0, 0xD8, 0xF0, 0xF8.
+
This is used for glTexEnv(), for the slot indicated by the command id. There's a total of 6 slots, where each slot corresponds to the following u16 command ids: 0xC0, 0xC8, 0xD0, 0xD8, 0xF0, 0xF8.
   −
===== CmdID 0x000500E0 =====
+
===== Command 0x00E0 =====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Command Index
 
!  Command Index
Line 381: Line 363:  
|-
 
|-
 
| 0
 
| 0
| 0x000500E0
+
| 0x00E0
 
| <nowiki>5 | val<<16</nowiki>, where val is 0 or 1.
 
| <nowiki>5 | val<<16</nowiki>, where val is 0 or 1.
 
| Val0 = enable, val1 = disable.
 
| Val0 = enable, val1 = disable.
 
|-
 
|-
 
| 1
 
| 1
| 0x000F00E1
+
| 0x00E1
 
|  
 
|  
 
| This specifies a color.
 
| This specifies a color.
Line 393: Line 375:  
This is usually used immediately after command set glDrawElements(). This is used to specify a color used for blending?
 
This is usually used immediately after command set glDrawElements(). This is used to specify a color used for blending?
   −
===== CmdID 0x000F00E6 =====
+
===== Command 0x00E6 =====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Command Index
 
!  Command Index
Line 401: Line 383:  
|-
 
|-
 
| 0
 
| 0
| 0x000F00E6
+
| 0x00E6
 
| Value 0
 
| Value 0
 
| ?
 
| ?
 
|-
 
|-
 
| 1
 
| 1
| 0x000F00E8
+
| 0x00E8
 
|  
 
|  
 
|  
 
|  
 
|}
 
|}
   −
This is usually the last command set used for rendering a mesh, when command set 0x000500E0 was used. This command set is used immediately after command set 0x000500E0.
+
This is usually the last command set used for rendering a mesh, when command set 0x00E0 was used. This command set is used immediately after command set 0x00E0.
   −
===== CmdID 0x00020100 =====
+
===== Command 0x0100 =====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Command Index
 
!  Command Index
Line 421: Line 403:  
|-
 
|-
 
| 0
 
| 0
| 0x00020100
+
| 0x0100
 
| Value 0x00E40100
 
| Value 0x00E40100
 
| ?
 
| ?
 
|-
 
|-
 
| 1
 
| 1
| 0x000F0101
+
| 0x0101
 
| 0x01010000 when disabled?
 
| 0x01010000 when disabled?
 
| ?
 
| ?
 
|-
 
|-
 
| 2
 
| 2
| 0x000F0103
+
| 0x0103
| This is set to zero when the Cmd 0x000F0101 parameter is value 0x01010000.
+
| This is set to zero when the command 0x0101 parameter is value 0x01010000.
 
| ?
 
| ?
 
|}
 
|}
Line 438: Line 420:  
This is fragment related?
 
This is fragment related?
   −
===== CmdID 0x801F004D =====
+
===== Command 0x004D =====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Command Index
 
!  Command Index
Line 446: Line 428:  
|-
 
|-
 
| 0
 
| 0
| 0x801F004D
+
| 0x004D
 
|  
 
|  
 
| glDepthRange()
 
| glDepthRange()
 
|-
 
|-
 
| 1
 
| 1
| 0x000F006D
+
| 0x006D
 
| 0 = unknown, 1 = unknown.
 
| 0 = unknown, 1 = unknown.
 
| Value zero causes the mesh to not be rendered.
 
| Value zero causes the mesh to not be rendered.
 
|}
 
|}
   −
===== CmdID 0x000F0041 =====
+
===== Command 0x0041 =====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Command Index
 
!  Command Index
Line 464: Line 446:  
|-
 
|-
 
| 0
 
| 0
| 0x000F0041
+
| 0x0041
 
| float
 
| float
 
| This corresponds to the framebuffer width.
 
| This corresponds to the framebuffer width.
 
|-
 
|-
 
| 1
 
| 1
| 0x000F0043
+
| 0x0043
 
| float
 
| float
| This parameter value is calculated the same way as the CmdID 0x000F0041 parameter, except the framebuffer height is used instead.
+
| This parameter value is calculated the same way as the command 0x0041 parameter, except the framebuffer height is used instead.
 
|-
 
|-
 
| 2
 
| 2
| 0x000F0042
+
| 0x0042
 
| float
 
| float
 
| This corresponds to the framebuffer width.
 
| This corresponds to the framebuffer width.
 
|-
 
|-
 
| 3
 
| 3
| 0x000F0044
+
| 0x0044
 
| float
 
| float
| This parameter value value is calculated the same way as the CmdID 0x000F0042 parameter, except the framebuffer height is used instead.
+
| This parameter value value is calculated the same way as the command 0x0042 parameter, except the framebuffer height is used instead.
 
|-
 
|-
 
| 4
 
| 4
| 0x000F0068
+
| 0x0068
 
| u32
 
| u32
 
| This sets the X/Y coordinates used for glViewport().
 
| This sets the X/Y coordinates used for glViewport().
Line 491: Line 473:  
This command set initializes the projection matrix. This command set is used twice when beginning rendering for each screen. The framebuffer width used here for the main screen is 240, however this is 480 with stereoscopy enabled for the second time this command set is used.
 
This command set initializes the projection matrix. This command set is used twice when beginning rendering for each screen. The framebuffer width used here for the main screen is 240, however this is 480 with stereoscopy enabled for the second time this command set is used.
   −
===== CmdID 0x000F0111 =====
+
===== Command 0x0111 =====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Command Index
 
!  Command Index
Line 499: Line 481:  
|-
 
|-
 
| 0
 
| 0
| 0x000F0111
+
| 0x0111
 
| Value 1
 
| Value 1
 
|  
 
|  
 
|-
 
|-
 
| 1
 
| 1
| 0x000F0110
+
| 0x0110
 
| Value 1
 
| Value 1
 
|  
 
|  
 
|-
 
|-
 
| 2
 
| 2
| 0x000F0117
+
| 0x0117
 
| Bits15-0 = unk, 31-16 = unk.
 
| Bits15-0 = unk, 31-16 = unk.
 
| Unknown, normally the input parameter is value 0x2.
 
| Unknown, normally the input parameter is value 0x2.
 
|-
 
|-
 
| 3
 
| 3
| 0x000F011D
+
| 0x011D
 
| Physical address>>3
 
| Physical address>>3
| This initializes the framebuffer address used for rendering, this framebuffer is used for the input framebuffer with [[GSP_Shared_Memory|GX command]] 3 and 4. This command is used immediately after CmdID 0x000F0117.
+
| This initializes the framebuffer address used for rendering, this framebuffer is used for the input framebuffer with [[GSP_Shared_Memory|GX command]] 3 and 4. This command is used immediately after command 0x0117.
 
|-
 
|-
 
| 4
 
| 4
| 0x000F0116
+
| 0x0116
 
|  
 
|  
 
| ?
 
| ?
 
|-
 
|-
 
| 5
 
| 5
| 0x000F011C
+
| 0x011C
 
| Physical address>>3
 
| Physical address>>3
 
| Unknown, normally this address is located in VRAM.
 
| Unknown, normally this address is located in VRAM.
 
|-
 
|-
 
| 6
 
| 6
| 0x000F011E
+
| 0x011E
 
| u32, 0x01000000|(((h-1)&0xFFF)<<12)|(w&0xFFF)
 
| u32, 0x01000000|(((h-1)&0xFFF)<<12)|(w&0xFFF)
| This sets the width and height for the framebuffer used for rendering. Therefore this is glViewport(), x/y are specified by CmdID 0x000F0068.
+
| This sets the width and height for the framebuffer used for rendering. Therefore this is glViewport(), x/y are specified by command 0x0068.
 
|-
 
|-
 
| 7
 
| 7
| 0x000F006E
+
| 0x006E
| Same input parameter value as CmdID 0x000F011E.
+
| Same input parameter value as command 0x011E.
 
|  
 
|  
 
|}
 
|}
   −
This command set is normally used after the two 0x000F0041 command sets.
+
This command set is normally used after the two 0x0041 command sets.
   −
===== CmdID 0x00030107 =====
+
===== Command 0x0107 =====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Command Index
 
!  Command Index
Line 549: Line 531:  
|-
 
|-
 
| 0
 
| 0
| 0x00030107
+
| 0x0107
 
|  
 
|  
 
|  
 
|  
 
|-
 
|-
 
| 1
 
| 1
| 0x00080126
+
| 0x0126
 
| type<<24
 
| type<<24
 
|  
 
|  
 
|}
 
|}
   −
This command set is used for disabling the alpha-blending info set by command set 0x00010107? The GL AlphaFunction used here is normally GL_ALWAYS.
+
This command set is used for disabling the alpha-blending info set by command set 0x0107? The GL AlphaFunction used here is normally GL_ALWAYS.
   −
===== CmdID 0x00010107 =====
+
===== Command 0x0107 =====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Command Index
 
!  Command Index
Line 569: Line 551:  
|-
 
|-
 
| 0
 
| 0
| 0x00010107
+
| 0x0107
| Same format as CmdID 0x00030107.
+
| Same format as command 0x0107.
 
|  
 
|  
 
|-
 
|-
 
| 1
 
| 1
| 0x00080126
+
| 0x0126
 
| type<<24
 
| type<<24
 
|  
 
|  
 
|-
 
|-
 
| 0
 
| 0
| 0x00020107
+
| 0x0107
| Same value as CmdID 0x00010107.
+
| Same value as command 0x0107.
 
|  
 
|  
 
|}
 
|}
   −
=== Parameter format for CmdIDs 0x00030107, 0x00020107, and 0x00010107 ===
+
=== Parameter format for commands 0x0107, 0x0107, and 0x0107 ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Bit
 
!  Bit
Line 638: Line 620:  
|}
 
|}
   −
=== Alpha types for CmdID 0x00080126 ===
+
=== Alpha types for command 0x0126 ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Type
 
!  Type
Line 656: Line 638:  
|}
 
|}
   −
=== Parameter value format for CmdID 0x000F0104 ===
+
=== Parameter value format for command 0x0104 ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Bit
 
!  Bit
Line 679: Line 661:  
This is glAlphaFunc().
 
This is glAlphaFunc().
   −
=== Parameter value format for CmdID 0x000F011E ===
+
=== Parameter value format for command 0x011E ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Bit
 
!  Bit
Line 699: Line 681:  
This specifies the width/height for glViewport(). Normally the framebuffer width and height is set to the same [[GPU|dimensions]] used with GX [[GSP_Shared_Memory|command]] 3 and 4.
 
This specifies the width/height for glViewport(). Normally the framebuffer width and height is set to the same [[GPU|dimensions]] used with GX [[GSP_Shared_Memory|command]] 3 and 4.
   −
=== Parameter value format for CmdID 0x000F0068 ===
+
=== Parameter value format for command 0x0068 ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Bit
 
!  Bit
Line 713: Line 695:  
This specifies the X/Y coordinates for glViewport().
 
This specifies the X/Y coordinates for glViewport().
   −
=== Parameter structure for CmdID 0x804F00C0 ===
+
=== Parameter structure for command 0x00C0 ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Index Word
 
!  Index Word
Line 736: Line 718:  
This individual command is used instead of the 0x80XF00C0 command set when none of the associated rendering parameters for this slot are set.
 
This individual command is used instead of the 0x80XF00C0 command set when none of the associated rendering parameters for this slot are set.
   −
=== Parameter structure for CmdID 0x802F00C0 ===
+
=== Parameter structure for command 0x00C0 ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Index Word
 
!  Index Word
Line 753: Line 735:  
See command set 0x80XF00C0.
 
See command set 0x80XF00C0.
   −
==== Param0 format for CmdID 0x802F00C0 ====
+
==== Param0 format for command 0x00C0 ====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Bit
 
!  Bit
Line 783: Line 765:  
|}
 
|}
   −
==== Param0 values for CmdID 0x802F00C0 ====
+
==== Param0 values for command 0x00C0 ====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Value
 
!  Value
Line 822: Line 804:  
|}
 
|}
   −
==== Param1 format for CmdID 0x802F00C0 ====
+
==== Param1 format for command 0x00C0 ====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Bit
 
!  Bit
Line 851: Line 833:  
This specifies the pname for glTexEnv().
 
This specifies the pname for glTexEnv().
   −
==== Param1 field0 values for CmdID 0x802F00C0 ====
+
==== Param1 field0 values for command 0x00C0 ====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Value
 
!  Value
Line 899: Line 881:  
|}
 
|}
   −
==== Param1 field1 values for CmdID 0x802F00C0 ====
+
==== Param1 field1 values for command 0x00C0 ====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Value
 
!  Value
Line 929: Line 911:  
|}
 
|}
   −
==== Param2 format for CmdID 0x802F00C0 ====
+
==== Param2 format for command 0x00C0 ====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Bit
 
!  Bit
Line 943: Line 925:  
This is used to specify the param for glTexEnv(..., ..., param).
 
This is used to specify the param for glTexEnv(..., ..., param).
   −
==== Param2 field0 values for CmdID 0x802F00C0 ====
+
==== Param2 field0 values for command 0x00C0 ====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Value
 
!  Value
Line 979: Line 961:  
|}
 
|}
   −
==== Param2 field1 values for CmdID 0x802F00C0 ====
+
==== Param2 field1 values for command 0x00C0 ====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Value
 
!  Value
Line 1,015: Line 997:  
|}
 
|}
   −
=== Parameter value format for CmdID 0x800F00C4 ===
+
=== Parameter value format for command 0x00C4 ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Bit
 
!  Bit
Line 1,029: Line 1,011:  
See command set 0x80XF00C0.
 
See command set 0x80XF00C0.
   −
=== Parameter value format for CmdID 0x000F00E1 ===
+
=== Parameter value format for command 0x00E1 ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Bit
 
!  Bit
Line 1,047: Line 1,029:  
|}
 
|}
   −
=== Parameter value format for CmdID 0x000F0101 ===
+
=== Parameter value format for command 0x0101 ===
 
This command controls alphablending. To disable alphablending, the value is set to 0x01010000.
 
This command controls alphablending. To disable alphablending, the value is set to 0x01010000.
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,144: Line 1,126:  
|}
 
|}
   −
=== Parameter structure for CmdID 0x801F004D ===
+
=== Parameter structure for command 0x004D ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Index Word
 
!  Index Word
Line 1,158: Line 1,140:  
This is glDepthRange().
 
This is glDepthRange().
   −
=== Parameter structure for CmdID 0x000F00E8 ===
+
=== Parameter structure for command 0x00E8 ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Index Word
 
!  Index Word
Line 1,173: Line 1,155:  
|}
 
|}
   −
=== Parameter structure for CmdID 0x803F0112 ===
+
=== Parameter structure for command 0x0112 ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Index Word
 
!  Index Word
Line 1,191: Line 1,173:  
|}
 
|}
   −
=== Entries for CmdID 0xXXXF02C1 ===
+
=== Entries for command 0x02C1 ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Index Word
 
!  Index Word
Line 1,247: Line 1,229:  
|}
 
|}
   −
=== Types for CmdID 0x000F02C0 ===
+
=== Types for command 0x02C0 ===
   −
The 0x000F02C0/0x000F02C1 is actually used as a generic way to set uniforms, regardless of what they represent. 0x000F02C0's parameter represents the ID of the destination GPU register (0x0 is c0, 0x1 is c1 etc). As such, the meaning of the data being sent over is entirely dependant on the shader currently in use.
+
The 0x02C0/0x02C1 is actually used as a generic way to set uniforms, regardless of what they represent. 0x02C0's parameter represents the ID of the destination GPU register (0x0 is c0, 0x1 is c1 etc). As such, the meaning of the data being sent over is entirely dependant on the shader currently in use.
 
The values below may be "default" values used by Nintendo's openGL implementation.
 
The values below may be "default" values used by Nintendo's openGL implementation.
   Line 1,283: Line 1,265:  
| 0x14
 
| 0x14
 
| <=30
 
| <=30
| Used to specify a 4xN matrix, where N is the total CmdID 0xXXXF02C1 entries. This is glMultMatrix() for the model-view matrix, except the input matrix is 4xN instead of 4x4.
+
| Used to specify a 4xN matrix, where N is the total command 0x02C1 entries. This is glMultMatrix() for the model-view matrix, except the input matrix is 4xN instead of 4x4.
 
|-
 
|-
 
| 0x4C
 
| 0x4C
549

edits

Navigation menu