uOFW
Reverse engineered PSP kernel 6.60.
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
sceGE_Manager Module

Data Structures

struct  SceGeDisplayList
 
struct  _SceGeContext
 
struct  SceGeBreakpoint
 
struct  SceGeStack
 
struct  SceGeContext
 
struct  SceGeCallbackData
 
struct  SceGeListArgs
 

Macros

#define SCE_GE_SIGNAL_HANDLER_SUSPEND   0x01
 
#define SCE_GE_SIGNAL_HANDLER_CONTINUE   0x02
 
#define SCE_GE_SIGNAL_HANDLER_PAUSE   0x03
 
#define SCE_GE_SIGNAL_SYNC   0x08
 
#define SCE_GE_SIGNAL_JUMP   0x10
 
#define SCE_GE_SIGNAL_CALL   0x11
 
#define SCE_GE_SIGNAL_RET   0x12
 
#define SCE_GE_SIGNAL_RJUMP   0x13
 
#define SCE_GE_SIGNAL_RCALL   0x14
 
#define SCE_GE_SIGNAL_OJUMP   0x15
 
#define SCE_GE_SIGNAL_OCALL   0x16
 
#define SCE_GE_SIGNAL_RTBP0   0x20
 
#define SCE_GE_SIGNAL_OTBP0   0x28
 
#define SCE_GE_SIGNAL_RCBP   0x30
 
#define SCE_GE_SIGNAL_OCBP   0x38
 
#define SCE_GE_SIGNAL_BREAK1   0xF0
 
#define SCE_GE_SIGNAL_BREAK2   0xFF
 

Typedefs

typedef struct SceGeDisplayList SceGeDisplayList
 
typedef enum SceGeReg SceGeReg
 
typedef enum SceGeLogType SceGeLogType
 
typedef void(* SceGeLogHandler) (SceGeLogType logType,...)
 
typedef struct SceGeBreakpoint SceGeBreakpoint
 
typedef void(* SceGeCallback) (int id, void *arg)
 

Enumerations

enum  SceGeDisplayListState {
  SCE_GE_DL_STATE_NONE = 0 , SCE_GE_DL_STATE_QUEUED , SCE_GE_DL_STATE_RUNNING , SCE_GE_DL_STATE_COMPLETED ,
  SCE_GE_DL_STATE_PAUSED
}
 
enum  SceGeDisplayListSignal { SCE_GE_DL_SIGNAL_NONE = 0 , SCE_GE_DL_SIGNAL_BREAK , SCE_GE_DL_SIGNAL_PAUSE , SCE_GE_DL_SIGNAL_SYNC }
 
enum  SceGeReg
 
enum  SceGeLogType {
  SCE_GE_LOG_DL_ENQUEUED = 0 , SCE_GE_LOG_DL_DEQUEUED = 1 , SCE_GE_LOG_DL_SADR_UPDATE = 2 , SCE_GE_LOG_DL_BREAK = 3 ,
  SCE_GE_LOG_DL_CONTINUE = 4 , SCE_GE_LOG_DL_RUNNING = 5 , SCE_GE_LOG_DL_END = 6 , SCE_GE_LOG_DL_SIGNAL = 7
}
 
enum  SceGeListState {
  SCE_GE_LIST_COMPLETED , SCE_GE_LIST_QUEUED , SCE_GE_LIST_DRAWING , SCE_GE_LIST_STALLING ,
  SCE_GE_LIST_PAUSED
}
 

Functions

int sceGeInit ()
 
int sceGeEnd ()
 
int sceGeGetReg (SceGeReg regId)
 
int sceGeSetReg (SceGeReg regId, u32 value)
 
int sceGeSetCmd (u32 cmdOff, u32 cmd)
 
int sceGeSetMtx (int id, int *mtx)
 
int sceGeRegisterLogHandler (SceGeLogHandler handler)
 
int sceGeSetGeometryClock (int opt)
 
int sceGeEdramInit ()
 
int sceGeEdramSetRefreshParam (int arg0, int arg1, int arg2, int arg3)
 
int sceGeEdramSetSize (int size)
 
int sceGeEdramGetHwSize ()
 
int sceGePutBreakpoint (SceGeBreakpoint *bp, int size)
 
int sceGeGetBreakpoint (SceGeBreakpoint *bp, int size, int *arg2)
 
int sceGeGetListIdList (int *outPtr, int size, int *totalCountPtr)
 
int sceGeGetList (int dlId, SceGeDisplayList *outDl, int *outFlag)
 
int sceGeListUpdateStallAddr (int dlId, void *stall)
 
