coastline 0.0.4
Loading...
Searching...
No Matches
gbi.h File Reference

The graphics binary interface types the gu routines fill in for the RSP microcode. More...

#include <PR/ultratypes.h>
Include dependency graph for gbi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  Mtx
 A 4 by 4 matrix in s15.16 fixed point, with the integer halves before the fractions. More...
struct  Light_t
 A directional light with its colour, a copy of the colour and its direction. More...
union  Light
 A directional light, aligned for the RSP. More...
struct  LookAt
 The two directions the RSP uses to generate texture coordinates for reflection mapping. More...
struct  Hilite_t
 The texture coordinates of the two specular highlights. More...
union  Hilite
 The coordinates of two specular highlights, aligned for the RSP. More...
struct  Vtx_t
 A vertex with a texture coordinate and a color. More...
struct  Vtx_tn
 A vertex with a texture coordinate and a normal, for lighting. More...
union  Vtx
 A vertex for the RSP, with a colour or with a normal. More...
struct  Gwords
 The two words of a display list command. More...
union  Gfx
 A display list command for the Fast3D microcode. More...
struct  Vp_t
 The scale and translation of a viewport, in 10.2 fixed point, each with the depth third. More...
union  Vp
 A viewport, aligned for the RSP. More...
struct  Ambient_t
 An ambient light: its color, twice. More...
union  Ambient
 An ambient light, aligned for the RSP. More...
struct  Lights1
 An ambient light and one directional light. More...

Macros

#define GBI_WORD1(x)
 The second word of a command for x, an address or an operand.
#define G_MTX   0x01
#define G_VTX   0x04
#define G_DL   0x06
#define G_TRI2   0xB1
#define G_ENDDL   0xB8
#define G_TRI1   0xBF
#define G_LOADTLUT   0xF0
#define G_TEXTURE   0xBB
#define G_POPMTX   0xBD
#define G_SETGEOMETRYMODE   0xB7
#define G_CLEARGEOMETRYMODE   0xB6
#define G_MOVEWORD   0xBC
#define G_SETOTHERMODE_L   0xB9
#define G_SETOTHERMODE_H   0xBA
#define G_RDPPIPESYNC   0xE7
#define G_RDPTILESYNC   0xE8
#define G_SETTILE   0xF5
#define G_SETENVCOLOR   0xFB
#define G_SETFOGCOLOR   0xF8
#define G_SETBLENDCOLOR   0xF9
#define G_SETPRIMDEPTH   0xEE
#define G_SETCOMBINE   0xFC
#define G_RDPHALF_2   0xB3
#define G_RDPHALF_1   0xB4
#define G_TEXRECT   0xE4
#define G_TEXRECTFLIP   0xE5
#define G_RDPLOADSYNC   0xE6
#define G_SETTILESIZE   0xF2
#define G_LOADBLOCK   0xF3
#define G_SETPRIMCOLOR   0xFA
#define G_SETTIMG   0xFD
#define G_LOADTILE   0xF4
#define G_FILLRECT   0xF6
#define G_SETFILLCOLOR   0xF7
#define G_SETSCISSOR   0xED
#define G_SETCIMG   0xFF
#define G_SETZIMG   0xFE
#define G_RDPFULLSYNC   0xE9
#define G_FILLRECT_INT_COORDS   0xE1
 Fill a rectangle with integer coordinates in the Windows renderer.
#define G_SETSCISSOR_INT_COORDS   0xE2
 Set a scissor rectangle with integer coordinates in the Windows renderer.
#define G_MTX_MODELVIEW   0x00
#define G_MTX_PROJECTION   0x01
#define G_MTX_MUL   0x00
#define G_MTX_LOAD   0x02
#define G_MTX_NOPUSH   0x00
#define G_MTX_PUSH   0x04
#define G_ZBUFFER   0x00000001
#define G_SHADE   0x00000004
#define G_SHADING_SMOOTH   0x00000200
#define G_CULL_FRONT   0x00001000
#define G_CULL_BACK   0x00002000
#define G_CULL_BOTH   0x00003000
#define G_FOG   0x00010000
#define G_LIGHTING   0x00020000
#define G_TEXTURE_GEN   0x00040000
#define G_TEXTURE_GEN_LINEAR   0x00080000
#define G_LOD   0x00100000
#define G_CLIPPING   0x00800000
#define G_MDSFT_ALPHACOMPARE   0
#define G_MDSFT_ZSRCSEL   2
#define G_MDSFT_RENDERMODE   3
#define G_MDSFT_ALPHADITHER   4
#define G_MDSFT_RGBDITHER   6
#define G_MDSFT_COMBKEY   8
#define G_MDSFT_TEXTCONV   9
#define G_MDSFT_TEXTFILT   12
#define G_MDSFT_TEXTLUT   14
#define G_MDSFT_TEXTLOD   16
#define G_MDSFT_TEXTDETAIL   17
#define G_MDSFT_TEXTPERSP   19
#define G_MDSFT_CYCLETYPE   20
#define G_CYC_1CYCLE   (0 << G_MDSFT_CYCLETYPE)
#define G_CYC_FILL   (3 << G_MDSFT_CYCLETYPE)
#define G_CYC_2CYCLE   (1 << G_MDSFT_CYCLETYPE)
#define G_CYC_COPY   (2 << G_MDSFT_CYCLETYPE)
#define G_CD_NOISE   (2 << G_MDSFT_RGBDITHER)
#define G_CD_DISABLE   (3 << G_MDSFT_RGBDITHER)
#define G_AC_NONE   (0 << G_MDSFT_ALPHACOMPARE)
#define G_AC_THRESHOLD   (1 << G_MDSFT_ALPHACOMPARE)
#define G_AC_DITHER   (3 << G_MDSFT_ALPHACOMPARE)
#define G_ZS_PIXEL   (0 << G_MDSFT_ZSRCSEL)
#define G_ZS_PRIM   (1 << G_MDSFT_ZSRCSEL)
#define G_SC_NON_INTERLACE   0
#define G_TL_TILE   (0 << G_MDSFT_TEXTLOD)
#define G_TL_LOD   (1 << G_MDSFT_TEXTLOD)
#define G_TD_CLAMP   (0 << G_MDSFT_TEXTDETAIL)
#define G_TC_FILT   (6 << G_MDSFT_TEXTCONV)
#define G_CK_NONE   (0 << G_MDSFT_COMBKEY)
#define G_TT_NONE   (0 << G_MDSFT_TEXTLUT)
#define G_TP_NONE   (0 << G_MDSFT_TEXTPERSP)
#define G_TP_PERSP   (1 << G_MDSFT_TEXTPERSP)
#define G_TF_POINT   (0 << G_MDSFT_TEXTFILT)
#define G_TF_BILERP   (2 << G_MDSFT_TEXTFILT)
#define G_CD_BAYER   (1 << G_MDSFT_RGBDITHER)
#define G_AD_PATTERN   (0 << G_MDSFT_ALPHADITHER)
#define G_TT_RGBA16   (2 << G_MDSFT_TEXTLUT)
#define G_TT_IA16   (3 << G_MDSFT_TEXTLUT)
#define AA_EN   0x0008
#define Z_CMP   0x0010
#define Z_UPD   0x0020
#define IM_RD   0x0040
#define CLR_ON_CVG   0x0080
#define CVG_DST_CLAMP   0x0000
#define CVG_DST_WRAP   0x0100
#define CVG_DST_FULL   0x0200
#define CVG_DST_SAVE   0x0300
#define ZMODE_OPA   0x0000
#define ZMODE_XLU   0x0800
#define ZMODE_DEC   0x0C00
#define CVG_X_ALPHA   0x1000
#define ALPHA_CVG_SEL   0x2000
#define FORCE_BL   0x4000
#define G_BL_CLR_IN   0
#define G_BL_CLR_MEM   1
#define G_BL_A_IN   0
#define G_BL_A_MEM   1
#define G_BL_A_FOG   1
#define G_BL_CLR_FOG   3
#define G_BL_A_SHADE   2
#define G_BL_1MA   0
#define G_BL_1   2
#define G_BL_0   3
#define GBL_c1(m1a, m1b, m2a, m2b)
 The blender equation of the first cycle of a render mode.
#define GBL_c2(m1a, m1b, m2a, m2b)
 The blender equation of the second cycle of a render mode.
#define G_RM_OPA_SURF    (CVG_DST_CLAMP | FORCE_BL | ZMODE_OPA | GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1))
 The opaque surface without antialiasing or depth, for the first cycle.
#define G_RM_OPA_SURF2    (CVG_DST_CLAMP | FORCE_BL | ZMODE_OPA | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1))
 The opaque surface without antialiasing or depth, for the second cycle.
#define G_RM_XLU_SURF
 The translucent surface without antialiasing, for the first cycle.
#define G_RM_XLU_SURF2
 The translucent surface without antialiasing, for the second cycle.
