PSPSDK 2024-10-31
|
Functions | |
void | sceGuDepthBuffer (void *zbp, int zbw) |
Set depth buffer parameters. | |
void | sceGuDispBuffer (int width, int height, void *dispbp, int dispbw) |
Set display buffer parameters. | |
void | sceGuDrawBuffer (int psm, void *fbp, int fbw) |
Set draw buffer parameters (and store in context for buffer-swap) | |
void | sceGuDrawBufferList (int psm, void *fbp, int fbw) |
Set draw buffer directly, not storing parameters in the context. | |
int | sceGuDisplay (int state) |
Turn display on or off. | |
void | sceGuDepthFunc (int function) |
Select which depth-test function to use. | |
void | sceGuDepthMask (int mask) |
Mask depth buffer writes. | |
void | sceGuDepthOffset (unsigned int offset) |
void | sceGuDepthRange (int near, int far) |
Set which range to use for depth calculations. | |
void | sceGuFog (float near, float far, unsigned int color) |
void | sceGuInit (void) |
Initalize the GU system. | |
void | sceGuTerm (void) |
Shutdown the GU system. | |
void | sceGuBreak (int a0) |
void | sceGuContinue (void) |
void * | sceGuSetCallback (int signal, void(*callback)(int)) |
Setup signal handler. | |
void | sceGuSignal (int signal, int behavior) |
Trigger signal to call code from the command stream. | |
void | sceGuSendCommandf (int cmd, float argument) |
Send raw float-command to the GE. | |
void | sceGuSendCommandi (int cmd, int argument) |
Send raw command to the GE. | |
void * | sceGuGetMemory (int size) |
Allocate memory on the current display list for temporary storage. | |
void | sceGuStart (int cid, void *list) |
Start filling a new display-context. | |
int | sceGuFinish (void) |
Finish current display list and go back to the parent context. | |
int | sceGuFinishId (unsigned int id) |
Finish current display list and go back to the parent context, sending argument id for the finish callback. | |
void | sceGuCallList (const void *list) |
Call previously generated display-list. | |
void | sceGuCallMode (int mode) |
Set wether to use stack-based calls or signals to handle execution of called lists. | |
int | sceGuCheckList (void) |
Check how large the current display-list is. | |
int | sceGuSendList (int mode, const void *list, PspGeContext *context) |
Send a list to the GE directly. | |
void * | sceGuSwapBuffers (void) |
Swap display and draw buffer. | |
int | sceGuSync (int mode, int what) |
Wait until display list has finished executing. | |
void | sceGuDrawArray (int prim, int vtype, int count, const void *indices, const void *vertices) |
Draw array of vertices forming primitives. | |
void | sceGuBeginObject (int vtype, int count, const void *indices, const void *vertices) |
Begin conditional rendering of object. | |
void | sceGuEndObject (void) |
End conditional rendering of object. | |
void | sceGuSetStatus (int state, int status) |
Enable or disable GE state. | |
int | sceGuGetStatus (int state) |
Get if state is currently enabled or disabled. | |
void | sceGuSetAllStatus (int status) |
Set the status on all 22 available states. | |
int | sceGuGetAllStatus (void) |
Query status on all 22 available states. | |
void | sceGuEnable (int state) |
Enable GE state. | |
void | sceGuDisable (int state) |
Disable GE state. | |
void | sceGuLight (int light, int type, int components, const ScePspFVector3 *position) |
Set light parameters. | |
void | sceGuLightAtt (int light, float atten0, float atten1, float atten2) |
Set light attenuation. | |
void | sceGuLightColor (int light, int component, unsigned int color) |
Set light color. | |
void | sceGuLightMode (int mode) |
Set light mode. | |
void | sceGuLightSpot (int light, const ScePspFVector3 *direction, float exponent, float cutoff) |
Set spotlight parameters. | |
void | sceGuClear (int flags) |
Clear current drawbuffer. | |
void | sceGuClearColor (unsigned int color) |
Set the current clear-color. | |
void | sceGuClearDepth (unsigned int depth) |
Set the current clear-depth. | |
void | sceGuClearStencil (unsigned int stencil) |
Set the current stencil clear value. | |
void | sceGuPixelMask (unsigned int mask) |
Set mask for which bits of the pixels to write. | |
void | sceGuColor (unsigned int color) |
Set current primitive color. | |
void | sceGuColorFunc (int func, unsigned int color, unsigned int mask) |
Set the color test function. | |
void | sceGuColorMaterial (int components) |
Set which color components that the material will receive. | |
void | sceGuAlphaFunc (int func, int value, int mask) |
Set the alpha test parameters. | |
void | sceGuAmbient (unsigned int color) |
void | sceGuAmbientColor (unsigned int color) |
void | sceGuBlendFunc (int op, int src, int dest, unsigned int srcfix, unsigned int destfix) |
Set the blending-mode. | |
void | sceGuMaterial (int mode, int color) |
void | sceGuModelColor (unsigned int emissive, unsigned int ambient, unsigned int diffuse, unsigned int specular) |
void | sceGuStencilFunc (int func, int ref, int mask) |
Set stencil function and reference value for stencil testing. | |
void | sceGuStencilOp (int fail, int zfail, int zpass) |
Set the stencil test actions. | |
void | sceGuSpecular (float power) |
Set the specular power for the material. | |
void | sceGuFrontFace (int order) |
Set the current face-order (for culling) | |
void | sceGuLogicalOp (int op) |
Set color logical operation. | |
void | sceGuSetDither (const ScePspIMatrix4 *matrix) |
Set ordered pixel dither matrix. | |
void | sceGuShadeModel (int mode) |
Set how primitives are shaded. | |
void | sceGuCopyImage (int psm, int sx, int sy, int width, int height, int srcw, void *src, int dx, int dy, int destw, void *dest) |
Image transfer using the GE. | |
void | sceGuTexEnvColor (unsigned int color) |
Specify the texture environment color. | |
void | sceGuTexFilter (int min, int mag) |
Set how the texture is filtered. | |
void | sceGuTexFlush (void) |
Flush texture page-cache. | |
void | sceGuTexFunc (int tfx, int tcc) |
Set how textures are applied. | |
void | sceGuTexImage (int mipmap, int width, int height, int tbw, const void *tbp) |
Set current texturemap. | |
void | sceGuTexLevelMode (unsigned int mode, float bias) |
Set texture-level mode (mipmapping) | |
void | sceGuTexMapMode (int mode, unsigned int a1, unsigned int a2) |
Set the texture-mapping mode. | |
void | sceGuTexMode (int tpsm, int maxmips, int a2, int swizzle) |
Set texture-mode parameters. | |
void | sceGuTexOffset (float u, float v) |
Set texture offset. | |
void | sceGuTexProjMapMode (int mode) |
Set texture projection-map mode. | |
void | sceGuTexScale (float u, float v) |
Set texture scale. | |
void | sceGuTexSlope (float slope) |
void | sceGuTexSync () |
Synchronize rendering pipeline with image upload. | |
void | sceGuTexWrap (int u, int v) |
Set if the texture should repeat or clamp. | |
void | sceGuClutLoad (int num_blocks, const void *cbp) |
Upload CLUT (Color Lookup Table) | |
void | sceGuClutMode (unsigned int cpsm, unsigned int shift, unsigned int mask, unsigned int a3) |
Set current CLUT mode. | |
void | sceGuOffset (unsigned int x, unsigned int y) |
Set virtual coordinate offset. | |
void | sceGuScissor (int x, int y, int w, int h) |
Set what to scissor within the current viewport. | |
void | sceGuViewport (int cx, int cy, int width, int height) |
Set current viewport. | |
void | sceGuDrawBezier (int vtype, int ucount, int vcount, const void *indices, const void *vertices) |
Draw bezier surface. | |
void | sceGuPatchDivide (unsigned int ulevel, unsigned int vlevel) |
Set dividing for patches (beziers and splines) | |
void | sceGuPatchFrontFace (unsigned int a0) |
void | sceGuPatchPrim (int prim) |
Set primitive for patches (beziers and splines) | |
void | sceGuDrawSpline (int vtype, int ucount, int vcount, int uedge, int vedge, const void *indices, const void *vertices) |
void | sceGuSetMatrix (int type, const ScePspFMatrix4 *matrix) |
Set transform matrices. | |
void | sceGuBoneMatrix (unsigned int index, const ScePspFMatrix4 *matrix) |
Specify skinning matrix entry. | |
void | sceGuMorphWeight (int index, float weight) |
Specify morph weight entry. | |
void | sceGuDrawArrayN (int primitive_type, int vertex_type, int count, int a3, const void *indices, const void *vertices) |
void | guSwapBuffersBehaviour (int behaviour) |
Set how the display should be set. | |
void | guSwapBuffersCallback (GuSwapBuffersCallback callback) |
Set a buffer swap callback to allow for more advanced buffer methods without hacking the library. | |
void * | guGetStaticVramBuffer (unsigned int width, unsigned int height, unsigned int psm) |
Allocate a draw buffer in vram. | |
void * | guGetStaticVramTexture (unsigned int width, unsigned int height, unsigned int psm) |
Allocate a texture in vram. | |
int | guGetDisplayState () |
Get state of display. | |
int guGetDisplayState | ( | ) |
Get state of display.
Available states are:
References gu_display_on.
Allocate a draw buffer in vram.
Available pixel formats are:
width | - Width of the buffer, usually 512 (must be a power of 2) |
height | - Height of the buffer, normally the height of the screen 272 |
psm | - Which pixel format to use |
References x.
Referenced by guGetStaticVramTexture().
Allocate a texture in vram.
Available texture-formats are:
width | - Width of the texture (must be a power of 2) |
height | - Height of the texture (must be a power of 2) |
psm | - Which pixel format to use |
References guGetStaticVramBuffer(), sceGeEdramGetAddr(), and x.
Set how the display should be set.
Available behaviours are:
Do remember that this swaps the pointers internally, regardless of setting, so be careful to wait until the next vertical blank or use another buffering algorithm (see guSwapBuffersCallback()).
References gu_settings, GuSettings::swapBuffersBehaviour, and x.
void guSwapBuffersCallback | ( | GuSwapBuffersCallback | callback | ) |
Set a buffer swap callback to allow for more advanced buffer methods without hacking the library.
The GuSwapBuffersCallback is defined like this:
and on entry they contain the variables that are to be set. To change the pointers that will be used, just write the new pointers. Example of a triple-buffering algorithm:
callback | - Callback to access when buffers are swapped. Pass 0 to disable. |
References gu_settings, and GuSettings::swapBuffersCallback.
Set the alpha test parameters.
Available comparison functions are:
func | - Specifies the alpha comparison function. |
value | - Specifies the reference value that incoming alpha values are compared to. |
mask | - Specifies the mask that both values are ANDed with before comparison. |
References a0, a1, a2, and ALPHA_TEST.
References AMBIENT_LIGHT_ALPHA, AMBIENT_LIGHT_COLOR, and x.
References AMBIENT_ALPHA, AMBIENT_COLOR, and x.
Begin conditional rendering of object.
If no vertices passed into this function are inside the scissor region, it will skip rendering the object. There can be up to 32 levels of conditional testing, and all levels HAVE to be terminated by sceGuEndObject().
vtype | - Vertex type to process |
count | - Number of vertices to test |
indices | - Optional list to an index-list |
vertices | - Pointer to a vertex-list |
References a1, BASE, BJUMP, BOUNDING_BOX, GuDisplayList::current, gu_list, gu_object_stack, gu_object_stack_depth, IADDR, VADDR, VERTEX_TYPE, and x.
Set the blending-mode.
Keys for the blending operations:
Available blending-operations are:
Available blending-functions are:
op | - Blending Operation |
src | - Blending function for source operand |
dest | - Blending function for dest operand |
srcfix | - Fix value for GU_FIX (source operand) |
destfix | - Fix value for GU_FIX (dest operand) |
References BLEND_FIXED_A, BLEND_FIXED_B, BLEND_MODE, and x.
void sceGuBoneMatrix | ( | unsigned int | index, |
const ScePspFMatrix4 * | matrix | ||
) |
Specify skinning matrix entry.
To enable vertex skinning, pass GU_WEIGHTS(n), where n is between 1-8, and pass available GU_WEIGHT_??? declaration. This will change the amount of weights passed in the vertex araay, and by setting the skinning, matrices, you will multiply each vertex every weight and vertex passed.
Please see sceGuDrawArray() for vertex format information.
index | - Skinning matrix index (0-7) |
matrix | - Matrix to set |
References BONE_MATRIX_DATA, BONE_MATRIX_NUMBER, i, and x.
Set wether to use stack-based calls or signals to handle execution of called lists.
mode | - GU_TRUE(1) to enable signals, GU_FALSE(0) to disable signals and use normal calls instead. |
References gu_call_mode.
Check how large the current display-list is.
References GuDisplayList::current, gu_list, GuDisplayList::start, and x.
Clear current drawbuffer.
Available clear-flags are (OR them together to get final clear-mode):
flags | - Which part of the buffer to clear |
References GuContext::clear_color, GuContext::clear_depth, CLEAR_MODE, GuContext::clear_stencil, flags, GU_COLOR_8888, GU_COLOR_BUFFER_BIT, gu_contexts, gu_curr_context, GU_DEPTH_BUFFER_BIT, gu_draw_buffer, GU_FAST_CLEAR_BIT, GU_SPRITES, GU_STENCIL_BUFFER_BIT, GU_TRANSFORM_2D, GU_VERTEX_16BIT, GuDrawBuffer::height, i, GuDrawBuffer::pixel_size, sceGuDrawArray(), sceGuGetMemory(), GuDrawBuffer::width, x, y, and z.
Set the current clear-color.
color | - Color to clear with |
References GuContext::clear_color, gu_contexts, gu_curr_context, and x.
Set the current clear-depth.
depth | - Set which depth to clear with (0x0000-0xffff) |
References GuContext::clear_depth, gu_contexts, gu_curr_context, and x.
Set the current stencil clear value.
stencil | - Set which stencil value to clear with (0-255) |
References GuContext::clear_stencil, gu_contexts, gu_curr_context, and x.
Upload CLUT (Color Lookup Table)
num_blocks | - How many blocks of 8 entries to upload (32*8 is 256 colors) |
cbp | - Pointer to palette (16 byte aligned) |
References CLUT_BUF_PTR, CLUT_BUF_WIDTH, CLUT_LOAD, and x.
Set current CLUT mode.
Available pixel formats for palettes are:
cpsm | - Which pixel format to use for the palette |
shift | - Shifts color index by that many bits to the right |
mask | - Masks the color index with this bitmask after the shift (0-0xFF) |
a3 | - Unknown, set to 0 |
References a3, CLUT_FORMAT, and x.
Set current primitive color.
color | - Which color to use (overriden by vertex-colors) |
References sceGuMaterial(), and x.
Set the color test function.
The color test is only performed while GU_COLOR_TEST is enabled.
Available functions are:
func | - Color test function |
color | - Color to test against |
mask | - Mask ANDed against both source and destination when testing |
References COLOR_REF, COLOR_TEST, COLOR_TESTMASK, and x.
Set which color components that the material will receive.
The components are ORed together from the following values:
components | - Which components to receive |
References a0, and MATERIAL_COLOR.
Referenced by sceGuStart().
void sceGuCopyImage | ( | int | psm, |
int | sx, | ||
int | sy, | ||
int | width, | ||
int | height, | ||
int | srcw, | ||
void * | src, | ||
int | dx, | ||
int | dy, | ||
int | destw, | ||
void * | dest | ||
) |
Image transfer using the GE.
psm | - Pixel format for buffer |
sx | - Source X |
sy | - Source Y |
width | - Image width |
height | - Image height |
srcw | - Source buffer width (block aligned) |
src | - Source pointer |
dx | - Destination X |
dy | - Destination Y |
destw | - Destination buffer width (block aligned) |
dest | - Destination pointer |
References TRANSFER_DST, TRANSFER_DST_OFFSET, TRANSFER_DST_W, TRANSFER_SIZE, TRANSFER_SRC, TRANSFER_SRC_OFFSET, TRANSFER_SRC_W, TRANSFER_START, and x.
Set depth buffer parameters.
zbp | - VRAM pointer where the depthbuffer should start |
zbw | - The width of the depth-buffer (block-aligned) |
References GuDrawBuffer::depth_buffer, GuDrawBuffer::depth_width, gu_draw_buffer, x, Z_BUF_PTR, and Z_BUF_WIDTH.
Select which depth-test function to use.
Valid choices for the depth-test are:
function | - Depth test function to use |
Mask depth buffer writes.
mask | - GU_TRUE(1) to disable Z writes, GU_FALSE(0) to enable |
References Z_MASK.
References GuContext::depth_offset, GuContext::far_plane, gu_contexts, gu_curr_context, GuContext::near_plane, sceGuDepthRange(), and x.
Set which range to use for depth calculations.
Example: Use the entire depth-range for calculations:
near | - Value to use for the near plane |
far | - Value to use for the far plane |
References GuContext::depth_offset, GuContext::far_plane, gu_contexts, gu_curr_context, MAX_Z, MIN_Z, GuContext::near_plane, VIEWPORT_Z_CENTER, VIEWPORT_Z_SCALE, x, and z.
Referenced by sceGuDepthOffset().
Disable GE state.
Look at sceGuEnable() for a list of states
state | - Which state to disable |
References ALPHA_BLEND_ENABLE, ALPHA_TEST_ENABLE, ANTI_ALIAS_ENABLE, COLOR_TEST_ENABLE, CULL_FACE_ENABLE, DEPTH_CLIP_ENABLE, DITHER_ENABLE, FOG_ENABLE, GuContext::fragment_2x, GU_ALPHA_TEST, GU_BLEND, GU_CLIP_PLANES, GU_COLOR_LOGIC_OP, GU_COLOR_TEST, gu_contexts, GU_CULL_FACE, gu_curr_context, GU_DEPTH_TEST, GU_DITHER, gu_draw_buffer, GU_FACE_NORMAL_REVERSE, GU_FOG, GU_FRAGMENT_2X, GU_LIGHT0, GU_LIGHT1, GU_LIGHT2, GU_LIGHT3, GU_LIGHTING, GU_LINE_SMOOTH, GU_PATCH_CULL_FACE, GU_PATCH_FACE, GU_SCISSOR_TEST, gu_states, GU_STENCIL_TEST, GU_TEXTURE_2D, GuDrawBuffer::height, LIGHT_ENABLE0, LIGHT_ENABLE1, LIGHT_ENABLE2, LIGHT_ENABLE3, LIGHTING_ENABLE, LOGIC_OP_ENABLE, NORMAL_REVERSE, PATCH_CULL_ENABLE, PATCH_FACING, SCISSOR1, SCISSOR2, GuContext::scissor_enable, STENCIL_TEST_ENABLE, TEX_FUNC, TEXTURE_ENABLE, GuContext::texture_function, GuDrawBuffer::width, and Z_TEST_ENABLE.
Referenced by sceGuSetAllStatus(), and sceGuSetStatus().
Set display buffer parameters.
width | - Width of the display buffer in pixels |
height | - Width of the display buffer in pixels |
dispbp | - VRAM pointer to where the display-buffer starts |
dispbw | - Display buffer width (block aligned) |
References GuDrawBuffer::disp_buffer, GuDrawBuffer::frame_width, ge_edram_address, gu_display_on, gu_draw_buffer, GuDrawBuffer::height, GuDrawBuffer::pixel_size, PSP_DISPLAY_SETBUF_NEXTFRAME, sceDisplaySetFrameBuf(), sceDisplaySetMode(), GuDrawBuffer::width, and x.
Turn display on or off.
Available states are:
state | - Turn display on or off |
References GuDrawBuffer::disp_buffer, GuDrawBuffer::frame_width, ge_edram_address, gu_display_on, gu_draw_buffer, GuDrawBuffer::pixel_size, PSP_DISPLAY_SETBUF_NEXTFRAME, and sceDisplaySetFrameBuf().
Draw array of vertices forming primitives.
Available primitive-types are:
The vertex-type decides how the vertices align and what kind of information they contain.
The following flags are ORed together to compose the final vertex format:
Data members inside a vertex are laid out in the following order:
If GU_VERTICES(n) is used the entire vertex structure is repeated N-times.
A member is only present if related type flag has been used (look at examples below).
prim | - What kind of primitives to render |
vtype | - Vertex type to process |
count | - How many vertices to process |
indices | - Optional pointer to an index-list |
vertices | - Pointer to a vertex-list |
References BASE, IADDR, PRIM, VADDR, VERTEX_TYPE, and x.
Referenced by sceGuClear().
void sceGuDrawBezier | ( | int | vtype, |
int | ucount, | ||
int | vcount, | ||
const void * | indices, | ||
const void * | vertices | ||
) |
Draw bezier surface.
vtype | - Vertex type, look at sceGuDrawArray() for vertex definition |
ucount | - Number of vertices used in the U direction |
vcount | - Number of vertices used in the V direction |
indices | - Pointer to index buffer |
vertices | - Pointer to vertex buffer |
Set draw buffer parameters (and store in context for buffer-swap)
Available pixel formats are:
psm | - Pixel format to use for rendering (and display) |
fbp | - VRAM pointer to where the draw buffer starts |
fbw | - Frame buffer width (block aligned) |
References GuDrawBuffer::depth_buffer, GuDrawBuffer::depth_width, FRAME_BUF_PTR, FRAME_BUF_WIDTH, GuDrawBuffer::frame_buffer, GuDrawBuffer::frame_width, FRAMEBUF_PIX_FORMAT, gu_draw_buffer, GuDrawBuffer::height, GuDrawBuffer::pixel_size, x, Z_BUF_PTR, and Z_BUF_WIDTH.
Set draw buffer directly, not storing parameters in the context.
psm | - Pixel format to use for rendering |
fbp | - VRAM pointer to where the draw buffer starts |
fbw | - Frame buffer width (block aligned) |
References FRAME_BUF_PTR, FRAME_BUF_WIDTH, FRAMEBUF_PIX_FORMAT, and x.
Enable GE state.
The currently available states are:
state | - Which state to enable |
References ALPHA_BLEND_ENABLE, ALPHA_TEST_ENABLE, ANTI_ALIAS_ENABLE, COLOR_TEST_ENABLE, CULL_FACE_ENABLE, DEPTH_CLIP_ENABLE, DITHER_ENABLE, FOG_ENABLE, GuContext::fragment_2x, GU_ALPHA_TEST, GU_BLEND, GU_CLIP_PLANES, GU_COLOR_LOGIC_OP, GU_COLOR_TEST, gu_contexts, GU_CULL_FACE, gu_curr_context, GU_DEPTH_TEST, GU_DITHER, GU_FACE_NORMAL_REVERSE, GU_FOG, GU_FRAGMENT_2X, GU_LIGHT0, GU_LIGHT1, GU_LIGHT2, GU_LIGHT3, GU_LIGHTING, GU_LINE_SMOOTH, GU_PATCH_CULL_FACE, GU_PATCH_FACE, GU_SCISSOR_TEST, gu_states, GU_STENCIL_TEST, GU_TEXTURE_2D, LIGHT_ENABLE0, LIGHT_ENABLE1, LIGHT_ENABLE2, LIGHT_ENABLE3, LIGHTING_ENABLE, LOGIC_OP_ENABLE, NORMAL_REVERSE, PATCH_CULL_ENABLE, PATCH_FACING, SCISSOR1, SCISSOR2, GuContext::scissor_enable, GuContext::scissor_end, GuContext::scissor_start, STENCIL_TEST_ENABLE, TEX_FUNC, TEXTURE_ENABLE, GuContext::texture_function, and Z_TEST_ENABLE.
Referenced by sceGuSetAllStatus(), and sceGuSetStatus().
End conditional rendering of object.
References BASE, BJUMP, GuDisplayList::current, gu_list, gu_object_stack, and gu_object_stack_depth.
Finish current display list and go back to the parent context.
If the context is GU_DIRECT, the stall-address is updated so that the entire list will execute. Otherwise, only the terminating action is written to the list, depending on context-type.
The finish-callback will get a zero as argument when using this function.
This also restores control back to whatever context that was active prior to this call.
References GuDisplayList::current, END, FINISH, GU_CALL, gu_call_mode, gu_contexts, gu_curr_context, GU_DIRECT, gu_list, GU_SEND, GuContext::list, NOP, GuDisplayList::parent_context, RET, SIGNAL, size, GuDisplayList::start, and x.
Finish current display list and go back to the parent context, sending argument id for the finish callback.
If the context is GU_DIRECT, the stall-address is updated so that the entire list will execute. Otherwise, only the terminating action is written to the list, depending on context-type.
id | - Finish callback id (16-bit) |
References GuDisplayList::current, END, FINISH, GU_CALL, gu_call_mode, gu_contexts, gu_curr_context, GU_DIRECT, gu_list, GU_SEND, GuContext::list, NOP, GuDisplayList::parent_context, RET, SIGNAL, size, GuDisplayList::start, and x.
Query status on all 22 available states.
Look at sceGuEnable() for a list of states
References gu_states.
Allocate memory on the current display list for temporary storage.
size | - How much memory to allocate |
References GuDisplayList::current, ge_list_executed, gu_curr_context, gu_list, sceGeListUpdateStallAddr(), size, and x.
Referenced by sceGuClear().
Get if state is currently enabled or disabled.
Look at sceGuEnable() for a list of states
state | - Which state to query about |
References gu_states.
Initalize the GU system.
This function MUST be called as the first function, otherwise state is undetermined.
References callbackFin(), callbackSig(), PspGeCallbackData::finish_arg, PspGeCallbackData::finish_func, GuSettings::ge_callback_id, ge_edram_address, ge_list_executed, gu_settings, GuSettings::kernel_event_flag, PSP_DISPLAY_SETBUF_IMMEDIATE, resetValues(), sceGeEdramGetAddr(), sceGeListEnQueue(), sceGeListSync(), sceGeSetCallback(), sceKernelCreateEventFlag(), PspGeCallbackData::signal_arg, PspGeCallbackData::signal_func, GuSettings::swapBuffersBehaviour, GuSettings::swapBuffersCallback, and x.
Set light parameters.
Available light types are:
Available light components are:
light | - Light index |
type | - Light type |
components | - Light components |
position | - Light position |
References light_settings, type, x, ScePspFVector3::x, ScePspFVector3::y, and ScePspFVector3::z.
Set light attenuation.
light | - Light index |
atten0 | - Constant attenuation factor |
atten1 | - Linear attenuation factor |
atten2 | - Quadratic attenuation factor |
References light_settings, and x.
Set light color.
Available light components are:
light | - Light index |
component | - Which component to set |
color | - Which color to use |
References GU_AMBIENT, GU_AMBIENT_AND_DIFFUSE, GU_DIFFUSE, GU_DIFFUSE_AND_SPECULAR, GU_SPECULAR, light_settings, and x.
Set light mode.
Available light modes are:
Separate specular colors are used to interpolate the specular component independently, so that it can be added to the fragment after the texture color.
mode | - Light mode to use |
References LIGHT_MODE.
Set spotlight parameters.
light | - Light index |
direction | - Spotlight direction |
exponent | - Spotlight exponent |
cutoff | - Spotlight cutoff angle (in radians) |
References light_settings, and x.
Set color logical operation.
Available operations are:
This operation only has effect if GU_COLOR_LOGIC_OP is enabled.
op | - Operation to execute |
References AMBIENT_ALPHA, AMBIENT_COLOR, MATERIAL_DIFFUSE, MATERIAL_SPECULAR, and x.
Referenced by sceGuColor().
void sceGuModelColor | ( | unsigned int | emissive, |
unsigned int | ambient, | ||
unsigned int | diffuse, | ||
unsigned int | specular | ||
) |
References AMBIENT_COLOR, MATERIAL_DIFFUSE, MATERIAL_EMISSIVE, MATERIAL_SPECULAR, and x.
Specify morph weight entry.
To enable vertex morphing, pass GU_VERTICES(n), where n is between 1-8. This will change the amount of vertices passed in the vertex array, and by setting the morph weights for every vertex entry in the array, you can blend between them.
Please see sceGuDrawArray() for vertex format information.
index | - Morph weight index (0-7) |
weight | - Weight to set |
References x.
Set virtual coordinate offset.
The PSP has a virtual coordinate-space of 4096x4096, this controls where rendering is performed
x | - Offset (0-4095) |
y | - Offset (0-4095) |
Set dividing for patches (beziers and splines)
ulevel | - Number of division on u direction |
vlevel | - Number of division on v direction |
References a0, a1, and PATCH_DIVISION.
Referenced by sceGuStart().
References a0, and PATCH_FACING.
Set primitive for patches (beziers and splines)
prim | - Desired primitive type (GU_POINTS | GU_LINE_STRIP | GU_TRIANGLE_STRIP) |
References GU_LINE_STRIP, GU_POINTS, GU_TRIANGLE_STRIP, PATCH_PRIMITIVE, and x.
Set mask for which bits of the pixels to write.
mask | - Which bits to filter against writes |
References MASK_ALPHA, and MASK_COLOR.
Set what to scissor within the current viewport.
Note that scissoring is only performed if the custom scissoring is enabled (GU_SCISSOR_TEST)
x | - Left of scissor region |
y | - Top of scissor region |
w | - Width of scissor region |
h | - Height of scissor region |
References gu_contexts, gu_curr_context, SCISSOR1, SCISSOR2, GuContext::scissor_enable, GuContext::scissor_end, GuContext::scissor_start, w, x, and y.
Send raw float-command to the GE.
The argument is converted into a 24-bit float before transfer.
cmd | - Which command to send |
argument | - Argument to pass along |
References x.
Send raw command to the GE.
Only the 24 lower bits of the argument is passed along.
cmd | - Which command to send |
argument | - Argument to pass along |
References x.
int sceGuSendList | ( | int | mode, |
const void * | list, | ||
PspGeContext * | context | ||
) |
Send a list to the GE directly.
Available modes are:
mode | - Whether to place the list first or last in queue |
list | - List to send |
context | - Temporary storage for the GE context |
References PspGeListArgs::context, GuSettings::ge_callback_id, ge_list_executed, GU_HEAD, gu_settings, GU_TAIL, NULL, sceGeListEnQueue(), sceGeListEnQueueHead(), GuSettings::signal_offset, PspGeListArgs::size, and x.
Set the status on all 22 available states.
Look at sceGuEnable() for a list of states
status | - Bit-mask (0-21) containing the status of all 22 states |
References i, sceGuDisable(), and sceGuEnable().
Setup signal handler.
Available signals are:
signal | - Signal index to install a handler for |
callback | - Callback to call when signal index is triggered |
References GuSettings::fin, GU_CALLBACK_FINISH, GU_CALLBACK_SIGNAL, gu_settings, GuSettings::sig, and x.
void sceGuSetDither | ( | const ScePspIMatrix4 * | matrix | ) |
void sceGuSetMatrix | ( | int | type, |
const ScePspFMatrix4 * | matrix | ||
) |
Set transform matrices.
Available matrices are:
type | - Which matrix-type to set |
matrix | - Matrix to load |
References i, PROJ_MATRIX_DATA, PROJ_MATRIX_NUMBER, TGEN_MATRIX_DATA, TGEN_MATRIX_NUMBER, type, VIEW_MATRIX_DATA, VIEW_MATRIX_NUMBER, WORLD_MATRIX_DATA, WORLD_MATRIX_NUMBER, and x.
Enable or disable GE state.
Look at sceGuEnable() for a list of states
state | - Which state to change |
status | - Wether to enable or disable the state |
References sceGuDisable(), and sceGuEnable().
Set how primitives are shaded.
The available shading-methods are:
mode | - Which mode to use |
References SHADE_MODE.
Trigger signal to call code from the command stream.
Available behaviors are:
signal | - Signal to trigger |
behavior | - Behavior type |
Set the specular power for the material.
power | - Specular power |
References MATERIAL_SPECULAR_COEF, and x.
Referenced by sceGuStart().
Start filling a new display-context.
Contexts available are:
The previous context-type is stored so that it can be restored at sceGuFinish().
cid | - Context Type |
list | - Pointer to display-list (16 byte aligned) |
References GuDisplayList::current, FRAME_BUF_PTR, FRAME_BUF_WIDTH, GuDrawBuffer::frame_buffer, GuDrawBuffer::frame_width, GuSettings::ge_callback_id, ge_list_executed, GU_AMBIENT, gu_contexts, gu_curr_context, GU_DIFFUSE, gu_draw_buffer, gu_init, gu_list, gu_settings, GU_SPECULAR, GuContext::list, GuDisplayList::parent_context, sceGeListEnQueue(), sceGuColorMaterial(), sceGuPatchDivide(), sceGuSetDither(), sceGuSpecular(), sceGuTexScale(), GuSettings::signal_offset, GuDisplayList::start, and x.
Set stencil function and reference value for stencil testing.
Available functions are:
func | - Test function |
ref | - The reference value for the stencil test |
mask | - Mask that is ANDed with both the reference value and stored stencil value when the test is done |
References STENCIL_TEST, and x.
Set the stencil test actions.
Available actions are:
As stencil buffer shares memory with framebuffer alpha, resolution of the buffer is directly in relation.
fail | - The action to take when the stencil test fails |
zfail | - The action to take when stencil test passes, but the depth test fails |
zpass | - The action to take when both stencil test and depth test passes |
References STENCIL_OP, and x.
Swap display and draw buffer.
References GuDrawBuffer::disp_buffer, GuDrawBuffer::frame_buffer, GuDrawBuffer::frame_width, ge_edram_address, gu_current_frame, gu_display_on, gu_draw_buffer, gu_settings, GuDrawBuffer::pixel_size, sceDisplaySetFrameBuf(), GuSettings::swapBuffersBehaviour, GuSettings::swapBuffersCallback, and x.
Wait until display list has finished executing.
Available what are:
Available mode are:
mode | - What to wait for |
what | - What to sync to |
References ge_list_executed, sceGeDrawSync(), sceGeListSync(), and x.
Shutdown the GU system.
Called when GU is no longer needed
References GuSettings::ge_callback_id, gu_settings, GuSettings::kernel_event_flag, sceGeUnsetCallback(), and sceKernelDeleteEventFlag().
Specify the texture environment color.
This is used in the texture function when a constant color is needed.
See sceGuTexFunc() for more information.
color | - Constant color (0x00BBGGRR) |
References TEX_ENV_COLOR, and x.
Set how the texture is filtered.
Available filters are:
min | - Minimizing filter |
mag | - Magnifying filter |
References TEX_FILTER, and x.
Flush texture page-cache.
Do this if you have copied/rendered into an area currently in the texture-cache
References TEX_FLUSH.
Referenced by sceGuTexImage(), and sceGuTexMode().
Set how textures are applied.
Key for the apply-modes:
Available apply-modes are: (TFX)
The fields TCC_RGB and TCC_RGBA specify components that differ between the two different component modes.
Available component-modes are: (TCC)
tfx | - Which apply-mode to use |
tcc | - Which component-mode to use |
References GuContext::fragment_2x, gu_contexts, gu_curr_context, TEX_FUNC, GuContext::texture_function, and x.
Set current texturemap.
Textures may reside in main RAM, but it has a huge speed-penalty. Swizzle textures to get maximum speed.
mipmap | - Mipmap level |
width | - Width of texture (must be a power of 2) |
height | - Height of texture (must be a power of 2) |
tbw | - Texture Buffer Width (block-aligned) |
tbp | - Texture buffer pointer (16 byte aligned) |
References sceGuTexFlush(), TEX_ADDR0, TEX_BUF_WIDTH0, TEX_SIZE0, and x.
Set the texture-mapping mode.
Available modes are:
mode | - Which mode to use |
a1 | - Unknown |
a2 | - Unknown |
References a1, a2, gu_contexts, gu_curr_context, TEX_MAP_MODE, TEX_SHADE_MAPPING, GuContext::texture_map_mode, and GuContext::texture_proj_map_mode.
Set texture-mode parameters.
Available texture-formats are:
tpsm | - Which texture format to use |
maxmips | - Number of mipmaps to use (0-8) |
a2 | - Unknown, set to 0 |
swizzle | - GU_TRUE(1) to swizzle texture-reads |
References a2, gu_contexts, gu_curr_context, sceGuTexFlush(), TEX_FORMAT, TEX_MODE, GuContext::texture_mode, and x.
Set texture offset.
u | - Offset to add to the U coordinate |
v | - Offset to add to the V coordinate |
References TEX_OFFSET_U, TEX_OFFSET_V, and x.
Set texture projection-map mode.
Available modes are:
mode | - Which mode to use |
References gu_contexts, gu_curr_context, TEX_MAP_MODE, GuContext::texture_map_mode, and GuContext::texture_proj_map_mode.
Set texture scale.
u | - Scalar to multiply U coordinate with |
v | - Scalar to multiply V coordinate with |
References TEX_SCALE_U, TEX_SCALE_V, and x.
Referenced by sceGuStart().
References TEX_LOD_SLOPE, and x.
void sceGuTexSync | ( | ) |
Synchronize rendering pipeline with image upload.
This will stall the rendering pipeline until the current image upload initiated by sceGuCopyImage() has completed.
References TEX_SYNC.
Set current viewport.
cx | - Center for horizontal viewport |
cy | - Center for vertical viewport |
width | - Width of viewport |
height | - Height of viewport |
References VIEWPORT_X_CENTER, VIEWPORT_X_SCALE, VIEWPORT_Y_CENTER, VIEWPORT_Y_SCALE, and x.