psl1ght
A free SDK for Sony's PS3 console
Loading...
Searching...
No Matches
resc.h
Go to the documentation of this file.
1
5#ifndef __RESC_H__
6#define __RESC_H__
7
8#include <ppu-types.h>
9
10#include <rsx/gcm_sys.h>
11#include <sysutil/sysutil.h>
12
13
14/*
15 * constants
16 */
17
18/* Errors */
19#define RESC_ERROR_NOT_INITIALIZED (0x80210301)
20#define RESC_ERROR_REINITIALIZED (0x80210302)
21#define RESC_ERROR_BAD_ALIGNMENT (0x80210303)
22#define RESC_ERROR_BAD_ARGUMENT (0x80210304)
23#define RESC_ERROR_LESS_MEMORY (0x80210305)
24#define RESC_ERROR_GCM_FLIP_QUE_FULL (0x80210306)
25#define RESC_ERROR_BAD_COMBINATION (0x80210307)
26
27/* resource policies */
28#define RESC_CONSTANT_VRAM 0
29#define RESC_MINIMUM_VRAM 1
30#define RESC_CONSTANT_GPU_LOAD 0 /* do not use */
31#define RESC_MINIMUM_GPU_LOAD 2
32
33/* dst formats */
34#define RESC_SURFACE_A8R8G8B8 GCM_TF_COLOR_A8R8G8B8 /* 8 */
35#define RESC_SURFACE_F_W16Z16Y16X16 GCM_TF_COLOR_F_W16Z16Y16X16 /* 11 */
36
37/* buffer modes */
38#define RESC_UNDEFINED 0
39#define RESC_720x480 1
40#define RESC_720x576 2
41#define RESC_1280x720 4
42#define RESC_1920x1080 8
43
44/* ratio convert modes */
45#define RESC_FULLSCREEN 0
46#define RESC_LETTERBOX 1
47#define RESC_PANSCAN 2
48
49/* PAL temporal mode */
50#define RESC_PAL_50 0
51#define RESC_PAL_60_DROP 1
52#define RESC_PAL_60_INTERPOLATE 2
53#define RESC_PAL_60_INTERPOLATE_30_DROP 3
54#define RESC_PAL_60_INTERPOLATE_DROP_FLEXIBLE 4
55#define RESC_PAL_60_FOR_HSYNC 5
56
57/* convolution filter mode */
58#define RESC_NORMAL_BILINEAR 0
59#define RESC_INTERLACE_FILTER 1
60#define RESC_3X3_GAUSSIAN 2
61#define RESC_2X3_QUINCUNX 3
62#define RESC_2X3_QUINCUNX_ALT 4
63
64/* table element */
65#define RESC_ELEMENT_HALF 0
66#define RESC_ELEMENT_FLOAT 1
67
68/* flip mode */
69#define RESC_DISPLAY_VSYNC 0
70#define RESC_DISPLAY_HSYNC 1
71
72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
77
78/*
79 * enumerations
80 */
81
82/*
83typedef enum resc_resource_policy
84{
85 RESC_CONSTANT_VRAM = 0,
86 RESC_MINIMUM_VRAM = 1,
87 RESC_CONSTANT_GPU_LOAD = 0,
88 RESC_MINIMUM_GPU_LOAD = 2,
89} rescResourcePolicy;
90
91typedef enum resc_display_buffer_mode
92{
93 RESC_UNDEFINED = 0,
94 RESC_720x480 = 1,
95 RESC_720x576 = 2,
96 RESC_1280x720 = 4,
97 RESC_1920x1080 = 8
98} rescDisplayBufferMode;
99
100typedef enum resc_ratio_convert_mode
101{
102 RESC_FULLSCREEN = 0,
103 RESC_LETTERBOX = 1,
104 RESC_PANSCAN = 2
105} rescRatioConvertMode;
106
107typedef enum resc_pal_temporal_mode
108{
109 RESC_PAL_50 = 0,
110 RESC_PAL_60_DROP = 1,
111 RESC_PAL_60_INTERPOLATE = 2,
112 RESC_PAL_60_INTERPOLATE_30_DROP = 3,
113 RESC_PAL_60_INTERPOLATE_DROP_FLEXIBLE = 4,
114 RESC_PAL_60_FOR_HSYNC = 5
115} rescPalTemporalMode;
116
117typedef enum resc_convolution_filter_mode
118{
119 RESC_NORMAL_BILINEAR = 0,
120 RESC_INTERLACE_FILTER = 1,
121 RESC_3X3_GAUSSIAN = 2,
122 RESC_2X3_QUINCUNX = 3,
123 RESC_2X3_QUINCUNX_ALT = 4
124
125} rescConvolutionFilterMode;
126
127typedef enum resc_flip_mode
128{
129 RESC_DISPLAY_VSYNC = 0,
130 RESC_DISPLAY_HSYNC = 1
131} rescFlipMode;
132*/
133
134
135/*
136 * structures
137 */
138
149
150typedef struct _resc_src
151{
153 u32 pitch;
154 u16 width;
158
159typedef struct _resc_dsts
160{
162 u32 pitch;
165
166
167/*
168 * functions
169 */
170
171/* equivalent functions
172 *
173 * rescSetSrc() gcmSetDisplayBuffer()
174 * rescSetConvertAndFlip() gcmSetFlip()
175 * rescSetWaitFlip() gcmSetWaitFlip()
176 * rescSetFlipHandler() gcmSetFlipHandler()
177 * rescSetVBlankHandler() gcmSetVBlankHandler()
178 * rescGetFlipStatus() gcmGetFlipStatus()
179 * rescGetLasFlipTime() gcmGetLastFlipTime()
180 * rescResetFlipStatus() gcmResetFlipStatus()
181 */
182
183s32 rescInit(const rescInitConfig* const initConfig);
184void rescExit();
185s32 rescSetDsts(u32 dstsMode, rescDsts *dsts);
186s32 rescSetDisplayMode(u32 bufferMode);
187s32 rescGetNumColorBuffers(u32 dstsMode, u32 palTemporalMode, u32 reserved);
188s32 rescGetBufferSize(int *colorBuffers, int *vertexArray, int *fragmentShader);
189s32 rescSetBufferAddress(void *colorBuffers, void *vertexArray, void *fragmentShader);
190s32 rescSetSrc(s32 idx, rescSrc *src);
197void rescSetRegisterCount(s32 count);
199s32 rescCreateInterlaceTable(void *ea, float srcH, s32 depth, int length);
200s32 rescAdjustAspectRatio(float horizontal, float vertical);
201
202/* Register event handler */
203void rescSetVBlankHandler(void (*handler)(u32 head));
204void rescSetFlipHandler(void (*handler)(u32 head));
205
206/* Utility functions */
208s32 rescVideoResolution2RescBufferMode(u32 resolutionId, u32 *bufferMode);
209
210#ifdef __cplusplus
211 }
212#endif
213
214#endif
215
RSX low level management.
s32 rescGetRegisterCount()
s32 rescInit(const rescInitConfig *const initConfig)
void rescExit()
void rescSetFlipHandler(void(*handler)(u32 head))
u32 rescGetFlipStatus()
struct _resc_init_config rescInitConfig
s32 rescVideoResolution2RescBufferMode(u32 resolutionId, u32 *bufferMode)
void rescResetFlipStatus()
s32 rescCreateInterlaceTable(void *ea, float srcH, s32 depth, int length)
s32 rescGetBufferSize(int *colorBuffers, int *vertexArray, int *fragmentShader)
s32 rescSetDsts(u32 dstsMode, rescDsts *dsts)
s32 rescAdjustAspectRatio(float horizontal, float vertical)
s32 rescGcmSurface2RescSrc(gcmSurface *surface, rescSrc *src)
struct _resc_dsts rescDsts
void rescSetWaitFlip(gcmContextData *context)
s32 rescSetDisplayMode(u32 bufferMode)
void rescSetVBlankHandler(void(*handler)(u32 head))
s32 rescSetPalInterpolateDropFlexRatio(float ratio)
s32 rescSetConvertAndFlip(gcmContextData *context, s32 idx)
s32 rescSetBufferAddress(void *colorBuffers, void *vertexArray, void *fragmentShader)
s64 rescGetLastFlipTime()
void rescSetRegisterCount(s32 count)
struct _resc_src rescSrc
s32 rescSetSrc(s32 idx, rescSrc *src)
s32 rescGetNumColorBuffers(u32 dstsMode, u32 palTemporalMode, u32 reserved)
uint64_t ea
Definition spu_atomic.h:35
RSX Context data structure.
Definition gcm_sys.h:723
RSX target surface data structure.
Definition gcm_sys.h:760
u32 pitch
Definition resc.h:162
u32 heightAlign
Definition resc.h:163
u32 format
Definition resc.h:161
u32 interlaceMode
Definition resc.h:146
u32 resourcePolicy
Definition resc.h:142
u32 palTemporalMode
Definition resc.h:145
u32 format
Definition resc.h:152
u16 width
Definition resc.h:154
u32 offset
Definition resc.h:156
u32 pitch
Definition resc.h:153
u16 height
Definition resc.h:155
Miscellaneous system utility functions.