#define G_CCMUX_COMBINED   0
#define G_CCMUX_TEXEL0   1
#define G_CCMUX_TEXEL1   2
#define G_CCMUX_PRIMITIVE   3
#define G_CCMUX_SHADE   4
#define G_CCMUX_ENVIRONMENT   5
#define G_CCMUX_TEXEL0_ALPHA   8
#define G_CCMUX_PRIMITIVE_ALPHA   10
#define G_CCMUX_SHADE_ALPHA   11
#define G_CCMUX_ENV_ALPHA   12
#define G_CCMUX_LOD_FRACTION   13
#define G_CCMUX_1   6
#define G_CCMUX_0   31
#define G_ACMUX_COMBINED   0
#define G_ACMUX_LOD_FRACTION   0
#define G_ACMUX_TEXEL0   1
#define G_ACMUX_TEXEL1   2
#define G_ACMUX_PRIMITIVE   3
#define G_ACMUX_SHADE   4
#define G_ACMUX_ENVIRONMENT   5
#define G_ACMUX_1   6
#define G_ACMUX_0   7
#define G_IM_FMT_RGBA   0
#define G_IM_FMT_CI   2
#define G_IM_FMT_IA   3
#define G_IM_FMT_I   4
#define G_IM_SIZ_4b   0
#define G_IM_SIZ_8b   1
#define G_IM_SIZ_16b   2
#define G_IM_SIZ_8b_LOAD_BLOCK   G_IM_SIZ_16b
#define G_IM_SIZ_8b_INCR   1
#define G_IM_SIZ_8b_SHIFT   1
#define G_IM_SIZ_8b_BYTES   1
#define G_IM_SIZ_8b_LINE_BYTES   1
#define G_IM_SIZ_16b_LOAD_BLOCK   G_IM_SIZ_16b
#define G_IM_SIZ_16b_INCR   0
#define G_IM_SIZ_16b_SHIFT   0
#define G_IM_SIZ_16b_BYTES   2
#define G_IM_SIZ_16b_LINE_BYTES   2
#define G_TX_RENDERTILE   0
#define G_TX_LOADTILE   7
#define G_TX_WRAP   0
#define G_TX_MIRROR   1
#define G_TX_CLAMP   2
#define G_TX_NOLOD   0
#define G_ON   1
#define G_OFF   0
#define G_TEXTURE_IMAGE_FRAC   2
#define G_TX_DXT_FRAC   11
#define G_TX_LDBLK_MAX_TXL   2047
 The most texels one load block takes, less one.
#define TXL2WORDS_4b(txls)
 The 64-bit words of a row of a 4-bit texture, at least one.
#define CALC_DXT_4b(width)
 The step of the row counter of a load block for a 4-bit texture of a width.
#define TXL2WORDS(txls, b_txl)
 The 64-bit words of a row of a texture with texels of b_txl bytes, at least one.
#define CALC_DXT(width, b_txl)
 The step of the row counter of a load block for a texture with texels of b_txl bytes.
#define G_MW_CLIP   0x04
#define G_MWO_CLIP_RNX   0x04
#define G_MWO_CLIP_RNY   0x0C
#define G_MWO_CLIP_RPX   0x14
#define G_MWO_CLIP_RPY   0x1C
#define FRUSTRATIO_1   1
#define FRUSTRATIO_6   6
#define G_MOVEMEM   0x03
#define G_MV_L0   0x86
#define G_MW_NUMLIGHT   0x02
#define G_MWO_NUMLIGHT   0x00
#define NUMLIGHTS_1   1
#define NUMLIGHTS_4   4
#define LIGHT_1   1
#define LIGHT_2   2
#define G_MV_LOOKATY   0x82
#define G_MV_LOOKATX   0x84
#define G_MV_MATRIX_1   0x9E
#define G_MV_MATRIX_2   0x98
#define G_MV_MATRIX_3   0x9A
#define G_MV_MATRIX_4   0x9C
#define G_MW_SEGMENT   0x06
#define G_MW_LIGHTCOL   0x0A
#define G_MW_PERSPNORM   0x0E
#define G_MV_VIEWPORT   0x80
#define G_MW_FOG   0x08
#define G_MWO_FOG   0x00
#define NUML(n)
 The word gSPNumLights() sends for a number of directional lights.
#define gDisplayListWords(pkt, c0, c1)
 Write a command of two words at pkt, which is evaluated once.
#define gDPNoParam(pkt, cmd)
 Write command cmd with no parameters.
#define gImmp1(pkt, cmd, data)
 Write command cmd with data as its second word.
#define gMoveWd(pkt, index, offset, data)
 Write data to the word at offset in the microcode state of index.
#define gSPSetOtherMode(pkt, cmd, sft, len, data)
 Replace len bits of an other mode word from bit sft with data.
#define gSPMatrix(pkt, m, p)
 Load or multiply matrix m by the G_MTX_* flags of p.
#define gSPPopMatrix(pkt, n)
 Pop the modelview matrix; n is the matrix stack.
#define gSPDisplayList(pkt, dl)
 Call display list dl.
#define gSPEndDisplayList(pkt)
 End the display list.
#define gSPVertex(pkt, v, n, v0)
 Load n vertices into the vertex buffer of the F3DEX microcode from index v0.
#define gSP2Triangles(pkt, v00, v01, v02, flag0, v10, v11, v12, flag1)
 Draw two triangles of the vertex buffer.
#define gSPSetGeometryMode(pkt, word)
 Set the geometry mode bits of word.
#define gSPClearGeometryMode(pkt, word)
 Clear the geometry mode bits of word.
#define gSPTexture(pkt, s, t, level, tile, on)
 Set the texture scale s and t, the levels of detail, the tile, and whether texturing is on.
#define gSPClipRatio(pkt, r)
 Set the ratio of the clipping box to the screen with four commands.
#define gSPNumLights(pkt, n)
 Set the number of directional lights.
#define gSPLightColor(pkt, n, col)
 Set the colour of light n, from 1, as its two copies.
#define gSPPerspNormalize(pkt, s)
 Set the normalisation of the perspective, which gu's perspective routines return.
#define gSPViewport(pkt, v)
 Load a viewport.
#define gSPFogPosition(pkt, min, max)
 Set the depths the fog starts and ends at, from 0 at the near plane to 1000 at the far.
#define gSPSegment(pkt, segment, base)
 Set the base of a segment.
#define gSPLookAt(pkt, la)
 Load the look-at of the reflections, its x then its y.
#define gSPForceMatrix(pkt, m)
 Load a matrix as the product of the model view and the projection, a row pair at a time.
#define gSPLight(pkt, l, n)
 Load a light into light slot n, from 1.
#define gDPPipeSync(pkt)
 Wait for the RDP pipeline to drain before a mode changes.
#define gDPTileSync(pkt)
 Wait for the tile descriptors to settle before a tile changes.
#define gDPSetCycleType(pkt, type)
 Set the G_CYC_* cycle type.
#define gDPSetTextureFilter(pkt, type)
 Set the G_TF_* texture filter.
#define gDPSetTextureLOD(pkt, type)
 Set the G_TL_* texture level of detail.
#define gDPSetTextureDetail(pkt, type)
 Set the G_TD_* texture detail.
#define gDPSetTextureConvert(pkt, type)
 Set the G_TC_* texture conversion.
#define gDPSetCombineKey(pkt, type)
 Set the G_CK_* chroma key.
#define gDPSetColorDither(pkt, mode)
 Set the G_CD_* colour dither.
#define gDPSetAlphaDither(pkt, mode)
 Set the G_AD_* alpha dither.
#define gDPSetAlphaCompare(pkt, type)
 Set the G_AC_* alpha compare.
#define gDPSetDepthSource(pkt, src)
 Set the G_ZS_* depth source.
#define gDPSetBlendColor(pkt, r, g, b, a)
 Set the blend colour.
#define gDPSetPrimDepth(pkt, z, dz)
 Set the depth of a primitive whose depth source is G_ZS_PRIM.
#define gDPSetScissor(pkt, mode, ulx, uly, lrx, lry)
 Set the scissor rectangle: integer coordinates on Windows, 10.2 fixed point on N64.
#define gDPSetRenderMode(pkt, c0, c1)
 Set the render mode from the modes of the first and second cycles.
#define gDPSetEnvColor(pkt, r, g, b, a)
 Set the environment colour.
#define gDPSetFogColor(pkt, r, g, b, a)
 Set the fog colour.
#define gDPSetTile( pkt, fmt, siz, line, tmem, tile, palette, cmt, maskt, shiftt, cms, masks, shifts)
 Set the format, texel size, row length, address, palette, and wrapping of a tile.
#define gDPSetCombineLERP( pkt, a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1)
 Set the colour combiner from the a, b, c and d inputs of (a - b) * c + d for each cycle.
#define gDPLoadSync(pkt)
 Wait for a texture load to finish.
#define gDPFullSync(pkt)
 Wait for the RDP to finish the frame and raise its interrupt.
#define gDPSetDepthImage(pkt, i)
 Set the depth buffer to i.
#define gDPSetColorImage(pkt, f, s, w, i)
 Set the colour buffer to i, of format f, texel size s, and width w.
#define GPACK_RGBA5551(r, g, b, a)
 A colour of RGBA 5551 from components of 8 bits and an alpha of 1 bit.
#define GPACK_ZDZ(z, dz)
 A depth and its slope, as the depth buffer stores them.
#define G_MAXFIXED   0x3FFF
 The farthest depth.
#define gDPSetFillColor(pkt, d)
 Set the fill colour, a 32-bit word of one or two packed pixels.
#define gDPFillRectangle(pkt, ulx, uly, lrx, lry)
 Fill a rectangle, its corners inclusive, with the fill colour.
#define gDPSetTextureLUT(pkt, type)
 Set the G_TT_* texture palette.
#define gDPSetTexturePersp(pkt, type)
 Set the G_TP_* texture perspective correction.
#define gDPSetPrimColor(pkt, m, l, r, g, b, a)
 Set the primitive colour with the minimum level of detail m and its fraction l.
