Overview
RESC allows you to:- Render at lower resolutions (e.g., 720p) and upscale to higher resolutions (1080p)
- Support multiple display modes simultaneously (480p, 720p, 1080i, 1080p)
- Apply convolution filters for improved image quality
- Handle PAL temporal conversion modes
- Manage aspect ratio conversion (letterbox, pan-scan)
Initialization
rescInit
Initialize the RESC library.Pointer to initialization configuration structure
Returns 0 on success, error code on failure
rescInitConfig Structure
rescInitConfig Structure
Example
rescExit
Shutdown and cleanup the RESC library.Configuration
rescSetDsts
Set destination buffer configuration.Destination mode: RESC_720x480, RESC_720x576, RESC_1280x720, or RESC_1920x1080
Pointer to destination configuration structure
Returns 0 on success, error code on failure
rescDsts Structure
rescDsts Structure
Example
rescSetDisplayMode
Set the current display mode.Display mode: RESC_720x480, RESC_720x576, RESC_1280x720, or RESC_1920x1080
Returns 0 on success, error code on failure
rescSetSrc
Set source buffer for rendering.Source buffer index
Pointer to source configuration structure
Returns 0 on success, error code on failure
rescSrc Structure
rescSrc Structure
Example
Buffer Management
rescGetNumColorBuffers
Get the number of color buffers required.Destination mode
PAL temporal mode
Reserved (set to 0)
Number of color buffers required, or negative error code
rescGetBufferSize
Get required buffer sizes.Pointer to receive color buffer size
Pointer to receive vertex array size
Pointer to receive fragment shader size
Returns 0 on success, error code on failure
Example
rescSetBufferAddress
Set buffer addresses for RESC.Pointer to color buffer memory
Pointer to vertex array memory
Pointer to fragment shader memory
Returns 0 on success, error code on failure
Rendering and Display
rescSetConvertAndFlip
Perform resolution conversion and flip the display.Pointer to GCM context
Source buffer index
Returns 0 on success, error code on failure
Example
rescSetWaitFlip
Wait for flip to complete.Pointer to GCM context
gcmSetWaitFlip() but used with RESC.
rescGetFlipStatus
Get the current flip status.Returns flip status
gcmGetFlipStatus().
rescResetFlipStatus
Reset the flip status.gcmResetFlipStatus().
rescGetLastFlipTime
Get timestamp of last flip.Timestamp of last flip
gcmGetLastFlipTime().
Event Handlers
rescSetVBlankHandler
Register a VBlank callback handler.Callback function (NULL to cancel)
gcmSetVBlankHandler().
rescSetFlipHandler
Register a flip callback handler.Callback function (NULL to cancel)
gcmSetFlipHandler().
Advanced Configuration
rescAdjustAspectRatio
Adjust aspect ratio for output.Horizontal scale factor
Vertical scale factor
Returns 0 on success, error code on failure
Example
rescSetPalInterpolateDropFlexRatio
Set PAL interpolation drop flex ratio.Flex ratio value
Returns 0 on success, error code on failure
rescCreateInterlaceTable
Create an interlace conversion table.Effective address for table
Source height
Depth value
Table length
Returns 0 on success, error code on failure
rescGetRegisterCount
Get the current register count.Current register count
rescSetRegisterCount
Set the register count.Register count to set
Utility Functions
rescGcmSurface2RescSrc
Convert a GCM surface to RESC source format.Pointer to GCM surface structure
Pointer to receive RESC source structure
Returns 0 on success, error code on failure
rescVideoResolution2RescBufferMode
Convert video resolution ID to RESC buffer mode.Video resolution ID
Pointer to receive RESC buffer mode
Returns 0 on success, error code on failure
Constants
Resource Policies
RESC_CONSTANT_VRAM(0) - Use constant VRAM allocationRESC_MINIMUM_VRAM(1) - Use minimum VRAM allocationRESC_CONSTANT_GPU_LOAD(0) - Constant GPU load (deprecated)RESC_MINIMUM_GPU_LOAD(2) - Minimum GPU load
Display Modes
RESC_720x480(1) - 480p SD resolutionRESC_720x576(2) - 576p PAL resolutionRESC_1280x720(4) - 720p HD resolutionRESC_1920x1080(8) - 1080p Full HD resolution
Ratio Modes
RESC_FULLSCREEN(0) - Stretch to fill screenRESC_LETTERBOX(1) - Add black bars to maintain aspect ratioRESC_PANSCAN(2) - Crop to fill screen
PAL Temporal Modes
RESC_PAL_50(0) - 50Hz PALRESC_PAL_60_DROP(1) - 60Hz with frame droppingRESC_PAL_60_INTERPOLATE(2) - 60Hz with interpolationRESC_PAL_60_INTERPOLATE_30_DROP(3) - 60Hz interpolated with 30fps dropRESC_PAL_60_INTERPOLATE_DROP_FLEXIBLE(4) - Flexible interpolationRESC_PAL_60_FOR_HSYNC(5) - 60Hz for HSync
Convolution Filters
RESC_NORMAL_BILINEAR(0) - Standard bilinear filteringRESC_INTERLACE_FILTER(1) - Interlace filteringRESC_3X3_GAUSSIAN(2) - 3x3 Gaussian blurRESC_2X3_QUINCUNX(3) - 2x3 quincunx filteringRESC_2X3_QUINCUNX_ALT(4) - Alternative 2x3 quincunx
Surface Formats
RESC_SURFACE_A8R8G8B8(8) - 32-bit ARGBRESC_SURFACE_F_W16Z16Y16X16(11) - 64-bit float
Error Codes
RESC_ERROR_NOT_INITIALIZED(0x80210301) - RESC not initializedRESC_ERROR_REINITIALIZED(0x80210302) - Already initializedRESC_ERROR_BAD_ALIGNMENT(0x80210303) - Bad memory alignmentRESC_ERROR_BAD_ARGUMENT(0x80210304) - Invalid argumentRESC_ERROR_LESS_MEMORY(0x80210305) - Insufficient memoryRESC_ERROR_GCM_FLIP_QUE_FULL(0x80210306) - Flip queue fullRESC_ERROR_BAD_COMBINATION(0x80210307) - Invalid combination
Complete Example
Full RESC Setup
See Also
- RSX - RSX initialization and management
- GCM System - Low-level command buffer operations