PSPSDK 2024-10-31
Loading...
Searching...
No Matches
pspge.h File Reference
#include <psptypes.h>
Include dependency graph for pspge.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PspGeContext
 Stores the state of the GE. More...
 
struct  SceGeStack
 Structure storing a stack (for CALL/RET) More...
 
struct  PspGeCallbackData
 Structure to hold the callback data. More...
 
struct  PspGeListArgs
 
struct  PspGeBreakParam
 Drawing queue interruption parameter. More...
 
struct  PspGeStack
 Structure storing a stack (for CALL/RET). More...
 

Typedefs

typedef struct PspGeContext PspGeContext
 Stores the state of the GE.
 
typedef void(* PspGeCallback) (int id, void *arg)
 Typedef for a GE callback.
 
typedef struct PspGeCallbackData PspGeCallbackData
 Structure to hold the callback data.
 
typedef struct PspGeListArgs PspGeListArgs
 
typedef struct PspGeBreakParam PspGeBreakParam
 Drawing queue interruption parameter.
 
typedef enum PspGeMatrixTypes PspGeMatrixTypes
 GE matrix types.
 
typedef enum PspGeListState PspGeListState
 List status for sceGeListSync() and sceGeDrawSync().
 

Enumerations

enum  PspGeMatrixTypes {
  PSP_GE_MATRIX_BONE0 = 0 , PSP_GE_MATRIX_BONE1 , PSP_GE_MATRIX_BONE2 , PSP_GE_MATRIX_BONE3 ,
  PSP_GE_MATRIX_BONE4 , PSP_GE_MATRIX_BONE5 , PSP_GE_MATRIX_BONE6 , PSP_GE_MATRIX_BONE7 ,
  PSP_GE_MATRIX_WORLD , PSP_GE_MATRIX_VIEW , PSP_GE_MATRIX_PROJECTION , PSP_GE_MATRIX_TEXGEN
}
 GE matrix types. More...
 
enum  PspGeListState {
  PSP_GE_LIST_DONE = 0 , PSP_GE_LIST_QUEUED , PSP_GE_LIST_DRAWING_DONE , PSP_GE_LIST_STALL_REACHED ,
  PSP_GE_LIST_CANCEL_DONE
}
 List status for sceGeListSync() and sceGeDrawSync(). More...
 

Functions

unsigned int sceGeEdramGetSize (void)
 Get the size of VRAM.
 
int sceGeEdramSetSize (int size)
 Sets the EDRAM size to be enabled.
 
voidsceGeEdramGetAddr (void)
 Get the eDRAM address.
 
unsigned int sceGeGetCmd (int cmd)
 Retrieve the current value of a GE command.
 
int sceGeGetMtx (int type, void *matrix)
 Retrieve a matrix of the given type.
 
int sceGeGetStack (int stackId, PspGeStack *stack)
 Retrieve the stack of the display list currently being executed.
 
int sceGeSaveContext (PspGeContext *context)
 Save the GE's current state.
 
int sceGeRestoreContext (const PspGeContext *context)
 Restore a previously saved GE context.
 
int sceGeListEnQueue (const void *list, void *stall, int cbid, PspGeListArgs *arg)
 Enqueue a display list at the tail of the GE display list queue.
 
int sceGeListEnQueueHead (const void *list, void *stall, int cbid, PspGeListArgs *arg)
 Enqueue a display list at the head of the GE display list queue.
 
int sceGeListDeQueue (int qid)
 Cancel a queued or running list.
 
int sceGeListUpdateStallAddr (int qid, void *stall)
 Update the stall address for the specified queue.
 
int sceGeListSync (int qid, int syncType)
 Wait for syncronisation of a list.
 
int sceGeDrawSync (int syncType)
 Wait for drawing to complete.
 
int sceGeSetCallback (PspGeCallbackData *cb)
 Register callback handlers for the the GE.
 
int sceGeUnsetCallback (int cbid)
 Unregister the callback handlers.
 
int sceGeBreak (int mode, PspGeBreakParam *pParam)
 Interrupt drawing queue.
 
int sceGeContinue (void)
 Restart drawing queue.
 
int sceGeEdramSetAddrTranslation (int width)
 Set the eDRAM address translation mode.
 

Typedef Documentation

◆ PspGeBreakParam

Drawing queue interruption parameter.

◆ PspGeCallback

typedef void(* PspGeCallback) (int id, void *arg)

Typedef for a GE callback.

◆ PspGeCallbackData

Structure to hold the callback data.

◆ PspGeContext

Stores the state of the GE.

◆ PspGeListArgs

◆ PspGeListState

◆ PspGeMatrixTypes

Enumeration Type Documentation

◆ PspGeListState

List status for sceGeListSync() and sceGeDrawSync().

Enumerator
PSP_GE_LIST_DONE 
PSP_GE_LIST_QUEUED 
PSP_GE_LIST_DRAWING_DONE 
PSP_GE_LIST_STALL_REACHED 
PSP_GE_LIST_CANCEL_DONE 

◆ PspGeMatrixTypes

GE matrix types.

Enumerator
PSP_GE_MATRIX_BONE0 

Bone matrices.

PSP_GE_MATRIX_BONE1 
PSP_GE_MATRIX_BONE2 
PSP_GE_MATRIX_BONE3 
PSP_GE_MATRIX_BONE4 
PSP_GE_MATRIX_BONE5 
PSP_GE_MATRIX_BONE6 
PSP_GE_MATRIX_BONE7 
PSP_GE_MATRIX_WORLD 

World matrix.

PSP_GE_MATRIX_VIEW 

View matrix.

PSP_GE_MATRIX_PROJECTION 