#define gDPSetTextureImage(pkt, f, s, w, i)
 Set the texture image to i, of format f, texel size s, and width w.
#define gDPLoadBlock(pkt, tile, uls, ult, lrs, dxt)
 Load texels uls to lrs of the texture image through a tile, with row step dxt.
#define gDPSetTileSize(pkt, t, uls, ult, lrs, lrt)
 Set the extent of tile t, in 10.2 fixed point.
#define gDPLoadTLUTCmd(pkt, tile, count)
 Load count + 1 colors of a palette through a tile.
#define gDPLoadTLUT_pal256(pkt, dram)
 Load a palette of 256 colors into the upper half of the texture memory.
#define gDPLoadTLUT_pal16(pkt, pal, dram)
 Load a palette of 16 colors into one of the sixteen palettes of the upper texture memory.
#define gDPSetHilite1Tile(pkt, tile, hilite, width, height)
 Place a tile of a size at the first specular highlight.
#define gDPLoadTile(pkt, t, uls, ult, lrs, lrt)
 Load a rectangle of texels.
#define gDPLoadTextureBlock_4b( pkt, timg, fmt, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt)
 Load a 4-bit texture into the texture memory and set up the render tile to draw it.
#define gDPLoadTextureBlock( pkt, timg, fmt, siz, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt)
 Load an 8-bit or 16-bit texture into the texture memory and set up the render tile.
#define gDPLoadTextureTile_4b(pkt, timg, fmt, width, height, uls, ult, lrs, lrt, pal, cms, cmt, masks, maskt, shifts, shiftt)
 Load a rectangle of a 4-bit texture into the texture memory and set up the render tile.
#define gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)
 Draw a textured rectangle in screen coordinates of 10.2 fixed point.

Detailed Description

The graphics binary interface types the gu routines fill in for the RSP microcode.

Macro Definition Documentation

◆ GBI_WORD1

#define GBI_WORD1 ( x)
Value:
((u32)(x))
unsigned int u32
Definition ultratypes.h:20

The second word of a command for x, an address or an operand.

◆ G_MTX

#define G_MTX   0x01

Load or multiply a matrix.

◆ G_VTX

#define G_VTX   0x04

Load vertices.

◆ G_DL

#define G_DL   0x06

Call or branch to a display list.

◆ G_TRI2

#define G_TRI2   0xB1

Draw two triangles.

◆ G_ENDDL

#define G_ENDDL   0xB8

End a display list.

◆ G_TRI1

#define G_TRI1   0xBF

Draw one triangle.

◆ G_LOADTLUT

#define G_LOADTLUT   0xF0

Load a palette into texture memory.

◆ G_TEXTURE

#define G_TEXTURE   0xBB

Set the texture scale and tile.

◆ G_POPMTX

#define G_POPMTX   0xBD

Pop the modelview matrix.

◆ G_SETGEOMETRYMODE

#define G_SETGEOMETRYMODE   0xB7

Set bits of the geometry mode.

◆ G_CLEARGEOMETRYMODE

#define G_CLEARGEOMETRYMODE   0xB6

Clear bits of the geometry mode.

◆ G_MOVEWORD

#define G_MOVEWORD   0xBC

Write a word of the microcode state.

◆ G_SETOTHERMODE_L

#define G_SETOTHERMODE_L   0xB9

Set bits of the low other mode word.

◆ G_SETOTHERMODE_H

#define G_SETOTHERMODE_H   0xBA

Set bits of the high other mode word.

◆ G_RDPPIPESYNC

#define G_RDPPIPESYNC   0xE7

Wait for the RDP pipeline to drain.

◆ G_RDPTILESYNC

#define G_RDPTILESYNC   0xE8

Wait for the tile descriptors to settle.

◆ G_SETTILE

#define G_SETTILE   0xF5

Set a tile descriptor.

◆ G_SETENVCOLOR

#define G_SETENVCOLOR   0xFB

Set the environment colour.

◆ G_SETFOGCOLOR

#define G_SETFOGCOLOR   0xF8

Set the fog colour.

◆ G_SETBLENDCOLOR

#define G_SETBLENDCOLOR   0xF9

Set the blend colour.

◆ G_SETPRIMDEPTH

#define G_SETPRIMDEPTH   0xEE

Set the primitive depth.

◆ G_SETCOMBINE

#define G_SETCOMBINE   0xFC

Set the colour combiner.

◆ G_RDPHALF_2

#define G_RDPHALF_2   0xB3

The second extra word of a long command.

◆ G_RDPHALF_1

#define G_RDPHALF_1   0xB4

The first extra word of a long command.

◆ G_TEXRECT

#define G_TEXRECT   0xE4

Draw a textured rectangle.

◆ G_TEXRECTFLIP

#define G_TEXRECTFLIP   0xE5

Draw a textured rectangle with s and t exchanged.

◆ G_RDPLOADSYNC

#define G_RDPLOADSYNC   0xE6

Wait for a texture load to finish.

◆ G_SETTILESIZE

#define G_SETTILESIZE   0xF2

Set the extent of a tile.

◆ G_LOADBLOCK

#define G_LOADBLOCK   0xF3

Load a run of texels into texture memory.

◆ G_SETPRIMCOLOR

#define G_SETPRIMCOLOR   0xFA

Set the primitive colour.

◆ G_SETTIMG

#define G_SETTIMG   0xFD

Set the texture image.

◆ G_LOADTILE

#define G_LOADTILE   0xF4

Load a rectangle of texels into texture memory.

◆ G_FILLRECT

#define G_FILLRECT   0xF6

Fill a rectangle.

◆ G_SETFILLCOLOR

#define G_SETFILLCOLOR   0xF7

Set the fill colour.

◆ G_SETSCISSOR

#define G_SETSCISSOR   0xED

Set the scissor box.

◆ G_SETCIMG

#define G_SETCIMG   0xFF

Set the colour image.

◆ G_SETZIMG

#define G_SETZIMG   0xFE

Set the depth image.

◆ G_RDPFULLSYNC

#define G_RDPFULLSYNC   0xE9

Wait for the RDP to finish and raise its interrupt.

◆ G_FILLRECT_INT_COORDS

#define G_FILLRECT_INT_COORDS   0xE1

Fill a rectangle with integer coordinates in the Windows renderer.

◆ G_SETSCISSOR_INT_COORDS

#define G_SETSCISSOR_INT_COORDS   0xE2

Set a scissor rectangle with integer coordinates in the Windows renderer.

◆ G_MTX_MODELVIEW

#define G_MTX_MODELVIEW   0x00

The modelview matrix.

◆ G_MTX_PROJECTION

#define G_MTX_PROJECTION   0x01

The projection matrix.

◆ G_MTX_MUL

#define G_MTX_MUL   0x00

Multiply the current matrix.

◆ G_MTX_LOAD

#define G_MTX_LOAD   0x02

Replace the current matrix.

◆ G_MTX_NOPUSH

#define G_MTX_NOPUSH   0x00

Do not push the current matrix first.

◆ G_MTX_PUSH

#define G_MTX_PUSH   0x04

Push the current matrix first.

◆ G_ZBUFFER

#define G_ZBUFFER   0x00000001

Compute depth.

◆ G_SHADE

#define G_SHADE   0x00000004

Compute the shade colour.

◆ G_SHADING_SMOOTH

#define G_SHADING_SMOOTH   0x00000200

Interpolate the shade across a triangle.

◆ G_CULL_FRONT

#define G_CULL_FRONT   0x00001000

Discard triangles facing the camera.

◆ G_CULL_BACK

#define G_CULL_BACK   0x00002000

Discard triangles facing away.

◆ G_CULL_BOTH

#define G_CULL_BOTH   0x00003000

Discard every triangle.

◆ G_FOG

#define G_FOG   0x00010000

Compute fog.

◆ G_LIGHTING

#define G_LIGHTING   0x00020000

Light vertices from their normals.

◆ G_TEXTURE_GEN

#define G_TEXTURE_GEN   0x00040000

Generate texture coordinates from normals.

◆ G_TEXTURE_GEN_LINEAR

#define G_TEXTURE_GEN_LINEAR   0x00080000

Generate them linearly.

◆ G_LOD

#define G_LOD   0x00100000

Compute the level of detail.

◆ G_CLIPPING

#define G_CLIPPING   0x00800000

Clip triangles to the frustum.

◆ G_MDSFT_ALPHACOMPARE

#define G_MDSFT_ALPHACOMPARE   0

The alpha compare.

◆ G_MDSFT_ZSRCSEL

#define G_MDSFT_ZSRCSEL   2

The source of the depth.

◆ G_MDSFT_RENDERMODE

#define G_MDSFT_RENDERMODE   3

The render mode.

◆ G_MDSFT_ALPHADITHER

#define G_MDSFT_ALPHADITHER   4

The alpha dither.

◆ G_MDSFT_RGBDITHER

#define G_MDSFT_RGBDITHER   6

The colour dither.

◆ G_MDSFT_COMBKEY

#define G_MDSFT_COMBKEY   8

The chroma key.

◆ G_MDSFT_TEXTCONV

#define G_MDSFT_TEXTCONV   9

The texture conversion.

◆ G_MDSFT_TEXTFILT

#define G_MDSFT_TEXTFILT   12

The texture filter.

◆ G_MDSFT_TEXTLUT

#define G_MDSFT_TEXTLUT   14

The texture palette.

◆ G_MDSFT_TEXTLOD