int sceGeGetCmd (u32 cmdOff)
 
int sceGeGetMtx (int id, int *mtx)
 
int sceGeSaveContext (SceGeContext *ctx)
 
int sceGeRestoreContext (SceGeContext *ctx)
 
int sceGeEdramGetAddr ()
 
int sceGeEdramSetAddrTranslation (int arg)
 
int sceGeEdramGetSize ()
 
int sceGeListDeQueue (int dlId)
 
SceGeListState sceGeListSync (int dlId, int mode)
 
SceGeListState sceGeDrawSync (int syncType)
 
int sceGeBreak (u32 resetQueue, void *arg1)
 
int sceGeContinue ()
 
int sceGeSetCallback (SceGeCallbackData *cb)
 
int sceGeGetStack (int stackId, SceGeStack *stack)
 
int sceGeListEnQueue (void *list, void *stall, int cbid, SceGeListArgs *arg)
 
int sceGeListEnQueueHead (void *list, void *stall, int cbid, SceGeListArgs *arg)
 
int sceGeUnsetCallback (int cbId)
 

Detailed Description

Author
artart78
Version
6.60

The ge.prx module RE'ing.

Macro Definition Documentation

◆ SCE_GE_SIGNAL_HANDLER_SUSPEND

#define SCE_GE_SIGNAL_HANDLER_SUSPEND   0x01

In SDK versions <= 0x02000010, pause the display list, call the callback with the SIGNAL argument, and restart the display list in the state specified in the END instruction. Otherwise, just call the callback. Resume GE execution afterwards.

◆ SCE_GE_SIGNAL_HANDLER_CONTINUE

#define SCE_GE_SIGNAL_HANDLER_CONTINUE   0x02

Resume GE execution, then call the signal callback with the SIGNAL argument.

◆ SCE_GE_SIGNAL_HANDLER_PAUSE

#define SCE_GE_SIGNAL_HANDLER_PAUSE   0x03

Set the current display list's status to PAUSE, its signal to the END argument and its signal data to the SIGNAL command, then resume GE execution.

◆ SCE_GE_SIGNAL_SYNC

#define SCE_GE_SIGNAL_SYNC   0x08

Set the current display list's signal to SYNC, then resume GE execution.

◆ SCE_GE_SIGNAL_JUMP

#define SCE_GE_SIGNAL_JUMP   0x10

Jump to the (s << 16) | (e & 0xFFFF) address, where s is SIGNAL's argument and e is END's

◆ SCE_GE_SIGNAL_CALL

#define SCE_GE_SIGNAL_CALL   0x11

Same as SCE_GE_SIGNAL_JUMP, but saving the status so we can use SCE_GE_SIGNAL_RET to return to the caller.

◆ SCE_GE_SIGNAL_RET

#define SCE_GE_SIGNAL_RET   0x12

Return after using a SCE_GE_SIGNAL_*CALL signal.

◆ SCE_GE_SIGNAL_RJUMP

#define SCE_GE_SIGNAL_RJUMP   0x13

Same as SCE_GE_SIGNAL_JUMP, but where the address is relative to the current one.

◆ SCE_GE_SIGNAL_RCALL

#define SCE_GE_SIGNAL_RCALL   0x14

Same as SCE_GE_SIGNAL_CALL, but where the address is relative to the current one.

◆ SCE_GE_SIGNAL_OJUMP

#define SCE_GE_SIGNAL_OJUMP   0x15

Same as SCE_GE_SIGNAL_JUMP, but where the address is relative to ORIGIN.

◆ SCE_GE_SIGNAL_OCALL

#define SCE_GE_SIGNAL_OCALL   0x16

Same as SCE_GE_SIGNAL_CALL, but where the address is relative to ORIGIN.

◆ SCE_GE_SIGNAL_RTBP0

#define SCE_GE_SIGNAL_RTBP0   0x20

Run a TBP0/TBW0 pair with the same address as for SCE_GE_SIGNAL_RJUMP, taking ((e >> 16) & 0xFF) for the size.

◆ SCE_GE_SIGNAL_OTBP0

#define SCE_GE_SIGNAL_OTBP0   0x28

Run a TBP0/TBW0 pair with the same address as for SCE_GE_SIGNAL_OJUMP, taking ((e >> 16) & 0xFF) for the size.

◆ SCE_GE_SIGNAL_RCBP

#define SCE_GE_SIGNAL_RCBP   0x30

Same as SCE_GE_SIGNAL_RTBP0, for a CBP/CBW pair.

◆ SCE_GE_SIGNAL_OCBP

#define SCE_GE_SIGNAL_OCBP   0x38

