PSPSDK 1.0+beta2
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. More...
 
typedef void(* PspGeCallback) (int id, void *arg)
 Typedef for a GE callback. More...
 
typedef struct PspGeCallbackData PspGeCallbackData
 Structure to hold the callback data. More...
 
typedef struct PspGeListArgs PspGeListArgs
 
typedef struct PspGeBreakParam PspGeBreakParam
 Drawing queue interruption parameter. More...
 
typedef enum PspGeMatrixTypes PspGeMatrixTypes
 GE matrix types. More...
 
typedef enum PspGeListState PspGeListState
 List status for sceGeListSync() and sceGeDrawSync(). More...
 

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

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

typedef struct PspGeContext PspGeContext

Stores the state of the GE.

◆ PspGeListArgs

typedef struct PspGeListArgs PspGeListArgs

◆ PspGeListState

List status for sceGeListSync() and sceGeDrawSync().

◆ PspGeMatrixTypes

GE matrix types.

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 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(), and sendCommandiStall().

◆ 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().