#define G_MDSFT_TEXTLOD   16

The texture level of detail.

◆ G_MDSFT_TEXTDETAIL

#define G_MDSFT_TEXTDETAIL   17

The texture detail.

◆ G_MDSFT_TEXTPERSP

#define G_MDSFT_TEXTPERSP   19

The texture perspective correction.

◆ G_MDSFT_CYCLETYPE

#define G_MDSFT_CYCLETYPE   20

The cycle type.

◆ G_CYC_1CYCLE

#define G_CYC_1CYCLE   (0 << G_MDSFT_CYCLETYPE)

One cycle per pixel.

◆ G_CYC_FILL

#define G_CYC_FILL   (3 << G_MDSFT_CYCLETYPE)

Fill with the fill colour.

◆ G_CYC_2CYCLE

#define G_CYC_2CYCLE   (1 << G_MDSFT_CYCLETYPE)

Two cycles per pixel.

◆ G_CYC_COPY

#define G_CYC_COPY   (2 << G_MDSFT_CYCLETYPE)

Copy texels to the frame buffer.

◆ G_CD_NOISE

#define G_CD_NOISE   (2 << G_MDSFT_RGBDITHER)

Dither the colour with noise.

◆ G_CD_DISABLE

#define G_CD_DISABLE   (3 << G_MDSFT_RGBDITHER)

Do not dither the colour.

◆ G_AC_NONE

#define G_AC_NONE   (0 << G_MDSFT_ALPHACOMPARE)

Do not compare alpha.

◆ G_AC_THRESHOLD

#define G_AC_THRESHOLD   (1 << G_MDSFT_ALPHACOMPARE)

Compare alpha with the blend alpha.

◆ G_AC_DITHER

#define G_AC_DITHER   (3 << G_MDSFT_ALPHACOMPARE)

Compare alpha with a random value.

◆ G_ZS_PIXEL

#define G_ZS_PIXEL   (0 << G_MDSFT_ZSRCSEL)

Take the depth of each pixel.

◆ G_ZS_PRIM

#define G_ZS_PRIM   (1 << G_MDSFT_ZSRCSEL)

Take the primitive depth.

◆ G_SC_NON_INTERLACE

#define G_SC_NON_INTERLACE   0

Draw every line.

◆ G_TL_TILE

#define G_TL_TILE   (0 << G_MDSFT_TEXTLOD)

Take the tile of the command.

◆ G_TL_LOD

#define G_TL_LOD   (1 << G_MDSFT_TEXTLOD)

Pick the tile by level of detail.

◆ G_TD_CLAMP

#define G_TD_CLAMP   (0 << G_MDSFT_TEXTDETAIL)

Clamp the level of detail.

◆ G_TC_FILT

#define G_TC_FILT   (6 << G_MDSFT_TEXTCONV)

Filter without colour conversion.

◆ G_CK_NONE

#define G_CK_NONE   (0 << G_MDSFT_COMBKEY)

No chroma key.

◆ G_TT_NONE

#define G_TT_NONE   (0 << G_MDSFT_TEXTLUT)

No palette.

◆ G_TP_NONE

#define G_TP_NONE   (0 << G_MDSFT_TEXTPERSP)

No perspective correction.

◆ G_TP_PERSP

#define G_TP_PERSP   (1 << G_MDSFT_TEXTPERSP)

Perspective correction.

◆ G_TF_POINT

#define G_TF_POINT   (0 << G_MDSFT_TEXTFILT)

Point sampling.

◆ G_TF_BILERP

#define G_TF_BILERP   (2 << G_MDSFT_TEXTFILT)

Bilinear filtering.

◆ G_CD_BAYER

#define G_CD_BAYER   (1 << G_MDSFT_RGBDITHER)

Dither the colour with a Bayer matrix.

◆ G_AD_PATTERN

#define G_AD_PATTERN   (0 << G_MDSFT_ALPHADITHER)

Dither alpha with a pattern.

◆ G_TT_RGBA16

#define G_TT_RGBA16   (2 << G_MDSFT_TEXTLUT)

A palette of 16-bit RGBA colours.

◆ G_TT_IA16

#define G_TT_IA16   (3 << G_MDSFT_TEXTLUT)

A palette of 16-bit intensity and alpha.

◆ AA_EN

#define AA_EN   0x0008

Antialias.

◆ Z_CMP

#define Z_CMP   0x0010

Compare depth.

◆ Z_UPD

#define Z_UPD   0x0020

Write depth.

◆ IM_RD

#define IM_RD   0x0040

Read the colour image.

◆ CLR_ON_CVG

#define CLR_ON_CVG   0x0080

Write colour only when coverage overflows.

◆ CVG_DST_CLAMP

#define CVG_DST_CLAMP   0x0000

Clamp the coverage.

◆ CVG_DST_WRAP

#define CVG_DST_WRAP   0x0100

Wrap the coverage.

◆ CVG_DST_FULL

#define CVG_DST_FULL   0x0200

Force full coverage.

◆ CVG_DST_SAVE

#define CVG_DST_SAVE   0x0300

Preserve the stored coverage.

◆ ZMODE_OPA

#define ZMODE_OPA   0x0000

Opaque depth.

◆ ZMODE_XLU

#define ZMODE_XLU   0x0800

Translucent depth.

◆ ZMODE_DEC

#define ZMODE_DEC   0x0C00

Decal depth.

◆ CVG_X_ALPHA

#define CVG_X_ALPHA   0x1000

Multiply coverage by alpha.

◆ ALPHA_CVG_SEL

#define ALPHA_CVG_SEL   0x2000

Take alpha from coverage.

◆ FORCE_BL

#define FORCE_BL   0x4000

Blend every pixel.

◆ G_BL_CLR_IN

#define G_BL_CLR_IN   0

The colour of the pixel.

◆ G_BL_CLR_MEM

#define G_BL_CLR_MEM   1

The colour in memory.

◆ G_BL_A_IN

#define G_BL_A_IN   0

The alpha of the pixel.

◆ G_BL_A_MEM

#define G_BL_A_MEM   1

The alpha in memory.

◆ G_BL_A_FOG

#define G_BL_A_FOG   1

The alpha of the fog colour.

◆ G_BL_CLR_FOG

#define G_BL_CLR_FOG   3

The fog colour.

◆ G_BL_A_SHADE

#define G_BL_A_SHADE   2

The shade alpha.

◆ G_BL_1MA

#define G_BL_1MA   0

One minus the first alpha.

◆ G_BL_1

#define G_BL_1   2

One.

◆ G_BL_0

#define G_BL_0   3

Zero.

◆ GBL_c1

#define GBL_c1 ( m1a,
m1b,
m2a,
m2b )
Value:
((u32)(m1a) << 30 | (u32)(m1b) << 26 | (u32)(m2a) << 22 | (u32)(m2b) << 18)

The blender equation of the first cycle of a render mode.

◆ GBL_c2

#define GBL_c2 ( m1a,
m1b,
m2a,
m2b )
Value:
((u32)(m1a) << 28 | (u32)(m1b) << 24 | (u32)(m2a) << 20 | (u32)(m2b) << 16)

The blender equation of the second cycle of a render mode.

◆ G_RM_OPA_SURF

#define G_RM_OPA_SURF    (CVG_DST_CLAMP | FORCE_BL | ZMODE_OPA | GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1))

The opaque surface without antialiasing or depth, for the first cycle.

◆ G_RM_OPA_SURF2

#define G_RM_OPA_SURF2    (CVG_DST_CLAMP | FORCE_BL | ZMODE_OPA | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1))

The opaque surface without antialiasing or depth, for the second cycle.

◆ G_RM_XLU_SURF

#define G_RM_XLU_SURF
Value:
#define G_BL_CLR_MEM
Definition gbi.h:270
#define G_BL_A_IN
Definition gbi.h:271
#define FORCE_BL
Definition gbi.h:266
#define G_BL_1MA
Definition gbi.h:276
#define IM_RD
Definition gbi.h:255
#define CVG_DST_FULL
Definition gbi.h:259
#define G_BL_CLR_IN
Definition gbi.h:269
#define ZMODE_OPA
Definition gbi.h:261

The translucent surface without antialiasing, for the first cycle.

◆ G_RM_XLU_SURF2

#define G_RM_XLU_SURF2
Value:

The translucent surface without antialiasing, for the second cycle.

◆ G_CCMUX_COMBINED

#define G_CCMUX_COMBINED   0

The output of the first cycle.

◆ G_CCMUX_TEXEL0

#define G_CCMUX_TEXEL0   1

The colour of texel 0.

◆ G_CCMUX_TEXEL1

#define G_CCMUX_TEXEL1   2

The colour of texel 1.

◆ G_CCMUX_PRIMITIVE

#define G_CCMUX_PRIMITIVE   3

The primitive colour.

◆ G_CCMUX_SHADE

#define G_CCMUX_SHADE   4

The shade colour.

◆ G_CCMUX_ENVIRONMENT

#define G_CCMUX_ENVIRONMENT   5

The environment colour.

◆ G_CCMUX_TEXEL0_ALPHA

#define G_CCMUX_TEXEL0_ALPHA   8

The alpha of texel 0.

◆ G_CCMUX_PRIMITIVE_ALPHA

#define G_CCMUX_PRIMITIVE_ALPHA   10

The primitive alpha.

◆ G_CCMUX_SHADE_ALPHA

#define G_CCMUX_SHADE_ALPHA   11