Same as SCE_GE_SIGNAL_OTBP0, for a CBP/CBW pair.

◆ SCE_GE_SIGNAL_BREAK1

#define SCE_GE_SIGNAL_BREAK1   0xF0

If deci2p operations are defined, break here and run the SCE_DECI2OP_GE_BREAK operation until it resumes operation.

◆ SCE_GE_SIGNAL_BREAK2

#define SCE_GE_SIGNAL_BREAK2   0xFF

Same as SCE_GE_SIGNAL_BREAK1, but break only if the breakpoint counter is -1 or equal to the defined value (ie, we reached the breakpoint the number of times specified when the breakpoint was created).

Typedef Documentation

◆ SceGeDisplayList

Structure holding a display list

◆ SceGeReg

typedef enum SceGeReg SceGeReg

Identifiers for the GE hardware (DMA) registers which can be read and written by sceGeGetReg() and sceGeSetReg(). See the hardware documentation for more details.

◆ SceGeLogType

typedef enum SceGeLogType SceGeLogType

The value of the first argument passed to the log handler registered by sceGeRegisterLogHandler(). The following arguments passed to the log handler depend on this.

◆ SceGeLogHandler

typedef void(* SceGeLogHandler) (SceGeLogType logType,...)

A GE logging handler function. Takes a variable number of arguments depending on the logging type.

◆ SceGeBreakpoint

A GE breakpoint.

◆ SceGeCallback

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

Typedef for a GE callback

Enumeration Type Documentation

◆ SceGeDisplayListState

Internal state of a display list

Enumerator
SCE_GE_DL_STATE_NONE 

No state assigned, the list is empty

SCE_GE_DL_STATE_QUEUED 

The list has been queued

SCE_GE_DL_STATE_RUNNING 

The list is being executed

SCE_GE_DL_STATE_COMPLETED 

The list was completed and will be removed

SCE_GE_DL_STATE_PAUSED 

The list has been paused by a signal

◆ SceGeDisplayListSignal

Internal signal state of a display list

Enumerator
SCE_GE_DL_SIGNAL_NONE 

No signal received

SCE_GE_DL_SIGNAL_BREAK 

The break signal was received

SCE_GE_DL_SIGNAL_PAUSE 

The pause signal was received

SCE_GE_DL_SIGNAL_SYNC 

The sync signal was received

◆ SceGeReg

enum SceGeReg

Identifiers for the GE hardware (DMA) registers which can be read and written by sceGeGetReg() and sceGeSetReg(). See the hardware documentation for more details.

◆ SceGeLogType

The value of the first argument passed to the log handler registered by sceGeRegisterLogHandler(). The following arguments passed to the log handler depend on this.

Enumerator
SCE_GE_LOG_DL_ENQUEUED 

Display list was enqueued. Four arguments: display list ID, was enqueued as head, pointer to the command list, pointer to the stall address.

SCE_GE_LOG_DL_DEQUEUED 

Display list was dequeued. One argument: the display list ID.

SCE_GE_LOG_DL_SADR_UPDATE 

Display list's stall address was updated. Two arguments: the display list ID, and the new stall address.

SCE_GE_LOG_DL_BREAK 

sceGeBreak() was triggered. One argument: whether the flag to reset the display list queue was set.

SCE_GE_LOG_DL_CONTINUE 

sceGeContinue() was triggered. One argument, always zero.

SCE_GE_LOG_DL_RUNNING 

Display list is now running (when enqueued, when another display list finished, or when doing a sceGeContinue()). Three arguments: the display list ID, the pointer to its command list, the pointer to its stall address.

SCE_GE_LOG_DL_END 

Display list reached the ending FINISH/END sequence. Four arguments: display list ID, current pointer to the command list, and the two commands before it (in their running order).

SCE_GE_LOG_DL_SIGNAL 

Display list caught a signal. Four arguments: display list ID, current pointer to the command list, and the two commands before it (in their running order).

◆ SceGeListState

State of a display list, returned by sceGeListSync() and sceGeDrawSync()

Enumerator
SCE_GE_LIST_COMPLETED 

The list has been completed

SCE_GE_LIST_QUEUED 

The list is queued but not executed yet

SCE_GE_LIST_DRAWING 

The list is currently being executed

SCE_GE_LIST_STALLING 

The list was stopped because it encountered stall address

SCE_GE_LIST_PAUSED 

The list is paused because of a signal

Function Documentation

◆ sceGeInit()

int sceGeInit ( )

Inits the GE subsystem.

Returns
Zero.

◆ sceGeEnd()

