Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Commands

GX commands are identified by a single byte opcode as described in the following table:

OpcodeName
0b0000_0000NOP
0b0000_1XXXSet CP register
0b0001_0XXXSet XF registers
0b0010_0XXXSet XF registers indexed (A)
0b0010_1XXXSet XF registers indexed (B)
0b0011_0XXXSet XF registers indexed (C)
0b0011_1XXXSet XF registers indexed (D)
0b0100_0XXXCall
0b0100_1XXXInvalidate vertex cache
0b0110_0001Set BP register
0b1000_0VVVDraw quads
0b1001_0VVVDraw triangles
0b1001_1VVVDraw triangle strip
0b1010_0VVVDraw triangle fan
0b1010_1VVVDraw lines
0b1011_0VVVDraw line strip
0b1011_1VVVDraw points

Where VVV is a vertex attribute table index.

These commands are going to be explained in more detail in the following sections. Commands which require extra data will have a table at the end describing it, with rows in the order data is received.

NOP

Does nothing.

Set CP register

Sets a CP register to a given value.

SizeName
1 byteRegister
4 bytesValue

Set XF registers

Sets XF registers to given values.

SizeName
2 bytesLength - 1
2 bytesFirst address
(4 * length) bytesValues

Set XF indexed

Sets XF registers to given values.

SizeName
2 bytesIndex
2 bytesLength and Address

The last 2 bytes have the following format:

SizeName
4 bitsLength - 1
12 bitsFirst Address

Call

Calls a command list.

SizeName
4 bytesAddress
4 bytesCount (in words?)

Invalidate vertex cache

Invalidates the vertex cache.

Set BP register

Sets a BP register to a given value.

SizeName
1 byteRegister
3 bytesValue

All drawing commands

Draws a series of primitives.

SizeName
2 bytesVertex count
VariableVertex attributes