Projection matrix.

PSP_GE_MATRIX_TEXGEN 

Function Documentation

◆ sceGeBreak()

int sceGeBreak ( int  mode,
PspGeBreakParam pParam 
)

Interrupt drawing queue.

Parameters
mode- If set to 1, reset all the queues.
pParam- Unused (just K1-checked).
Returns
The stopped queue ID if mode isn't set to 0, otherwise 0, and < 0 on error.

◆ sceGeContinue()

int sceGeContinue ( void  )

Restart drawing queue.

Returns
< 0 on error.

◆ sceGeDrawSync()

int sceGeDrawSync ( int  syncType)

Wait for drawing to complete.

Parameters
syncType- 0 if you want to wait for the drawing to be completed, or 1 if you just want to peek the state of the display list currently being executed.
Returns
The current queue status, one of PspGeListState.

Referenced by sceGuSync().

◆ sceGeEdramGetAddr()

void * sceGeEdramGetAddr ( void  )

Get the eDRAM address.

Returns
A pointer to the base of the eDRAM.

Referenced by guGetStaticVramTexture(), and sceGuInit().

◆ sceGeEdramGetSize()

unsigned int sceGeEdramGetSize ( void  )

Get the size of VRAM.

Returns
The size of VRAM (in bytes).

◆ sceGeEdramSetAddrTranslation()

int sceGeEdramSetAddrTranslation ( int  width)

Set the eDRAM address translation mode.

Parameters
width- 0 to not set the translation width, otherwise 512, 1024, 2048 or 4096.
Returns
The previous width if it was set, otherwise 0, < 0 on error.

◆ sceGeEdramSetSize()

int sceGeEdramSetSize ( int  size)

Sets the EDRAM size to be enabled.

Parameters
size-size The size (0x200000 or 0x400000). Will return an error if 0x400000 is specified for the PSP FAT.
Returns
Zero on success, otherwise less than zero.

◆ sceGeGetCmd()

unsigned int sceGeGetCmd ( int  cmd)

Retrieve the current value of a GE command.

Parameters
cmd- The GE command register to retrieve (0 to 0xFF, both included).
Returns
The value of the GE command, < 0 on error.

◆ sceGeGetMtx()

int sceGeGetMtx ( int  type,
void matrix 
)

Retrieve a matrix of the given type.

Parameters
type- One of PspGeMatrixTypes.
matrix- Pointer to a variable to store the matrix.
Returns
< 0 on error.

◆ sceGeGetStack()

int sceGeGetStack ( int  stackId,
PspGeStack stack 
)

Retrieve the stack of the display list currently being executed.

Parameters
stackId- The ID of the stack to retrieve.
stack- Pointer to a structure to store the stack, or NULL to not store it.
Returns
The number of stacks of the current display list, < 0 on error.

◆ sceGeListDeQueue()

int sceGeListDeQueue ( int  qid)

Cancel a queued or running list.

Parameters
qid- The ID of the queue.
Returns
< 0 on error.

◆ sceGeListEnQueue()

int sceGeListEnQueue ( const void list,
void stall,
int  cbid,
PspGeListArgs arg 
)

Enqueue a display list at the tail of the GE display list queue.

Parameters
list- The head of the list to queue.
stall- The stall address. If NULL then no stall address is set and the list is transferred immediately.
cbid- ID of the callback set by calling sceGeSetCallback
arg- Structure containing GE context buffer address
Returns
The ID of the queue, < 0 on error.

Referenced by sceGuInit(), sceGuSendList(), and sceGuStart().

◆ sceGeListEnQueueHead()

int sceGeListEnQueueHead ( const void list,
void stall,
int  cbid,
PspGeListArgs arg 
)

Enqueue a display list at the head of the GE display list queue.

Parameters
list- The head of the list to queue.
stall- The stall address. If NULL then no stall address is set and the list is transferred immediately.
cbid- ID of the callback set by calling sceGeSetCallback
arg- Structure containing GE context buffer address
Returns
The ID of the queue, < 0 on error.

Referenced by sceGuSendList().

◆ sceGeListSync()

int sceGeListSync ( int  qid,
int  syncType 
)

Wait for syncronisation of a list.

Parameters
qid- The queue ID of the list to sync.
syncType- 0 if you want to wait for the list to be completed, or 1 if you just want to peek the actual state.
Returns
The specified queue status, one of PspGeListState.

Referenced by sceGuInit(), and sceGuSync().

◆ sceGeListUpdateStallAddr()

int sceGeListUpdateStallAddr ( int  qid,
void stall 
)

Update the stall address for the specified queue.

Parameters
qid- The ID of the queue.
stall- The new stall address.
Returns
< 0 on error

Referenced by sceGuGetMemory().

◆ sceGeRestoreContext()

int sceGeRestoreContext ( const PspGeContext context)

Restore a previously saved GE context.

Parameters
context- Pointer to a PspGeContext.
Returns
< 0 on error.

◆ sceGeSaveContext()

int sceGeSaveContext ( PspGeContext context)

Save the GE's current state.

Parameters
context- Pointer to a PspGeContext.
Returns
< 0 on error.

◆ sceGeSetCallback()

int sceGeSetCallback ( PspGeCallbackData cb)

Register callback handlers for the the GE.

Parameters
cb- Configured callback data structure.
Returns
The callback ID, < 0 on error.

Referenced by sceGuInit().

◆ sceGeUnsetCallback()

int sceGeUnsetCallback ( int  cbid)

Unregister the callback handlers.

Parameters
cbid- The ID of the callbacks, returned by sceGeSetCallback().
Returns
< 0 on error

Referenced by sceGuTerm().