Primitives

Availability of different geometry primitives depends on the version of the RSP microcode which has been loaded for execution.

Triangles

Table 1  gsSP1Triangle(int v0, int v1, int v2, int flag)
Parameter Values
v0 vertex buffer index of the first coordinate. (0-15)
v1 vertex buffer index of the second coordinate. (0-15)
v2 vertex buffer index of the third coordinate. (0-15)
flag used for flat shading; ordinal id of the vertex parameter to use for shading: 0, 1, or 2

Other bits of the flag field are currently reserved.

Lines

Table 2  gsSPLine3D(int v0, int v1, int flag)
Parameter Values
v0 vertex buffer index of the first coordinate. (0-15)
v1 vertex buffer index of the second coordinate. (0-15)
flag unused (should be 0)

Lines are only available when running the line microcode. All the normal vertex attributes (color, texture, z) are also available for lines. Lines however require separate rdp render modes to be set than for polygons. Consult the man pages for more details. Z-buffered lines will only do reads of the z-buffer, and not writes. Thus z-buffered lines should be drawn after z-buffered polygons.

Rectangles
All rectangles are 2D primitives, specified in screen-coordinates. They are not clipped, but they are scissored in a limited fashion. In 1CYCLE and 2CYCLE mode, rectangles are scissored in the same way as triangles. In COPY and FILL modes, rectangles are scissored to four pixel boundaries; meaning that additional scissoring may be necessary in the application program.

Filled rectangles are implemented entirely in the RDP, as �pass-through� commands with respect to the RSP. They are mentioned here for completeness:

Table 3  gsDPFillRectangle(unsigned int ulx, unsigned int uly, unsigned int lrx,
unsigned int lry)
Parameter Values
ulx screen coordinate of upper-left x (10.2 format)
uly screen coordinate of upper-left y (10.2 format)
lrx screen coordinate of lower-right x (10.2 format)
lry screen coordinate of lower-right y (10.2 format)

Textured rectangles require minimal RSP intervention, and are thus an SP operation:

Table 4  gsSPTextureRectangle(unsigned int ulx, unsigned int uly, unsigned int lrx,
unsigned int lry, int tile, short int s, short int t, short int dsdx, short int dtdy)
Parameter Values
ulx screen coordinate of upper-left x (10.2 format)
uly screen coordinate of upper-left y (10.2 format)
lrx screen coordinate of lower-right x (10.2 format)
lry screen coordinate of lower-right y (10.2 format)
tile which tile in TMEM to use
s s coordinate of upper-left corner (S10.5 format)
t t coordinate of upper-left corner (S10.5 format)
dsdx change in s per change in x coordinate (S5.10 format)
dtdy change in t per change in y coordinate (S5.10 format)

There is a related macro, gsSPTextureRectangleFlip(), that is identical to gsSPTextureRectangle(),  except that the texture is flipped so that the s coordinate changes in the y direction, and the t coordinate changes in the x direction:

Table 5 gsSPTextureRectangleFlip(unsigned int ulx, unsigned int uly, unsigned int lrx,
unsigned int lry, int tile, short int s, short int t, short int dtdx, short int dsdy)
Parameter Values
ulx screen coordinate of upper-left x (10.2 format)
uly screen coordinate of upper-left y (10.2 format)
lrx screen coordinate of lower-right x (10.2 format)
lry screen coordinate of lower-right y (10.2 format)
tile which tile in TMEM to use
s s coordinate of upper-left corner (S10.5 format)
t t coordinate of upper-left corner (S10.5 format)
dsdx change in s per change in x coordinate (S5.10 format)
dtdy change in t per change in y coordinate (S5.10 format)

Copyright © 1999
Nintendo of America Inc. All Rights Reserved
Nintendo and N64 are registered trademarks of Nintendo
Last Updated January, 1999