Difference between revisions of "GPU/Commands"

From 3dbrew
< GPU
Jump to navigation Jump to search
Line 135: Line 135:
 
| 0x14
 
| 0x14
 
| <=30
 
| <=30
| Matrix related?
+
| Geometry vertices
 
|-
 
|-
 
| 0x4C
 
| 0x4C

Revision as of 22:07, 9 February 2013

This page describes the structure of the buffer for GX command 1 with the registers at 0x1EF018E0. This buffer is used for GPU commands including OpenGL commands, each 8-byte entry in the buffer is a command. Cmd+0 is the command parameter, and cmd+4 is the command header.

Command Header

Bit Description
19-0 Command ID
30-20 Total words following the command, if any.
31 ?

The first word in the parameter data structure is the command parameter value, the rest of the data structure is from the data following the command. The word after the last data structure word is padding when needed for 8-byte alignment, for the following command.

Commands

CommandID Parameter Description
0x000F0010 Value is 0x12345678 This command is always the last command in the buffer.
0x000F0110 Value 0x1 This command is immediately before CmdID 0x000F0010, this is used elsewhere in the buffer as well.
0x000F0111 Value 0x1 This command is immediately before CmdID 0x000F0110, however CmdID 0x000F0110 doesn't always follow this command.
0x000F0040 u32, valid values are 0x1 and 0x2, values 0x0 and 0x3 have the same effect as value 0x2. Only bits 1-0 are used. Disable/enable alpha testing. Parameter value 0x1 disables GL_ALPHA_TEST, while value 0x2 enables GL_ALPHA_TEST.
0x000F0041 float Z vector This sets Z scaling for the current matrix.
0x000F0042 float Y vector This sets Y scaling for the current matrix.
0x000F0043 float unknown ?
0x000F0044 float X vector This sets X scaling for the current matrix.
0x801F004D First word in parameter structure ?
0x000F02C0 0x80000000 | Type This is used immediately before CmdID 0xXXXF02C1. This type field controls the command parameter buffer type.
0xXXXF02C1 First word in the first entry A list of entries follow this command.

Entries for CmdID 0xXXXF02C1

Index Word Description
0 float
1 float
2 float

Color Entry

Index Word Description
0 float Red component
1 float Blue component
2 float Green component
3 float Alpha?
4 float
5 float

Types for CmdID 0x000F02C0

Value Entries per chunk Description
0x00 4 Related to matrix translation?
0x04 4 Unknown, this is used immediately after type 0x00.
0x08 One color entry via two CmdID 0xXXXF02C1 entries. Sets the color.
0x0A 4 Texture related?
0x0B 3 ?
0x14 <=30 Geometry vertices
0x4C 4 ?
0x50, 0x53, and 0x56 1 ?
0x51, 0x54, and 0x57 1 ?
0x52, 0x55, and 0x58 1 ?
0x59 1 Unknown, the entry data is floats converted from s32s.
0x5A 2 Color related?
0x5C 1 ?