Skip to content

GE Opcode Reference

Every GE display-list command is a 32-bit word: the top 8 bits are the opcode, the low 24 bits are the parameter. GEProcessor.executeOp (src/gpu/ge-processor.ts) dispatches on the opcode; named opcodes live in src/gpu/ge-commands.ts (GE_CMD).

Opcodes not listed below, and the ones marked "parsed, no effect", are treated as no-ops: the parameter is recorded but nothing is rendered from it. Tables follow the real dispatch, so an opcode marked no-op is one the processor accepts but does not act on yet.

List control and flow

OpcodeNameDescription
0x00NOPDoes nothing.
0x08JUMPJump to the relative address in the parameter.
0x09BJUMPConditional jump on the bounding-box result. The bbox test always reports visible, so this never jumps.
0x0ACALLPush the return address and current offsetAddr, then jump. Capped at the call-stack depth.
0x0BRETPop the call stack and return; restores offsetAddr.
0x0CENDTerminate the list.
0x0ESIGNALFirst half of a SIGNAL+END pair. The behaviour byte selects jump, call, ret, sync, or a handler callback (see below).
0x0FFINISHNo effect here; list end is driven by END.
0x10BASEBase address for relative addressing (bits [19:16]).
0x13OFFSET_ADDRSet offsetAddr to param << 8.
0x14ORIGIN_ADDRSet offsetAddr to the current list PC.

SIGNAL behaviours

The behaviour byte is bits [23:16] of the SIGNAL parameter; the paired END supplies the low 16 bits of the target.