The shade alpha.

◆ G_CCMUX_ENV_ALPHA

#define G_CCMUX_ENV_ALPHA   12

The environment alpha.

◆ G_CCMUX_LOD_FRACTION

#define G_CCMUX_LOD_FRACTION   13

The fraction of the level of detail.

◆ G_CCMUX_1

#define G_CCMUX_1   6

One.

◆ G_CCMUX_0

#define G_CCMUX_0   31

Zero.

◆ G_ACMUX_COMBINED

#define G_ACMUX_COMBINED   0

The alpha output of the first cycle.

◆ G_ACMUX_LOD_FRACTION

#define G_ACMUX_LOD_FRACTION   0

The fraction of the level of detail.

◆ G_ACMUX_TEXEL0

#define G_ACMUX_TEXEL0   1

The alpha of texel 0.

◆ G_ACMUX_TEXEL1

#define G_ACMUX_TEXEL1   2

The alpha of texel 1.

◆ G_ACMUX_PRIMITIVE

#define G_ACMUX_PRIMITIVE   3

The primitive alpha.

◆ G_ACMUX_SHADE

#define G_ACMUX_SHADE   4

The shade alpha.

◆ G_ACMUX_ENVIRONMENT

#define G_ACMUX_ENVIRONMENT   5

The environment alpha.

◆ G_ACMUX_1

#define G_ACMUX_1   6

One.

◆ G_ACMUX_0

#define G_ACMUX_0   7

Zero.

◆ G_IM_FMT_RGBA

#define G_IM_FMT_RGBA   0

RGBA texels.

◆ G_IM_FMT_CI

#define G_IM_FMT_CI   2

Palette indices.

◆ G_IM_FMT_IA

#define G_IM_FMT_IA   3

Intensity and alpha.

◆ G_IM_FMT_I

#define G_IM_FMT_I   4

Intensity.

◆ G_IM_SIZ_4b

#define G_IM_SIZ_4b   0

Texels of 4 bits.

◆ G_IM_SIZ_8b

#define G_IM_SIZ_8b   1

Texels of 8 bits.

◆ G_IM_SIZ_16b

#define G_IM_SIZ_16b   2

Texels of 16 bits.

◆ G_IM_SIZ_8b_LOAD_BLOCK

#define G_IM_SIZ_8b_LOAD_BLOCK   G_IM_SIZ_16b

8-bit texels load as 16-bit texels.

◆ G_IM_SIZ_8b_INCR

#define G_IM_SIZ_8b_INCR   1

The rounding of an 8-bit texel count.

◆ G_IM_SIZ_8b_SHIFT

#define G_IM_SIZ_8b_SHIFT   1

The shift of an 8-bit texel count.

◆ G_IM_SIZ_8b_BYTES

#define G_IM_SIZ_8b_BYTES   1

The bytes of an 8-bit texel.

◆ G_IM_SIZ_8b_LINE_BYTES

#define G_IM_SIZ_8b_LINE_BYTES   1

The bytes of an 8-bit texel in a row.

◆ G_IM_SIZ_16b_LOAD_BLOCK

#define G_IM_SIZ_16b_LOAD_BLOCK   G_IM_SIZ_16b

16-bit texels load unchanged.

◆ G_IM_SIZ_16b_INCR

#define G_IM_SIZ_16b_INCR   0

The rounding of a 16-bit texel count.

◆ G_IM_SIZ_16b_SHIFT

#define G_IM_SIZ_16b_SHIFT   0

The shift of a 16-bit texel count.

◆ G_IM_SIZ_16b_BYTES

#define G_IM_SIZ_16b_BYTES   2

The bytes of a 16-bit texel.

◆ G_IM_SIZ_16b_LINE_BYTES

#define G_IM_SIZ_16b_LINE_BYTES   2

The bytes of a 16-bit texel in a row.

◆ G_TX_RENDERTILE

#define G_TX_RENDERTILE   0

The tile drawing uses.

◆ G_TX_LOADTILE

#define G_TX_LOADTILE   7

The tile loads use.

◆ G_TX_WRAP

#define G_TX_WRAP   0

Repeat the texture.

◆ G_TX_MIRROR

#define G_TX_MIRROR   1

Mirror the texture.

◆ G_TX_CLAMP

#define G_TX_CLAMP   2

Clamp to the edge texel.

◆ G_TX_NOLOD

#define G_TX_NOLOD   0

No level of detail.

◆ G_ON

#define G_ON   1

On.

◆ G_OFF

#define G_OFF   0

Off.

◆ G_TEXTURE_IMAGE_FRAC

#define G_TEXTURE_IMAGE_FRAC   2

The fraction bits of an image coordinate.

◆ G_TX_DXT_FRAC

#define G_TX_DXT_FRAC   11

The fraction bits of the row step of a load block.

◆ G_TX_LDBLK_MAX_TXL

#define G_TX_LDBLK_MAX_TXL   2047

The most texels one load block takes, less one.

◆ TXL2WORDS_4b

#define TXL2WORDS_4b ( txls)
Value:
((txls) / 16 > 1 ? (txls) / 16 : 1)

The 64-bit words of a row of a 4-bit texture, at least one.

◆ CALC_DXT_4b

#define CALC_DXT_4b ( width)
Value:
(((1 << G_TX_DXT_FRAC) + TXL2WORDS_4b(width) - 1) / TXL2WORDS_4b(width))
#define G_TX_DXT_FRAC
Definition gbi.h:364
#define TXL2WORDS_4b(txls)
The 64-bit words of a row of a 4-bit texture, at least one.
Definition gbi.h:370

The step of the row counter of a load block for a 4-bit texture of a width.

◆ TXL2WORDS

#define TXL2WORDS ( txls,
b_txl )
Value:
((txls) * (b_txl) / 8 > 1 ? (txls) * (b_txl) / 8 : 1)

The 64-bit words of a row of a texture with texels of b_txl bytes, at least one.

◆ CALC_DXT

#define CALC_DXT ( width,
b_txl )
Value:
(((1 << G_TX_DXT_FRAC) + TXL2WORDS(width, b_txl) - 1) / TXL2WORDS(width, b_txl))
#define TXL2WORDS(txls, b_txl)
The 64-bit words of a row of a texture with texels of b_txl bytes, at least one.
Definition gbi.h:376

The step of the row counter of a load block for a texture with texels of b_txl bytes.

◆ G_MW_CLIP

#define G_MW_CLIP   0x04

The index of the clipping ratio.

◆ G_MWO_CLIP_RNX

#define G_MWO_CLIP_RNX   0x04

The offset of the negative x ratio.

◆ G_MWO_CLIP_RNY

#define G_MWO_CLIP_RNY   0x0C

The offset of the negative y ratio.

◆ G_MWO_CLIP_RPX

#define G_MWO_CLIP_RPX   0x14

The offset of the positive x ratio.

◆ G_MWO_CLIP_RPY

#define G_MWO_CLIP_RPY   0x1C

The offset of the positive y ratio.

◆ FRUSTRATIO_1

#define FRUSTRATIO_1   1

A clipping box the size of the screen.

◆ FRUSTRATIO_6

#define FRUSTRATIO_6   6

A clipping box six times the size of the screen.

◆ G_MOVEMEM

#define G_MOVEMEM   0x03

Load a block of the microcode state.

◆ G_MV_L0

#define G_MV_L0   0x86

The block of light 0.

◆ G_MW_NUMLIGHT

#define G_MW_NUMLIGHT   0x02

The index of the light count.

◆ G_MWO_NUMLIGHT

#define G_MWO_NUMLIGHT   0x00

The offset of the light count.

◆ NUMLIGHTS_1

#define NUMLIGHTS_1   1

One directional light.

◆ NUMLIGHTS_4

#define NUMLIGHTS_4   4

Four directional lights.

◆ LIGHT_1

#define LIGHT_1   1

The first light.

◆ LIGHT_2

#define LIGHT_2   2

The second light.

◆ G_MV_LOOKATY

#define G_MV_LOOKATY   0x82

The block of the y look-at vector.

◆ G_MV_LOOKATX

#define G_MV_LOOKATX   0x84

The block of the x look-at vector.

◆ G_MV_MATRIX_1

#define G_MV_MATRIX_1   0x9E

The block of the first quarter of a matrix.

◆ G_MV_MATRIX_2

#define G_MV_MATRIX_2   0x98

The block of the second quarter of a matrix.

◆ G_MV_MATRIX_3

#define G_MV_MATRIX_3   0x9A

The block of the third quarter of a matrix.

◆ G_MV_MATRIX_4

#define G_MV_MATRIX_4   0x9C

The block of the fourth quarter of a matrix.

◆ G_MW_SEGMENT

#define G_MW_SEGMENT   0x06

The index of the segment table.

◆ G_MW_LIGHTCOL

#define G_MW_LIGHTCOL   0x0A

The index of the light colours.

◆ G_MW_PERSPNORM

#define G_MW_PERSPNORM   0x0E

The index of the perspective normalisation.

◆ G_MV_VIEWPORT

#define G_MV_VIEWPORT   0x80

The block of the viewport.

◆ G_MW_FOG

#define G_MW_FOG   0x08

The index of the fog parameters.

◆ G_MWO_FOG

#define G_MWO_FOG   0x00

The offset of the fog parameters.

◆ NUML

#define NUML ( n)
Value:
(((n) + 1) * 32 + 0x80000000)

The word gSPNumLights() sends for a number of directional lights.

