psl1ght
A free SDK for Sony's PS3 console
Functions
rsx.h File Reference

RSX library. More...

#include <rsx/mm.h>
#include <rsx/gcm_sys.h>
#include <rsx/rsx_program.h>
#include <rsx/commands.h>

Go to the source code of this file.

Functions

gcmContextDatarsxInit (const u32 cmdSize, const u32 ioSize, const void *ioAddress)
 Initialize the RSX context and the RSX memory manager. More...
 
void rsxFlushBuffer (gcmContextData *context)
 Flushes the RSX command buffer. More...
 
void rsxResetCommandBuffer (gcmContextData *context)
 Reset the RSX command buffer. More...
 
void rsxFinish (gcmContextData *context, u32 ref_value)
 
void rsxSetupContextData (gcmContextData *context, const u32 *addr, const u32 size, gcmContextCallback cb)
 
static s32 rsxAddressToOffset (void *ptr, u32 *offset)
 Converts a pointer value in RSX memory to an offset. More...
 
static s32 rsxGetFixedSint32 (const f32 f)
 Convert a floating point coordinate into 32-bit signed fixed point format.
 
static u16 rsxGetFixedUint16 (const f32 f)
 Convert a floating point coordinate into 16-bit unsigned fixed point format.
 

Detailed Description

RSX library.

This library contains the necessary functions for handling the RSX, the accelerated 3D chip of the PS3.

Function Documentation

◆ rsxAddressToOffset()

static s32 rsxAddressToOffset ( void *  ptr,
u32 *  offset 
)
inlinestatic

Converts a pointer value in RSX memory to an offset.

Parameters
ptrThe pointer whose value is to be converted.
offsetA pointer to the returned offset value.
Returns
zero if no error occured, nonzero otherwise.

◆ rsxFlushBuffer()

void rsxFlushBuffer ( gcmContextData context)

Flushes the RSX command buffer.

This ensures all remaining commands in the command buffer are executed, and that the buffer is empty when that function returns.

Parameters
contextPointer to the context object.

◆ rsxInit()

gcmContextData* rsxInit ( const u32  cmdSize,
const u32  ioSize,
const void *  ioAddress 
)

Initialize the RSX context and the RSX memory manager.

The user must provide a 1 MB-aligned IO buffer allocated in main memory, which size is a multiple of 1 megabyte.

This function initializes a heap structure in RSX memory space, allowing dynamic memory allocation using rsxMalloc, rsxMemalign and rsxFree.

Parameters
cmdSizeThe command buffer size.
ioSizeThe allocated IO buffer size.
ioAddressPointer to an allocated buffer of ioSize bytes.
Returns
Pointer to the allocated context structure.

◆ rsxResetCommandBuffer()

void rsxResetCommandBuffer ( gcmContextData context)

Reset the RSX command buffer.

Parameters
contextPointer to the context object.