ValueNameAction
0x10JUMPAbsolute jump to `(signalData << 16)
0x11CALLPush return (with offsetAddr and baseAddr), then jump.
0x12RETPop the call stack and return.
0x01 / 0x02 / 0x03HANDLER_SUSPEND / CONTINUE / PAUSEInvoke the registered signal callback, then skip the paired END.
0x08SYNCMemory barrier; no handler.

Vertex and primitives

OpcodeNameDescription
0x01VADDRVertex buffer address (relative).
0x02IADDRIndex buffer address (relative).
0x12VTYPEVertex format bitmask (position, color, UV, weights, index, through-mode).
0x04PRIMDraw a primitive. The parameter holds the vertex count and primitive type.
0x05BEZIERDraw a Bezier surface patch (uCount, vCount in the parameter).
0x06SPLINEDraw a spline surface patch (counts plus edge types).
0x07BOUNDINGBOXTest a bounding box. Vertices are consumed but the result is always "visible".
0x36PATCHDIVISIONPatch tessellation divisions (divU, divV).
0x37PATCHPRIMITIVEPatch output primitive type (triangles, lines, points).
0x38PATCHFACINGReverse patch normals.
0x2C to 0x33Morph weightsParsed, no effect.

Immediate-mode vertices (0xF0 to 0xF9)

These build a single vertex in registers; VAP triggers the draw.

OpcodeNameDescription
0xF0 / 0xF1 / 0xF2VSCX / VSCY / VSCZImmediate vertex X / Y / Z (screen space).
0xF3 / 0xF4 / 0xF5VTCS / VTCT / VTCQImmediate texture S / T / Q.
0xF6VCVImmediate vertex color (RGB).
0xF7VAPImmediate alpha and primitive type; triggers the draw.
0xF8VFCImmediate fog coefficient.
0xF9VSCVImmediate secondary (specular) color.

Matrices

Each matrix has a NUMBER command (sets the write pointer) and a DATA command (writes one float24 and auto-increments).

OpcodeNameDescription
0x2A / 0x2BBONEMATRIXNUMBER / DATASkinning bone matrices (8 bones x 12 floats).
0x3A / 0x3BWORLDMATRIXNUMBER / DATAWorld matrix.
0x3C / 0x3DVIEWMATRIXNUMBER / DATAView matrix.
0x3E / 0x3FPROJMATRIXNUMBER / DATAProjection matrix.
0x40 / 0x41TGENMATRIXNUMBER / DATATexture-coordinate generation matrix.

Viewport, offset, region

OpcodeNameDescription
0x42 / 0x43 / 0x44Viewport scale X / Y / Zfloat24 viewport scale.
0x45 / 0x46 / 0x47Viewport center X / Y / Zfloat24 viewport center.
0x4C / 0x4DOFFSET_X / OFFSET_YScreen offset, in 1/16-pixel units.
0x4E / 0x4F(unknown)Parsed, no effect.
0x15 / 0x16REGION1 / REGION2Drawing region. Parsed, no effect (the scissor is used instead).

Lighting and material

OpcodeNameDescription
0x17Lighting enableMaster lighting toggle.
0x18 to 0x1BLight 0 to 3 enablePer-light toggle.
0x5ELight modeSingle-color or separate-specular.
0x5F to 0x62Light 0 to 3 typeLight type and computation.
0x63 to 0x86Light geometryPosition, direction, and attenuation (three floats each) for lights 0 to 3.
0x87 to 0x8ALight 0 to 3 spot exponentfloat24 spotlight exponent.
0x8B to 0x8ELight 0 to 3 spot cutofffloat24 spotlight cutoff.
0x8F to 0x9ALight 0 to 3 colorsAmbient, diffuse, and specular color per light.
0x5C / 0x5DAMBIENT_COLOR / AMBIENT_ALPHAGlobal ambient color and alpha.
0x50Shade modeFlat or Gouraud.
0x51Reverse normalsFlip vertex normals.
0x53Material updateWhich material components track the vertex color.
0x54Material emissive24-bit color.
0x55Material ambient24-bit color.
0x56Material diffuse24-bit color.
0x57Material specular24-bit color.
0x58Material alpha8-bit alpha.
0x5BMaterial specular coefficientfloat24 shininess.

Texture and CLUT

OpcodeNameDescription
0x1ETexture enableToggle texturing.
0xA0TEXADDR0Texture address, level 0.
0xA8TEXBUFWIDTH0Texture buffer width (stride), level 0.
0xA1 to 0xA7, 0xA9 to 0xAFTEXADDR / TEXBUFWIDTH 1 to 7Mip levels 1 to 7. Parsed, no effect (only level 0 is used).
0xB8TEXSIZE0Texture width and height, level 0 (each 1 << n).
0xB9 to 0xBFTEXSIZE 1 to 7Mip sizes. Parsed, no effect.
0xC2Texture modeSwizzle flag (and max mip level).
0xC3TEXFORMATTexel format (0 to 10: direct color, CLUT, DXT).
0xC4Load CLUTTriggers the CLUT load; the data is already addressed. No extra work here.
0xC5CLUT formatPalette format, shift, mask, and start index.
0xC6Texture filterMin and mag filters.
0xC7Texture wrapClamp or repeat for U and V.
0xC8Texture level (LOD)Parsed, no effect.
0xC9Texture functionModulate, decal, blend, replace, add; plus alpha and color doubling.
0xCATexture env colorUsed by the BLEND texture function.
0xCB / 0xCCTexture flush / syncNo effect.
0xC0TEXMAPMODEUV generation mode and projection mode.
0xC1TEXSHADELSLight sources for shade mapping.
0xB0 / 0xB1CLUT address lower / upperPalette base address.
0x48 / 0x49Texture scale U / Vfloat24 UV scale (transform mode).
0x4A / 0x4BTexture offset U / Vfloat24 UV offset (transform mode).
0xD0TEXLODSLOPEfloat24 LOD slope.
0xD1(reserved)Parsed, no effect.

Fog

OpcodeNameDescription
0x1FFog enableToggle fog.
0xCDFOG1float24 fog end distance.
0xCEFOG2float24 fog density slope, 1 / (end - start).
0xCFFOGCOLOR24-bit fog color.

Fragment pipeline (blend, test, mask)

OpcodeNameDescription
0x1CDepth clamp enableParsed, no effect.
0x1DCull enableToggle back-face culling.
0x9BCull faceCull direction (clockwise or counter-clockwise).
0x20Dither enableToggle dithering.
0x21Alpha blend enableToggle blending.
0x22Alpha test enableToggle the alpha test.
0x23Depth test enableToggle the depth test.
0x24Stencil test enableToggle the stencil test.
0x25Antialias enableParsed, no effect.
0x26Patch cull enableParsed, no effect.
0x27Color test enableToggle the color test.
0x28Logic op enableToggle the logic op.
0xDFBLENDMODESource factor, destination factor, and equation.
0xE0 / 0xE1Blend fixed A / BFixed blend colors.
0xDBALPHATESTFunction, reference, and mask.
0xDEZTESTDepth test function.
0xE7Depth write disableDisable depth writes.
0xD6 / 0xD7Min / max ZParsed, no effect.
0xD8COLORTESTColor test function.
0xD9COLORREFColor test reference (24-bit).
0xDACOLORTESTMASKColor test mask (24-bit).
0xDCSTENCILTESTFunction, reference, and mask.
0xDDSTENCILOPStencil-fail, depth-fail, and depth-pass operations.
0xE2 to 0xE5DITH0 to DITH3The 4x4 dither matrix, one row per command.
0xE6LOGICOPLogic operation.
0xE8MASKRGBColor write mask (24-bit).
0xE9MASKALPHAAlpha write mask (8-bit).

Framebuffer and scissor

OpcodeNameDescription
0x9CFRAMEBUFPTRFramebuffer address (low bits; high bits come from FRAMEBUFWIDTH).
0x9DFRAMEBUFWIDTHFramebuffer stride and the high address bits.
0x9E / 0x9FZBUFPTR / ZBUFWIDTHDepth buffer address and width. Parsed, no effect.
0xD2FRAMEBUFPIXFMTFramebuffer pixel format (0 to 3).
0xD3CLEAREnter or leave clear mode, and which channels clear-mode draws write.
0xD4 / 0xD5SCISSOR1 / SCISSOR2Scissor rectangle corners.

Block transfer

A block transfer copies a rectangle between memory regions (a GE "sceGeBufferCopy").

OpcodeNameDescription
0xB2TRANSFERSRCSource address (low bits).
0xB3TRANSFERSRCWSource stride and high address bits.
0xB4TRANSFERDSTDestination address (low bits).
0xB5TRANSFERDSTWDestination stride and high address bits.
0xEBTRANSFERSRCPOSSource X and Y position.
0xECTRANSFERDSTPOSDestination X and Y position.
0xEETRANSFERSIZEWidth and height of the copy.
0xEATRANSFERSTARTRun the copy. Bit 0 selects 16-bit (0) or 32-bit (1) pixels.

See GPU (GE) for how these commands are processed and rendered.