◆ gDisplayListWords

#define gDisplayListWords ( pkt,
c0,
c1 )
Value:
{ \
Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = (c0); \
_g->words.w1 = (c1); \
}
u32 w0
Definition gbi.h:83
u32 w1
Definition gbi.h:84
A display list command for the Fast3D microcode.
Definition gbi.h:132
Gwords words
Definition gbi.h:133

Write a command of two words at pkt, which is evaluated once.

◆ gDPNoParam

#define gDPNoParam ( pkt,
cmd )
Value:
gDisplayListWords(pkt, _SHIFTL(cmd, 24, 8), 0)
#define gDisplayListWords(pkt, c0, c1)
Write a command of two words at pkt, which is evaluated once.
Definition gbi.h:459

Write command cmd with no parameters.

◆ gImmp1

#define gImmp1 ( pkt,
cmd,
data )
Value:
gDisplayListWords(pkt, _SHIFTL(cmd, 24, 8), GBI_WORD1(data))
#define GBI_WORD1(x)
The second word of a command for x, an address or an operand.
Definition gbi.h:128

Write command cmd with data as its second word.

◆ gMoveWd

#define gMoveWd ( pkt,
index,
offset,
data )
Value:
_SHIFTL(G_MOVEWORD, 24, 8) | _SHIFTL(offset, 8, 16) | _SHIFTL(index, 0, 8), \
GBI_WORD1(data))
#define G_MOVEWORD
Definition gbi.h:151

Write data to the word at offset in the microcode state of index.

◆ gSPSetOtherMode

#define gSPSetOtherMode ( pkt,
cmd,
sft,
len,
data )
Value:
pkt, _SHIFTL(cmd, 24, 8) | _SHIFTL(sft, 8, 8) | _SHIFTL(len, 0, 8), GBI_WORD1(data))

Replace len bits of an other mode word from bit sft with data.

◆ gSPMatrix

#define gSPMatrix ( pkt,
m,
p )
Value:
_SHIFTL(G_MTX, 24, 8) | _SHIFTL(p, 16, 8) | _SHIFTL(sizeof(Mtx), 0, 16), \
#define G_MTX
Definition gbi.h:140
A 4 by 4 matrix in s15.16 fixed point, with the integer halves before the fractions.
Definition gbi.h:16

Load or multiply matrix m by the G_MTX_* flags of p.

◆ gSPPopMatrix

#define gSPPopMatrix ( pkt,
n )
Value:
gImmp1(pkt, G_POPMTX, n)
#define gImmp1(pkt, cmd, data)
Write command cmd with data as its second word.
Definition gbi.h:470
#define G_POPMTX
Definition gbi.h:148

Pop the modelview matrix; n is the matrix stack.

◆ gSPDisplayList

#define gSPDisplayList ( pkt,
dl )
Value:
gDisplayListWords(pkt, _SHIFTL(G_DL, 24, 8), GBI_WORD1(dl))
#define G_DL
Definition gbi.h:142

Call display list dl.

◆ gSPEndDisplayList

#define gSPEndDisplayList ( pkt)
Value:
#define gDPNoParam(pkt, cmd)
Write command cmd with no parameters.
Definition gbi.h:468
#define G_ENDDL
Definition gbi.h:144

End the display list.

◆ gSPVertex

#define gSPVertex ( pkt,
v,
n,
v0 )
Value:
_SHIFTL(G_VTX, 24, 8) | _SHIFTL((v0) * 2, 16, 8) | _SHIFTL(n, 10, 6) | \
_SHIFTL(sizeof(Vtx) * (n) - 1, 0, 10), \
#define G_VTX
Definition gbi.h:141
A vertex for the RSP, with a colour or with a normal.
Definition gbi.h:75

Load n vertices into the vertex buffer of the F3DEX microcode from index v0.

◆ gSP2Triangles

#define gSP2Triangles ( pkt,
v00,
v01,
v02,
flag0,
v10,
v11,
v12,
flag1 )
Value:
_SHIFTL(G_TRI2, 24, 8) | __gsSP1Triangle_w1f(v00, v01, v02, flag0), \
__gsSP1Triangle_w1f(v10, v11, v12, flag1))
#define G_TRI2
Definition gbi.h:143

Draw two triangles of the vertex buffer.

◆ gSPSetGeometryMode

#define gSPSetGeometryMode ( pkt,
word )
Value:
#define G_SETGEOMETRYMODE
Definition gbi.h:149

Set the geometry mode bits of word.

◆ gSPClearGeometryMode

#define gSPClearGeometryMode ( pkt,
word )
Value:
#define G_CLEARGEOMETRYMODE
Definition gbi.h:150

Clear the geometry mode bits of word.

◆ gSPTexture

#define gSPTexture ( pkt,
s,
t,
level,
tile,
on )
Value:
_SHIFTL(G_TEXTURE, 24, 8) | _SHIFTL(level, 11, 3) | _SHIFTL(tile, 8, 3) | \
_SHIFTL(on, 0, 8), \
_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))
#define G_TEXTURE
Definition gbi.h:147

Set the texture scale s and t, the levels of detail, the tile, and whether texturing is on.

◆ gSPClipRatio

#define gSPClipRatio ( pkt,
r )
Value:
{ \
gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RNX, (u16)(r)); \
gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RNY, (u16)(r)); \
gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RPX, (u16) - (r)); \
gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RPY, (u16) - (r)); \
}
#define G_MWO_CLIP_RNY
Definition gbi.h:385
#define G_MWO_CLIP_RPY
Definition gbi.h:387
#define G_MWO_CLIP_RNX
Definition gbi.h:384
#define G_MW_CLIP
Definition gbi.h:383
#define G_MWO_CLIP_RPX
Definition gbi.h:386
unsigned short u16
Definition ultratypes.h:19

Set the ratio of the clipping box to the screen with four commands.

◆ gSPNumLights

#define gSPNumLights ( pkt,
n )
Value:
#define gMoveWd(pkt, index, offset, data)
Write data to the word at offset in the microcode state of index.
Definition gbi.h:472
#define NUML(n)
The word gSPNumLights() sends for a number of directional lights.
Definition gbi.h:428
#define G_MWO_NUMLIGHT
Definition gbi.h:395
#define G_MW_NUMLIGHT
Definition gbi.h:394

Set the number of directional lights.

◆ gSPLightColor

#define gSPLightColor ( pkt,
n,
col )
Value:
{ \
gMoveWd(pkt, G_MW_LIGHTCOL, ((n) - 1) * 0x20, col); \
gMoveWd(pkt, G_MW_LIGHTCOL, ((n) - 1) * 0x20 + 4, col); \
}
#define G_MW_LIGHTCOL
Definition gbi.h:409

Set the colour of light n, from 1, as its two copies.

◆ gSPPerspNormalize

#define gSPPerspNormalize ( pkt,
s )
Value:
#define G_MW_PERSPNORM
Definition gbi.h:410

Set the normalisation of the perspective, which gu's perspective routines return.

◆ gSPViewport

#define gSPViewport ( pkt,
v )
Value:
pkt, _SHIFTL(G_MOVEMEM, 24, 8) | _SHIFTL(G_MV_VIEWPORT, 16, 8) | sizeof(Vp), GBI_WORD1(v))
#define G_MV_VIEWPORT
Definition gbi.h:411
#define G_MOVEMEM
Definition gbi.h:392
A viewport, aligned for the RSP.
Definition gbi.h:422

Load a viewport.

◆ gSPFogPosition

#define gSPFogPosition ( pkt,
min,
max )
Value:
gMoveWd(pkt, \
(_SHIFTL((128000 / ((max) - (min))), 16, 16) | \
_SHIFTL(((500 - (min)) * 256 / ((max) - (min))), 0, 16)))
#define G_MWO_FOG
Definition gbi.h:413
#define G_MW_FOG
Definition gbi.h:412

Set the depths the fog starts and ends at, from 0 at the near plane to 1000 at the far.

◆ gSPSegment

#define gSPSegment ( pkt,
segment,
base )
Value:
gMoveWd(pkt, G_MW_SEGMENT, (segment) * 4, base)
#define G_MW_SEGMENT
Definition gbi.h:408

Set the base of a segment.

◆ gSPLookAt

#define gSPLookAt ( pkt,
la )
Value:
{ \
gDisplayListWords(pkt, \
_SHIFTL(G_MOVEMEM, 24, 8) | _SHIFTL(G_MV_LOOKATX, 16, 8) | \
_SHIFTL(sizeof(Light), 0, 16), \
GBI_WORD1(la)); \
gDisplayListWords(pkt, \
_SHIFTL(G_MOVEMEM, 24, 8) | _SHIFTL(G_MV_LOOKATY, 16, 8) | \
_SHIFTL(sizeof(Light), 0, 16), \
GBI_WORD1(la) + 16); \
}
#define G_MV_LOOKATY
Definition gbi.h:402
#define G_MV_LOOKATX
Definition gbi.h:403
A directional light, aligned for the RSP.
Definition gbi.h:33

Load the look-at of the reflections, its x then its y.

◆ gSPForceMatrix

