Initialization
rsxInit
Initialize the RSX context and memory manager.Pointer to receive the address of the default command buffer context
Command buffer size in bytes
Size of the IO buffer allocated in main memory (must be multiple of 1 MB)
Pointer to a 1 MB-aligned buffer in main memory of ioSize bytes
Returns 0 on success, nonzero on error
rsxMalloc(), rsxMemalign(), and rsxFree().
Example
Context Management
rsxSetupContextData
Manually setup a command buffer context.Pointer to the context structure to initialize
Start address of the command buffer
Size of the command buffer in bytes
Callback function to be called when buffer is full
rsxSetCurrentBuffer
Set the current command buffer.Pointer to pointer of context structure
Start address of the command buffer
Size of the command buffer in bytes
rsxSetDefaultCommandBuffer
Restore the default command buffer context.Pointer to pointer to receive the default context
rsxGetCurrentBuffer
Get the current position in the command buffer.Pointer to the current position in the command buffer
rsxSetUserCallback
Set a user-defined callback for the command buffer.Callback function to be invoked when buffer is full
Memory Management
rsxAddressToOffset
Convert a pointer in RSX memory to an offset value.Pointer to convert
Pointer to receive the offset value
Returns 0 on success, nonzero on error
Example
rsxHeapInit
Initialize the RSX memory heap.Returns 0 on success, nonzero on error
rsxMalloc
Dynamically allocate RSX video memory.Size in bytes to allocate
Pointer to allocated buffer, or NULL on error
Example
rsxMemalign
Dynamically allocate aligned RSX video memory.Required alignment in bytes (typically 64 or higher)
Size in bytes to allocate
Pointer to allocated aligned buffer, or NULL on error
rsxMalloc() when alignment is critical.
Example
rsxFree
Free previously allocated RSX memory.Pointer to buffer allocated with rsxMalloc() or rsxMemalign()
Utility Functions
rsxGetFixedSint32
Convert floating point coordinate to 32-bit signed fixed point.Floating point value to convert
32-bit signed fixed point representation (multiplied by 1048576.0)
Example
rsxGetFixedUint16
Convert floating point coordinate to 16-bit unsigned fixed point.Floating point value to convert
16-bit unsigned fixed point representation (multiplied by 16.0)
rsxAlign
Align a value to the specified alignment.Alignment value (power of 2)
Value to align
Aligned value
Example
Global Context
gGcmContext
Pointer to the default command buffer context.rsxInit(). Most RSX command functions use this context automatically.
Typical Usage Pattern
Complete Example
See Also
- GCM System - Low-level command buffer and display management
- RESC - Resolution scaling and conversion
- Video Configuration - Display output configuration