int sceGeEnd ( )

Ends the GE subsystem.

Returns
Zero.

◆ sceGeGetReg()

int sceGeGetReg ( SceGeReg  regId)

Gets the value of a GE hardware register.

Parameters
regIdThe register ID.
Returns
The content of the register on success, otherwise less than zero.

◆ sceGeSetReg()

int sceGeSetReg ( SceGeReg  regId,
u32  value 
)

Sets a GE hardware register.

Parameters
regIdThe register ID.
valueThe value to set the register to.
Returns
Zero on success, otherwise less than zero.

◆ sceGeSetCmd()

int sceGeSetCmd ( u32  cmdOff,
u32  cmd 
)

Sets the value of a command register, as if the command was executed.

Parameters
cmdOffThe command ID.
cmdThe value to set the command to. (Only the least significant 24 bits are used.)
Returns
Zero on success, otherwise less than zero.

◆ sceGeSetMtx()

int sceGeSetMtx ( int  id,
int *  mtx 
)

Sets a matrix.

Parameters
idThe matrix ID, one of SCE_GE_MTX_*.
mtxThe buffer storing the matrix.
Returns
Zero on success, otherwise less than zero.

◆ sceGeRegisterLogHandler()

int sceGeRegisterLogHandler ( SceGeLogHandler  handler)

Registers a logging handler.

Parameters
handlerThe handler function.
Returns
Zero.

◆ sceGeSetGeometryClock()

int sceGeSetGeometryClock ( int  opt)

Sets or unsets the geometry clock.

Parameters
optThe value whose first bit enables or disables the geometry clock.
Returns
The old state.

◆ sceGeEdramInit()

int sceGeEdramInit ( )

Inits the EDRAM memory.

Returns
Zero.

◆ sceGeEdramSetRefreshParam()

int sceGeEdramSetRefreshParam ( int  arg0,
int  arg1,
int  arg2,
int  arg3 
)

Sets the EDRAM refresh parameters.

Parameters
arg0Unknown (0 or 1).
arg1Unknown (0 to 0x7FFFFF).
arg2Unknown (0 to 0x3FF).
arg3Unknown (0 to 0xF).
Returns
Zero on success, otherwise less than zero.

◆ sceGeEdramSetSize()

int sceGeEdramSetSize ( int  size)

Sets the EDRAM size to be enabled.

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

◆ sceGeEdramGetHwSize()

int sceGeEdramGetHwSize ( )

Gets the EDRAM physical size.

Returns
The EDRAM physical size.

◆ sceGePutBreakpoint()

int sceGePutBreakpoint ( SceGeBreakpoint bp,
int  size 
)

Put breakpoints in the display list execution.

Parameters
inPtrA list of breakpoints to set.
sizeThe number of breakpoints to set.
Returns
Zero on success, otherwise less than zero.

◆ sceGeGetBreakpoint()

int sceGeGetBreakpoint ( SceGeBreakpoint bp,
int  size,
int *  arg2 
)

Gets a breakpoint.

Parameters
outPtrThe list of breakpoints (check sceGePutBreakpoint()).
sizeThe number of breakpoints to read.
arg2A pointer where will be stored the total number of breakpoints.
Returns
The number of stored breakpoints on success, otherwise less than zero.

◆ sceGeGetListIdList()

int sceGeGetListIdList ( int *  outPtr,
int  size,
int *  totalCountPtr 
)

Gets a list of the IDs of the display lists currently being in the queue.

Parameters
outPtrA buffer that will store the display lists' ID.
sizeThe number of IDs to store.
totalCountPtrA point where will be stored the total number of display lists.
Returns
The number of stored list IDs on success, otherwise less than zero.

◆ sceGeGetList()

int sceGeGetList ( int  dlId,
SceGeDisplayList outDl,
int *  outFlag 
)

Gets a display list from its ID.

Parameters
dlIdThe display list ID.
outDlA pointer where the display list will be stored.
outFlagA pointer where will be stored (outDl->state << 2) | outDl->signal.
Returns
Zero on success, otherwise less than zero.

◆ sceGeListUpdateStallAddr()

int sceGeListUpdateStallAddr ( int  dlId,
void *  stall 
)

Updates the stall address.

Parameters
dlIdThe ID of the display list whose stall address will be modified
Returns
Zero on success, otherwise less than zero.

◆ sceGeGetCmd()

int sceGeGetCmd ( u32  cmdOff)

Gets a command (?).

Parameters
cmdOffThe command ID.
Returns
The command on success, otherwise less than zero.

◆ sceGeGetMtx()