#define gSPForceMatrix ( pkt,
m )
Value:
{ \
gDisplayListWords( \
pkt, _SHIFTL(G_MOVEMEM, 24, 8) | _SHIFTL(G_MV_MATRIX_1, 16, 8) | 16, GBI_WORD1(m)); \
gDisplayListWords(pkt, \
_SHIFTL(G_MOVEMEM, 24, 8) | _SHIFTL(G_MV_MATRIX_2, 16, 8) | 16, \
GBI_WORD1(m) + 16); \
gDisplayListWords(pkt, \
_SHIFTL(G_MOVEMEM, 24, 8) | _SHIFTL(G_MV_MATRIX_3, 16, 8) | 16, \
GBI_WORD1(m) + 32); \
gDisplayListWords(pkt, \
_SHIFTL(G_MOVEMEM, 24, 8) | _SHIFTL(G_MV_MATRIX_4, 16, 8) | 16, \
GBI_WORD1(m) + 48); \
}
#define G_MV_MATRIX_4
Definition gbi.h:407
#define G_MV_MATRIX_2
Definition gbi.h:405
#define G_MV_MATRIX_1
Definition gbi.h:404
#define G_MV_MATRIX_3
Definition gbi.h:406

Load a matrix as the product of the model view and the projection, a row pair at a time.

◆ gSPLight

#define gSPLight ( pkt,
l,
n )
Value:
_SHIFTL(G_MOVEMEM, 24, 8) | _SHIFTL(((n) - 1) * 2 + G_MV_L0, 16, 8) | \
_SHIFTL(sizeof(Light), 0, 16), \
#define G_MV_L0
Definition gbi.h:393

Load a light into light slot n, from 1.

The ambient light follows the directional ones.

◆ gDPPipeSync

#define gDPPipeSync ( pkt)
Value:
#define G_RDPPIPESYNC
Definition gbi.h:154

Wait for the RDP pipeline to drain before a mode changes.

◆ gDPTileSync

#define gDPTileSync ( pkt)
Value:
#define G_RDPTILESYNC
Definition gbi.h:155

Wait for the tile descriptors to settle before a tile changes.

◆ gDPSetCycleType

#define gDPSetCycleType ( pkt,
type )
Value:
#define gSPSetOtherMode(pkt, cmd, sft, len, data)
Replace len bits of an other mode word from bit sft with data.
Definition gbi.h:477
#define G_SETOTHERMODE_H
Definition gbi.h:153
#define G_MDSFT_CYCLETYPE
Definition gbi.h:219

Set the G_CYC_* cycle type.

◆ gDPSetTextureFilter

#define gDPSetTextureFilter ( pkt,
type )
Value:
#define G_MDSFT_TEXTFILT
Definition gbi.h:214

Set the G_TF_* texture filter.

◆ gDPSetTextureLOD

#define gDPSetTextureLOD ( pkt,
type )
Value:
#define G_MDSFT_TEXTLOD
Definition gbi.h:216

Set the G_TL_* texture level of detail.

◆ gDPSetTextureDetail

#define gDPSetTextureDetail ( pkt,
type )
Value:
#define G_MDSFT_TEXTDETAIL
Definition gbi.h:217

Set the G_TD_* texture detail.

◆ gDPSetTextureConvert

#define gDPSetTextureConvert ( pkt,
type )
Value:
#define G_MDSFT_TEXTCONV
Definition gbi.h:213

Set the G_TC_* texture conversion.

◆ gDPSetCombineKey

#define gDPSetCombineKey ( pkt,
type )
Value:
#define G_MDSFT_COMBKEY
Definition gbi.h:212

Set the G_CK_* chroma key.

◆ gDPSetColorDither

#define gDPSetColorDither ( pkt,
mode )
Value:
#define G_MDSFT_RGBDITHER
Definition gbi.h:211

Set the G_CD_* colour dither.

◆ gDPSetAlphaDither

#define gDPSetAlphaDither ( pkt,
mode )
Value:
#define G_MDSFT_ALPHADITHER
Definition gbi.h:210

Set the G_AD_* alpha dither.

◆ gDPSetAlphaCompare

#define gDPSetAlphaCompare ( pkt,
type )
Value:
#define G_MDSFT_ALPHACOMPARE
Definition gbi.h:207
#define G_SETOTHERMODE_L
Definition gbi.h:152

Set the G_AC_* alpha compare.

◆ gDPSetDepthSource

#define gDPSetDepthSource ( pkt,
src )
Value:
#define G_MDSFT_ZSRCSEL
Definition gbi.h:208

Set the G_ZS_* depth source.

◆ gDPSetBlendColor

#define gDPSetBlendColor ( pkt,
r,
g,
b,
a )
Value:
_SHIFTL(G_SETBLENDCOLOR, 24, 8), \
_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8))
#define G_SETBLENDCOLOR
Definition gbi.h:159

Set the blend colour.

◆ gDPSetPrimDepth

#define gDPSetPrimDepth ( pkt,
z,
dz )
Value:
gDisplayListWords(pkt, _SHIFTL(G_SETPRIMDEPTH, 24, 8), _SHIFTL(z, 16, 16) | _SHIFTL(dz, 0, 16))
#define G_SETPRIMDEPTH
Definition gbi.h:160

Set the depth of a primitive whose depth source is G_ZS_PRIM.

◆ gDPSetScissor

#define gDPSetScissor ( pkt,
mode,
ulx,
uly,
lrx,
lry )
Value:
_SHIFTL(G_SETSCISSOR, 24, 8) | _SHIFTL((s32)((f32)(ulx) * 4.0f), 12, 12) | \
_SHIFTL((s32)((f32)(uly) * 4.0f), 0, 12), \
_SHIFTL(mode, 24, 2) | _SHIFTL((s32)((f32)(lrx) * 4.0f), 12, 12) | \
_SHIFTL((s32)((f32)(lry) * 4.0f), 0, 12))
#define G_SETSCISSOR
Definition gbi.h:174
float f32
Definition ultratypes.h:38
int s32
Definition ultratypes.h:25

Set the scissor rectangle: integer coordinates on Windows, 10.2 fixed point on N64.

◆ gDPSetRenderMode

#define gDPSetRenderMode ( pkt,
c0,
c1 )
Value:
#define G_MDSFT_RENDERMODE
Definition gbi.h:209

Set the render mode from the modes of the first and second cycles.

◆ gDPSetEnvColor

#define gDPSetEnvColor ( pkt,
r,
g,
b,
a )
Value:
_SHIFTL(G_SETENVCOLOR, 24, 8), \
_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8))
#define G_SETENVCOLOR
Definition gbi.h:157

Set the environment colour.

◆ gDPSetFogColor

#define gDPSetFogColor ( pkt,
r,
g,
b,
a )
Value:
_SHIFTL(G_SETFOGCOLOR, 24, 8), \
_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8))
#define G_SETFOGCOLOR
Definition gbi.h:158

Set the fog colour.

◆ gDPSetTile

#define gDPSetTile ( pkt,
fmt,
siz,
line,
tmem,
tile,
palette,
cmt,
maskt,
shiftt,
cms,
masks,
shifts )
Value:
_SHIFTL(G_SETTILE, 24, 8) | _SHIFTL(fmt, 21, 3) | _SHIFTL(siz, 19, 2) | \
_SHIFTL(line, 9, 9) | _SHIFTL(tmem, 0, 9), \
_SHIFTL(tile, 24, 3) | _SHIFTL(palette, 20, 4) | _SHIFTL(cmt, 18, 2) | \
_SHIFTL(maskt, 14, 4) | _SHIFTL(shiftt, 10, 4) | _SHIFTL(cms, 8, 2) | \
_SHIFTL(masks, 4, 4) | _SHIFTL(shifts, 0, 4))
#define G_SETTILE
Definition gbi.h:156

Set the format, texel size, row length, address, palette, and wrapping of a tile.

◆ gDPSetCombineLERP

#define gDPSetCombineLERP ( pkt,
a0,
b0,
c0,
d0,
Aa0,
Ab0,
Ac0,
Ad0,
a1,
b1,
c1,
d1,
Aa1,
Ab1,
Ac1,
Ad1 )
Value:
_SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(G_CCMUX_##a0, 20, 4) | \
_SHIFTL(G_CCMUX_##c0, 15, 5) | _SHIFTL(G_ACMUX_##Aa0, 12, 3) | \
_SHIFTL(G_ACMUX_##Ac0, 9, 3) | _SHIFTL(G_CCMUX_##a1, 5, 4) | \
_SHIFTL(G_CCMUX_##c1, 0, 5), \
_SHIFTL(G_CCMUX_##b0, 28, 4) | _SHIFTL(G_CCMUX_##b1, 24, 4) | \
_SHIFTL(G_ACMUX_##Aa1, 21, 3) | _SHIFTL(G_ACMUX_##Ac1, 18, 3) | \
_SHIFTL(G_CCMUX_##d0, 15, 3) | _SHIFTL(G_ACMUX_##Ab0, 12, 3) | \
_SHIFTL(G_ACMUX_##Ad0, 9, 3) | _SHIFTL(G_CCMUX_##d1, 6, 3) | \
_SHIFTL(G_ACMUX_##Ab1, 3, 3) | _SHIFTL(G_ACMUX_##Ad1, 0, 3))
#define G_SETCOMBINE
Definition gbi.h:161

Set the colour combiner from the a, b, c and d inputs of (a - b) * c + d for each cycle.

◆ gDPLoadSync

#define gDPLoadSync ( pkt)
Value:
#define G_RDPLOADSYNC
Definition gbi.h:166

Wait for a texture load to finish.

◆ gDPFullSync

#define gDPFullSync ( pkt)
Value:
#define G_RDPFULLSYNC
Definition gbi.h:177

Wait for the RDP to finish the frame and raise its interrupt.

◆ gDPSetDepthImage

#define gDPSetDepthImage ( pkt,
i )
Value:
gDisplayListWords(pkt, _SHIFTL(G_SETZIMG, 24, 8), GBI_WORD1(i))
#define G_SETZIMG
Definition gbi.h:176

Set the depth buffer to i.

◆ gDPSetColorImage

#define gDPSetColorImage ( pkt,
f,
s,
w,
i )
Value:
_SHIFTL(G_SETCIMG, 24, 8) | _SHIFTL(f, 21, 3) | _SHIFTL(s, 19, 2) | \
_SHIFTL((w) - 1, 0, 12), \
#define G_SETCIMG
Definition gbi.h:175

Set the colour buffer to i, of format f, texel size s, and width w.

◆ GPACK_RGBA5551

#define GPACK_RGBA5551 ( r,
g,
b,
a )
Value:
((((r) << 8) & 0xF800) | (((g) << 3) & 0x7C0) | (((b) >> 2) & 0x3E) | ((a) & 0x1))

A colour of RGBA 5551 from components of 8 bits and an alpha of 1 bit.

◆ GPACK_ZDZ

#define GPACK_ZDZ ( z,
dz )
Value:
((z) << 2 | (dz))

A depth and its slope, as the depth buffer stores them.

◆ G_MAXFIXED

#define G_MAXFIXED   0x3FFF

The farthest depth.

◆ gDPSetFillColor

#define gDPSetFillColor ( pkt,
d )
Value:
gDisplayListWords(pkt, _SHIFTL(G_SETFILLCOLOR, 24, 8), (u32)(d))
#define G_SETFILLCOLOR
Definition gbi.h:173

Set the fill colour, a 32-bit word of one or two packed pixels.

◆ gDPFillRectangle

#define gDPFillRectangle ( pkt,
ulx,
uly,
lrx,
lry )
Value:
_SHIFTL(G_FILLRECT, 24, 8) | _SHIFTL(lrx, 14, 10) | _SHIFTL(lry, 2, 10), \
_SHIFTL(ulx, 14, 10) | _SHIFTL(uly, 2, 10))
#define G_FILLRECT
Definition gbi.h:172

Fill a rectangle, its corners inclusive, with the fill colour.

◆ gDPSetTextureLUT

#define gDPSetTextureLUT ( pkt,
type )
Value:
#define G_MDSFT_TEXTLUT
Definition gbi.h:215

Set the G_TT_* texture palette.

◆ gDPSetTexturePersp

#define gDPSetTexturePersp ( pkt,
type )
Value:
#define G_MDSFT_TEXTPERSP
Definition gbi.h:218

Set the G_TP_* texture perspective correction.

◆ gDPSetPrimColor

#define gDPSetPrimColor ( pkt,
m,
l,
r,
g,
b,
a )
Value:
_SHIFTL(G_SETPRIMCOLOR, 24, 8) | _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8), \
_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8))
#define G_SETPRIMCOLOR
Definition gbi.h:169

Set the primitive colour with the minimum level of detail m and its fraction l.

◆ gDPSetTextureImage

#define gDPSetTextureImage ( pkt,
f,
s,
w,
i )
Value:
_SHIFTL(G_SETTIMG, 24, 8) | _SHIFTL(f, 21, 3) | _SHIFTL(s, 19, 2) | \
_SHIFTL((w) - 1, 0, 12), \
#define G_SETTIMG
Definition gbi.h:170

Set the texture image to i, of format f, texel size s, and width w.

◆ gDPLoadBlock

#define gDPLoadBlock ( pkt,
tile,
uls,
ult,
lrs,
dxt )
Value:
pkt, \
_SHIFTL(G_LOADBLOCK, 24, 8) | _SHIFTL(uls, 12, 12) | _SHIFTL(ult, 0, 12), \
_SHIFTL(tile, 24, 3) | \
_SHIFTL((lrs) < G_TX_LDBLK_MAX_TXL ? (lrs) : G_TX_LDBLK_MAX_TXL, 12, 12) | \
_SHIFTL(dxt, 0, 12))
#define G_TX_LDBLK_MAX_TXL
The most texels one load block takes, less one.
Definition gbi.h:367
#define G_LOADBLOCK
Definition gbi.h:168

Load texels uls to lrs of the texture image through a tile, with row step dxt.

◆ gDPSetTileSize

#define gDPSetTileSize ( pkt,
t,
uls,
ult,
lrs,
lrt )
Value:
_SHIFTL(G_SETTILESIZE, 24, 8) | _SHIFTL(uls, 12, 12) | _SHIFTL(ult, 0, 12), \
_SHIFTL(t, 24, 3) | _SHIFTL(lrs, 12, 12) | _SHIFTL(lrt, 0, 12))
#define G_SETTILESIZE
Definition gbi.h:167

Set the extent of tile t, in 10.2 fixed point.

◆ gDPLoadTLUTCmd

#define gDPLoadTLUTCmd ( pkt,
tile,
count )
Value:
pkt, _SHIFTL(G_LOADTLUT, 24, 8), _SHIFTL(tile, 24, 3) | _SHIFTL(count, 14, 10))
#define G_LOADTLUT
Definition gbi.h:146

Load count + 1 colors of a palette through a tile.

◆ gDPLoadTLUT_pal256

#define gDPLoadTLUT_pal256 ( pkt,
dram )
Value:
{ \
gDPSetTextureImage(pkt, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, dram); \
gDPTileSync(pkt); \
gDPSetTile(pkt, 0, 0, 0, 256, G_TX_LOADTILE, 0, 0, 0, 0, 0, 0, 0); \
gDPLoadSync(pkt); \
gDPLoadTLUTCmd(pkt, G_TX_LOADTILE, 255); \
gDPPipeSync(pkt); \
}
#define G_TX_LOADTILE
Definition gbi.h:354
#define G_IM_FMT_RGBA
Definition gbi.h:330
#define G_IM_SIZ_16b
Definition gbi.h:336

Load a palette of 256 colors into the upper half of the texture memory.

◆ gDPLoadTLUT_pal16

#define gDPLoadTLUT_pal16 ( pkt,
pal,
dram )
Value:
{ \
gDPSetTextureImage(pkt, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, dram); \
gDPTileSync(pkt); \
gDPSetTile(pkt, 0, 0, 0, 256 + (((pal) & 0xF) * 16), G_TX_LOADTILE, 0, 0, 0, 0, 0, 0, 0); \
gDPLoadSync(pkt); \
gDPLoadTLUTCmd(pkt, G_TX_LOADTILE, 15); \
gDPPipeSync(pkt); \
}

Load a palette of 16 colors into one of the sixteen palettes of the upper texture memory.

◆ gDPSetHilite1Tile

#define gDPSetHilite1Tile ( pkt,
tile,
hilite,
width,
height )
Value:
tile, \
(hilite)->h.x1 & 0xFFF, \
(hilite)->h.y1 & 0xFFF, \
((((width) - 1) * 4) + (hilite)->h.x1) & 0xFFF, \
((((height) - 1) * 4) + (hilite)->h.y1) & 0xFFF)
#define gDPSetTileSize(pkt, t, uls, ult, lrs, lrt)
Set the extent of tile t, in 10.2 fixed point.
Definition gbi.h:757

Place a tile of a size at the first specular highlight.

◆ gDPLoadTile

#define gDPLoadTile ( pkt,
t,
uls,
ult,
lrs,
lrt )
Value:
_SHIFTL(G_LOADTILE, 24, 8) | _SHIFTL(uls, 12, 12) | _SHIFTL(ult, 0, 12), \
_SHIFTL(t, 24, 3) | _SHIFTL(lrs, 12, 12) | _SHIFTL(lrt, 0, 12))
#define G_LOADTILE
Definition gbi.h:171

Load a rectangle of texels.

The coordinates are in 10.2 fixed point.

◆ gDPLoadTextureBlock_4b

#define gDPLoadTextureBlock_4b ( pkt,
timg,
fmt,
width,
height,
pal,
cms,
cmt,
masks,
maskt,
shifts,
shiftt )

Load a 4-bit texture into the texture memory and set up the render tile to draw it.

◆ gDPLoadTextureBlock

#define gDPLoadTextureBlock ( pkt,
timg,
fmt,
siz,
width,
height,
pal,
cms,
cmt,
masks,
maskt,
shifts,
shiftt )

Load an 8-bit or 16-bit texture into the texture memory and set up the render tile.

◆ gDPLoadTextureTile_4b

#define gDPLoadTextureTile_4b ( pkt,
timg,
fmt,
width,
height,
uls,
ult,
lrs,
lrt,
pal,
cms,
cmt,
masks,
maskt,
shifts,
shiftt )

Load a rectangle of a 4-bit texture into the texture memory and set up the render tile.

◆ gSPTextureRectangle

#define gSPTextureRectangle ( pkt,
xl,
yl,
xh,
yh,
tile,
s,
t,
dsdx,
dtdy )
Value:
{ \
gDisplayListWords(pkt, \
_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | _SHIFTL(yh, 0, 12), \
_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12)); \
gImmp1(pkt, G_RDPHALF_1, _SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)); \
gImmp1(pkt, G_RDPHALF_2, _SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)); \
}
#define G_RDPHALF_1
Definition gbi.h:163
#define G_RDPHALF_2
Definition gbi.h:162
#define G_TEXRECT
Definition gbi.h:164

Draw a textured rectangle in screen coordinates of 10.2 fixed point.