int sceGeGetMtx ( int  id,
int *  mtx 
)

Gets a matrix.

Parameters
idThe matrix ID (0 - 11)
mtxA buffer to store the matrix.
Returns
Zero on success, otherwise less than zero.

◆ sceGeSaveContext()

int sceGeSaveContext ( SceGeContext ctx)

Saves the GE context of the current display list into a structure.

Parameters
ctxThe structure to save the GE context in.
Returns
Zero on success, otherwise less than zero.

◆ sceGeRestoreContext()

int sceGeRestoreContext ( SceGeContext ctx)

Restores a context from a structure.

Parameters
ctxThe structure to load the GE context from.
Returns
Zero on success, otherwise less than zero.

◆ sceGeEdramGetAddr()

int sceGeEdramGetAddr ( )

Gets the EDRAM address.

Returns
0x04000000.

◆ sceGeEdramSetAddrTranslation()

int sceGeEdramSetAddrTranslation ( int  arg)

Sets the EDRAM address translation.

Parameters
argThe memory width (0, 0x200, 0x400, 0x800 or 0x1000).
Returns
The previous memory width.

◆ sceGeEdramGetSize()

int sceGeEdramGetSize ( )

Gets the EDRAM size, set with sceGeEdramSetSize().

Returns
The EDRAM size.

◆ sceGeListDeQueue()

int sceGeListDeQueue ( int  dlId)

Dequeues a list.

Parameters
dlIdThe ID of the display list to dequeue.
Returns
Zero on success, otherwise less than zero.

◆ sceGeListSync()

SceGeListState sceGeListSync ( int  dlId,
int  mode 
)

Peeks a list state, or waits for it to be completed.

Parameters
dlIdThe ID of the display list to check.
mode0 to wait for the display list to be completed, or 1 to check its current state.
Returns
On success, SCE_GE_LIST_COMPLETED if mode is 0, one of the values of SceGeListState if mode is 1, and otherwise, less than zero.

◆ sceGeDrawSync()

SceGeListState sceGeDrawSync ( int  syncType)

Peeks a drawing state, or waits for the drawing to be completed.

Parameters
syncType0 to wait for the drawing to be completed, or to check its current state.
Returns
On success, SCE_GE_LIST_COMPLETED if mode is 0, SCE_GE_LIST_STALLING, SCE_GE_LIST_DRAWING or SCE_GE_LIST_COMPLETED if mode is 1, and otherwise, less than zero.

◆ sceGeBreak()

int sceGeBreak ( u32  resetQueue,
void *  arg1 
)

Stop the GE drawing.

Parameters
resetQueueIf not set to 0, the display list queue will be emptied.
arg1Unused pointer.
Returns
The stopped display list ID on success, otherwise less than zero.

◆ sceGeContinue()

int sceGeContinue ( )

Continues the queue execution after a sceGeBreak().

Returns
Zero on success, otherwise less than zero.

◆ sceGeSetCallback()

int sceGeSetCallback ( SceGeCallbackData cb)

Sets GE finish/signal callbacks.

Parameters
cbThe GE callbacks parameters.
Returns
The callbacks id on success, otherwise less than zero.

◆ sceGeGetStack()

int sceGeGetStack ( int  stackId,
SceGeStack stack 
)

Gets a stack from the current display list, using its ID.

Parameters
stackIdThe stack ID.
stackA pointer where the stack will be stored.
Returns
The current stack of the display list on success, otherwise less than zero.

◆ sceGeListEnQueue()

int sceGeListEnQueue ( void *  list,
void *  stall,
int  cbid,
SceGeListArgs arg 
)

Enqueues a display list at the end of the queue.

Parameters
listA pointer to the list of commands.
stallThe address where the display list will stall.
cbidThe callback ID, returned by sceGeSetCallback(), of the callbacks to be used.
argA structure storing arguments about the list.
Returns
The display list ID on success, otherwise less than zero.

◆ sceGeListEnQueueHead()

int sceGeListEnQueueHead ( void *  list,
void *  stall,
int  cbid,
SceGeListArgs arg 
)

Enqueues a display list as the next display list that will be executed.

Parameters
listA pointer to the list of commands.
stallThe address where the display list will stall.
cbidThe callback ID, returned by sceGeSetCallback(), of the callbacks to be used.
argA structure storing arguments about the list.
Returns
The display list ID on success, otherwise less than zero.

◆ sceGeUnsetCallback()

int sceGeUnsetCallback ( int  cbId)

Unsets GE callbacks.

Parameters
cbIdThe ID of the callbacks to unset.
Returns
Zero on success, otherwise less than zero.