psl1ght
A free SDK for Sony's PS3 console
gcm_sys.h
Go to the documentation of this file.
1 
5 #ifndef __GCM_SYS_H__
6 #define __GCM_SYS_H__
7 
8 #include <ppu-types.h>
9 
11 #define GCM_TRUE 1
12 
13 #define GCM_FALSE 0
14 
16 #define GCM_FLIP_HSYNC 1
17 
18 #define GCM_FLIP_VSYNC 2
19 
20 #define GCM_FLIP_HSYNC_AND_BREAK_EVERYTHING 3
21 
23 #define GCM_MAX_MRT_COUNT 4
24 
25 #define GCM_DMA_MEMORY_FRAME_BUFFER (0xFEED0000)
26 #define GCM_DMA_MEMORY_HOST_BUFFER (0xFEED0001)
27 
28 #define GCM_CONTEXT_SURFACE2D (0x313371C3)
29 #define GCM_CONTEXT_SWIZZLE2D (0x31337A73)
30 
31 #define GCM_TRANSFER_LOCAL_TO_LOCAL 0
32 #define GCM_TRANSFER_MAIN_TO_LOCAL 1
33 #define GCM_TRANSFER_LOCAL_TO_MAIN 2
34 #define GCM_TRANSFER_MAIN_TO_MAIN 3
35 
36 #define GCM_TF_COLOR_R5G5B5 3
37 #define GCM_TF_COLOR_X8R8G8B8 5
38 #define GCM_TF_COLOR_A8R8G8B8 8
39 
41 #define GCM_TF_ZETA_Z16 1
42 
43 #define GCM_TF_ZETA_Z24S8 2
44 
46 #define GCM_TF_TYPE_LINEAR 1
47 
48 #define GCM_TF_TYPE_SWIZZLE 2
49 
51 #define GCM_LOCATION_RSX 0
52 
53 #define GCM_LOCATION_CELL 1
54 
56 #define GCM_TF_TARGET_NONE 0
57 
58 #define GCM_TF_TARGET_0 1
59 
60 #define GCM_TF_TARGET_1 2
61 
62 #define GCM_TF_TARGET_MRT1 0x13
63 
64 #define GCM_TF_TARGET_MRT2 0x17
65 
66 #define GCM_TF_TARGET_MRT3 0x1f
67 
69 #define GCM_TF_CENTER_1 0
70 
72 #define GCM_COLOR_MASK_B 0x00000001
73 
74 #define GCM_COLOR_MASK_G 0x00000100
75 
76 #define GCM_COLOR_MASK_R 0x00010000
77 
78 #define GCM_COLOR_MASK_A 0x01000000
79 
81 #define GCM_CLEAR_Z 0x01
82 
83 #define GCM_CLEAR_S 0x02
84 
85 #define GCM_CLEAR_R 0x10
86 
87 #define GCM_CLEAR_G 0x20
88 
89 #define GCM_CLEAR_B 0x40
90 
91 #define GCM_CLEAR_A 0x80
92 
93 #define GCM_CLEAR_M 0xf3
94 
96 #define GCM_NEVER 0x0200
97 
98 #define GCM_LESS 0x0201
99 
100 #define GCM_EQUAL 0x0202
101 
102 #define GCM_LEQUAL 0x0203
103 
104 #define GCM_GREATER 0x0204
105 
106 #define GCM_NOTEQUAL 0x0205
107 
108 #define GCM_GEQUAL 0x0206
109 
110 #define GCM_ALWAYS 0x0207
111 
113 #define GCM_CULL_FRONT 0x0404
114 
115 #define GCM_CULL_BACK 0x0405
116 
117 #define GCM_CULL_ALL 0x0408
118 
120 #define GCM_FRONTFACE_CW 0x0900
121 
122 #define GCM_FRONTFACE_CCW 0x0901
123 
125 #define GCM_TYPE_POINTS 1
126 
127 #define GCM_TYPE_LINES 2
128 
129 #define GCM_TYPE_LINE_LOOP 3
130 
131 #define GCM_TYPE_LINE_STRIP 4
132 
133 #define GCM_TYPE_TRIANGLES 5
134 
135 #define GCM_TYPE_TRIANGLE_STRIP 6
136 
137 #define GCM_TYPE_TRIANGLE_FAN 7
138 
139 #define GCM_TYPE_QUADS 8
140 
141 #define GCM_TYPE_QUAD_STRIP 9
142 
143 #define GCM_TYPE_POLYGON 10
144 
146 #define GCM_INVALIDATE_TEXTURE 1
147 
148 #define GCM_INVALIDATE_VERTEX_TEXTURE 2
149 
151 #define GCM_TEXTURE_DIMS_1D 1
152 
153 #define GCM_TEXTURE_DIMS_2D 2
154 
155 #define GCM_TEXTURE_DIMS_3D 3
156 
157 #define GCM_TEXTURE_FORMAT_SWZ 0x00
158 #define GCM_TEXTURE_FORMAT_LIN 0x20
159 #define GCM_TEXTURE_FORMAT_NRM 0x40
160 
161 #define GCM_TEXTURE_FORMAT_L8 1
162 #define GCM_TEXTURE_FORMAT_A1R5G5B5 2
163 #define GCM_TEXTURE_FORMAT_A4R4G4B4 3
164 #define GCM_TEXTURE_FORMAT_R5G6B5 4
165 #define GCM_TEXTURE_FORMAT_A8R8G8B8 5
166 #define GCM_TEXTURE_FORMAT_DXT1 6
167 #define GCM_TEXTURE_FORMAT_DXT3 7
168 #define GCM_TEXTURE_FORMAT_DXT5 8
169 #define GCM_TEXTURE_FORMAT_A8L8 24
170 
172 #define GCM_TEXTURE_REMAP_TYPE_B_SHIFT 14
173 
174 #define GCM_TEXTURE_REMAP_TYPE_G_SHIFT 12
175 
176 #define GCM_TEXTURE_REMAP_TYPE_R_SHIFT 10
177 
178 #define GCM_TEXTURE_REMAP_TYPE_A_SHIFT 8
179 
181 #define GCM_TEXTURE_REMAP_COLOR_B_SHIFT 6
182 
183 #define GCM_TEXTURE_REMAP_COLOR_G_SHIFT 4
184 
185 #define GCM_TEXTURE_REMAP_COLOR_R_SHIFT 2
186 
187 #define GCM_TEXTURE_REMAP_COLOR_A_SHIFT 0
188 
190 #define GCM_TEXTURE_REMAP_TYPE_ZERO 0
191 
192 #define GCM_TEXTURE_REMAP_TYPE_ONE 1
193 
194 #define GCM_TEXTURE_REMAP_TYPE_REMAP 2
195 
197 #define GCM_TEXTURE_REMAP_COLOR_A 0
198 
199 #define GCM_TEXTURE_REMAP_COLOR_R 1
200 
201 #define GCM_TEXTURE_REMAP_COLOR_G 2
202 
203 #define GCM_TEXTURE_REMAP_COLOR_B 3
204 
206 #define GCM_TEXTURE_MAX_ANISO_1 0
207 
208 #define GCM_TEXTURE_MAX_ANISO_2 1
209 
210 #define GCM_TEXTURE_MAX_ANISO_4 2
211 
212 #define GCM_TEXTURE_MAX_ANISO_6 3
213 
214 #define GCM_TEXTURE_MAX_ANISO_8 4
215 
216 #define GCM_TEXTURE_MAX_ANISO_10 5
217 
218 #define GCM_TEXTURE_MAX_ANISO_12 6
219 
220 #define GCM_TEXTURE_MAX_ANISO_16 7
221 
222 #define GCM_TEXTURE_NEAREST 1
223 #define GCM_TEXTURE_LINEAR 2
224 #define GCM_TEXTURE_NEAREST_MIPMAP_NEAREST 3
225 #define GCM_TEXTURE_LINEAR_MIPMAP_NEAREST 4
226 #define GCM_TEXTURE_NEAREST_MIPMAP_LINEAR 5
227 #define GCM_TEXTURE_LINEAR_MIPMAP_LINEAR 6
228 
229 #define GCM_TEXTURE_CONVOLUTION_QUINCUNX 1
230 #define GCM_TEXTURE_CONVOLUTION_GAUSSIAN 2
231 #define GCM_TEXTURE_CONVOLUTION_QUINCUNX_ALT 3
232 
233 #define GCM_TEXTURE_REPEAT 1
234 #define GCM_TEXTURE_MIRRORED_REPEAT 2
235 #define GCM_TEXTURE_CLAMP_TO_EDGE 3
236 #define GCM_TEXTURE_CLAMP_TO_BORDER 4
237 #define GCM_TEXTURE_CLAMP 5
238 #define GCM_TEXTURE_MIRROR_CLAMP_TO_EDGE 6
239 #define GCM_TEXTURE_MIRROR_CLAMP_TO_BORDER 7
240 #define GCM_TEXTURE_MIRROR_CLAMP 8
241 
242 #define GCM_TEXTURE_ZFUNC_NEVER 0
243 #define GCM_TEXTURE_ZFUNC_LESS 1
244 #define GCM_TEXTURE_ZFUNC_EQUAL 2
245 #define GCM_TEXTURE_ZFUNC_LEQUAL 3
246 #define GCM_TEXTURE_ZFUNC_GREATER 4
247 #define GCM_TEXTURE_ZFUNC_NOTEQUAL 5
248 #define GCM_TEXTURE_ZFUNC_GEQUAL 6
249 #define GCM_TEXTURE_ZFUNC_ALWAYS 7
250 
251 #define GCM_VERTEX_ATTRIB_POS 0
252 #define GCM_VERTEX_ATTRIB_WEIGHT 1
253 #define GCM_VERTEX_ATTRIB_NORMAL 2
254 #define GCM_VERTEX_ATTRIB_COLOR0 3
255 #define GCM_VERTEX_ATTRIB_COLOR1 4
256 #define GCM_VERTEX_ATTRIB_FOG 5
257 #define GCM_VERTEX_ATTRIB_COLOR_INDEX 6
258 #define GCM_VERTEX_ATTRIB_POINT_SIZE 6 /*alias*/
259 #define GCM_VERTEX_ATTRIB_EDGEFLAG 7
260 #define GCM_VERTEX_ATTRIB_TEX0 8
261 #define GCM_VERTEX_ATTRIB_TEX1 9
262 #define GCM_VERTEX_ATTRIB_TEX2 10
263 #define GCM_VERTEX_ATTRIB_TEX3 11
264 #define GCM_VERTEX_ATTRIB_TEX4 12
265 #define GCM_VERTEX_ATTRIB_TEX5 13
266 #define GCM_VERTEX_ATTRIB_TEX6 14
267 #define GCM_VERTEX_ATTRIB_TEX7 15
268 
269 #define GCM_VERTEX_DATA_TYPE_F32 2
270 #define GCM_VERTEX_DATA_TYPE_U8 4
271 
272 #define GCM_INDEX_TYPE_32B 0
273 #define GCM_INDEX_TYPE_16B 1
274 
275 #define GCM_USER_CLIP_PLANE_DISABLE 0
276 #define GCM_USER_CLIP_PLANE_LT 1
277 #define GCM_USER_CLIP_PLANE_GE 2
278 
280 #define GCM_SHADE_MODEL_FLAT 0x1D00
281 
282 #define GCM_SHADE_MODEL_SMOOTH 0x1D01
283 
285 #define GCM_ZERO 0
286 
287 #define GCM_ONE 1
288 
289 #define GCM_SRC_COLOR 0x0300
290 
291 #define GCM_ONE_MINUS_SRC_COLOR 0x0301
292 
293 #define GCM_SRC_ALPHA 0x0302
294 
295 #define GCM_ONE_MINUS_SRC_ALPHA 0x0303
296 
297 #define GCM_DST_ALPHA 0x0304
298 
299 #define GCM_ONE_MINUS_DST_ALPHA 0x0305
300 
301 #define GCM_DST_COLOR 0x0306
302 
303 #define GCM_ONE_MINUS_DST_COLOR 0x0307
304 
305 #define GCM_SRC_ALPHA_SATURATE 0x0308
306 
307 #define GCM_CONSTANT_COLOR 0x8001
308 
309 #define GCM_ONE_MINUS_CONSTANT_COLOR 0x8002
310 
311 #define GCM_CONSTANT_ALPHA 0x8003
312 
313 #define GCM_ONE_MINUS_CONSTANT_ALPHA 0x8004
314 
316 #define GCM_FUNC_ADD 0x8006
317 
318 #define GCM_MIN 0x8007
319 
320 #define GCM_MAX 0x8008
321 
322 #define GCM_FUNC_SUBTRACT 0x800a
323 
324 #define GCM_FUNC_REVERSE_SUBTRACT 0x800b
325 
326 #define GCM_FUNC_REVERSE_SUBTRACT_SIGNED 0xf005
327 
328 #define GCM_FUNC_ADD_SIGNED 0xf006
329 
330 #define GCM_FUNC_REVERSE_ADD_SIGNED 0xf007
331 
332 #define GCM_TRANSFER_SURFACE 0
333 #define GCM_TRANSFER_SWIZZLE 1
334 
336 #define GCM_TRANSFER_CONVERSION_DITHER 0
337 
338 #define GCM_TRANSFER_CONVERSION_TRUNCATE 1
339 
340 #define GCM_TRANSFER_CONVERSION_SUBTRACT_TRUNCATE 2
341 
343 #define GCM_TRANSFER_SCALE_FORMAT_A1R5G5B5 1
344 
345 #define GCM_TRANSFER_SCALE_FORMAT_X1R5G5B5 2
346 
347 #define GCM_TRANSFER_SCALE_FORMAT_A8R8G8B8 3
348 
349 #define GCM_TRANSFER_SCALE_FORMAT_X8R8G8B8 4
350 
351 #define GCM_TRANSFER_SCALE_FORMAT_CR8YB8CB8YA8 5
352 
353 #define GCM_TRANSFER_SCALE_FORMAT_YB8CR8YA8CB8 6
354 
355 #define GCM_TRANSFER_SCALE_FORMAT_R5G6B5 7
356 
357 #define GCM_TRANSFER_SCALE_FORMAT_Y8 8
358 
359 #define GCM_TRANSFER_SCALE_FORMAT_AY8 9
360 
361 #define GCM_TRANSFER_SCALE_FORMAT_EYB8ECR8EYA8ECB8 0xa
362 
363 #define GCM_TRANSFER_SCALE_FORMAT_ECR8EYB8ECB8EYA8 0xb
364 
365 #define GCM_TRANSFER_SCALE_FORMAT_A8B8G8R8 0xc
366 
367 #define GCM_TRANSFER_SCALE_FORMAT_X8B8G8R8 0xd
368 
370 #define GCM_TRANSFER_OPERATION_SRCCOPY_AND 0
371 
372 #define GCM_TRANSFER_OPERATION_ROP_AND 1
373 
374 #define GCM_TRANSFER_OPERATION_BLEND_AND 2
375 
376 #define GCM_TRANSFER_OPERATION_SRCCOPY 3
377 
378 #define GCM_TRANSFER_OPERATION_SRCCOPY_PREMULT 4
379 
380 #define GCM_TRANSFER_OPERATION_BLEND_PREMULT 5
381 
383 #define GCM_TRANSFER_ORIGIN_CENTER 1
384 
385 #define GCM_TRANSFER_ORIGIN_CORNER 2
386 
388 #define GCM_TRANSFER_INTERPOLATOR_NEAREST 0
389 
390 #define GCM_TRANSFER_INTERPOLATOR_LINEAR 1
391 
393 #define GCM_TRANSFER_SURFACE_FORMAT_R5G6B5 4
394 
395 #define GCM_TRANSFER_SURFACE_FORMAT_A8R8G8B8 0xa
396 
397 #define GCM_TRANSFER_SURFACE_FORMAT_Y32 0xb
398 
399 #ifdef __cplusplus
400 extern "C" {
401 #endif
402 
403 struct _gcmCtxData;
404 typedef s32 (*gcmContextCallback)(struct _gcmCtxData *context,u32 count);
405 
406 /* START OF STRUCTS */
407 
412 typedef struct _gcmCtxData
413 {
414  u32 *__restrict begin ATTRIBUTE_PRXPTR;
415  u32 *__restrict end ATTRIBUTE_PRXPTR;
416  u32 *__restrict current ATTRIBUTE_PRXPTR;
417  gcmContextCallback callback ATTRIBUTE_PRXPTR;
419 
424 typedef struct _gcmCtrlRegister
425 {
426  vu32 put;
427  vu32 get;
428  vu32 ref;
430 
435 typedef struct _gcmCfg
436 {
437  void *localAddress ATTRIBUTE_PRXPTR;
438  void *ioAddress ATTRIBUTE_PRXPTR;
439  u32 localSize;
440  u32 ioSize;
442  u32 coreFreq;
444 
449 typedef struct _gcmSurface
450 {
457  u8 type;
458 
465 
472 
484 
494 
501 
508 
516 
524 
526  u8 _pad[2];
527 
533 
536 
538  u16 width;
539 
541  u16 height;
542 
544  u16 x;
545 
547  u16 y;
548 } gcmSurface;
549 
551 typedef struct _gcmTexture
552 {
569  u8 format;
570 
577  u8 mipmap;
578 
587 
595 
616  u32 remap;
617 
619  u16 width;
621  u16 height;
623  u16 depth;
631  u8 _pad;
633  u32 pitch;
635  u32 offset;
636 } gcmTexture;
637 
639 typedef struct _gcmTransferScale
640 {
649 
667  u32 format;
668 
680 
682  s16 clipX;
683 
685  s16 clipY;
686 
688  u16 clipW;
689 
691  u16 clipH;
692 
694  s16 outX;
695 
697  s16 outY;
698 
700  u16 outW;
701 
703  u16 outH;
704 
706  s32 ratioX;
707 
709  s32 ratioY;
710 
712  u16 inW;
713 
715  u16 inH;
716 
718  u16 pitch;
719 
726  u8 origin;
727 
734  u8 interp;
735 
738  u32 offset;
739 
742  u16 inX;
743 
746  u16 inY;
748 
750 typedef struct _gcmTransferSurface
751 {
757  u32 format;
758 
760  u16 pitch;
761 
763  u8 _pad0[2];
764 
766  u32 offset;
768 
769 typedef struct _gcmTransferSwizzle
770 {
771  u16 format;
772  u8 width;
773  u8 height;
774  u32 offset;
776 
777 typedef struct _gcmTileInfo
778 {
779  u32 tile;
780  u32 limit;
781  u32 pitch;
782  u32 format;
783 } gcmTileInfo;
784 
785 typedef struct _gcmZcullInfo
786 {
787  u32 region;
788  u32 size;
789  u32 start;
790  u32 offset;
791  u32 stat0;
792  u32 stat1;
793 } gcmZcullInfo;
794 
796 typedef struct _gcmDisplayInfo
797 {
799  u32 offset;
801  u32 pitch;
803  u32 width;
805  u32 height;
806 
808 
809 typedef struct _gcmOffsetTable
810 {
811  u16 *io; /* ea -> io */
812  u16 *ea; /* io -> ea */
814 
815 typedef struct _gcmCast
816 {
817  u32 u;
818  float f;
819 } gcmCast;
820 
821 typedef struct _reportData
822 {
823  u64 timer;
824  u32 value;
825  u32 zero;
826 } gcmReportData;
827 
828 typedef struct _notifyData
829 {
830  u64 timer;
831  u64 zero;
832 } gcmNotifyData;
833 
834 /* END STRUCTS */
835 
836 /*
837  * system functions
838  */
839 
847 s32 gcmInitBody(gcmContextData* ATTRIBUTE_PRXPTR *ctx,const u32 cmdSize,const u32 ioSize,const void *ioAddress);
848 
854 s32 gcmAddressToOffset(void *address,u32 *offset);
855 
862 s32 gcmMapMainMemory(const void *address,const u32 size,u32 *offset);
863 
869 
875 s32 gcmIoOffsetToAddress(u32 offset,u32 *address);
876 
877 
878 /*
879  * display functions
880  */
881 
890 s32 gcmSetDisplayBuffer(u32 bufferId,u32 offset,u32 pitch,u32 width,u32 height);
891 
898 void gcmSetFlipMode(s32 mode);
899 
901 void gcmResetFlipStatus();
902 
907 s32 gcmGetFlipStatus();
908 
915 s32 gcmSetFlip(gcmContextData *context,u32 bufferId);
916 
920 void gcmSetWaitFlip(gcmContextData *context);
921 
922 
923 /*
924  * render functions
925  */
926 
931 u32* gcmGetLabelAddress(const u8 index);
932 
933 
934 /* previously missing / new additions */
935 
936 /*
937  * system functions
938  */
939 s32 gcmInitSystemMode(const u64 mode);
940 gcmControlRegister* gcmGetControlRegister();
941 u32 gcmGetTiledPitchSize(const u32 size);
942 void gcmSetVBlankHandler(void (*handler)(const u32 head));
943 void gcmSetSecondVHandler(void (*handler)(const u32 head));
944 void gcmSetGraphicsHandler(void (*handler)(const u32 val));
945 void gcmSetFlipHandler(void (*handler)(const u32 head));
946 void gcmSetQueueHandler(void (*handler)(const u32 head));
947 void gcmSetUserHandler(void (*handler)(const u32 cause));
948 void gcmSetDebugOutputLevel(s32 level);
949 void gcmGetOffsetTable(gcmOffsetTable *table);
950 s32 gcmSortRemapEaIoAddress();
951 s32 gcmMapEaIoAddress(const void *ea, const u32 io, const u32 size);
952 s32 gcmUnmapIoAddress(const u32 io);
953 s32 gcmUnmapEaIoAddress(const void *ea);
954 s32 gcmMapEaIoAddressWithFlags(const void *ea, const u32 io, const u32 size, u32 userflags);
955 s32 gcmMapLocalMemory(void **address, u32 *size);
956 u32 gcmGetMaxIoMapSize();
957 s32 gcmReserveIoMapSize(const u32 size);
958 s32 gcmUnreserveIoMapSize(const u32 size);
959 
960 /*
961  * display functions
962  */
963 s64 gcmGetLastFlipTime();
964 s32 gcmSetFlipImmediate(const u8 id);
965 void gcmSetFlipStatus();
966 void gcmSetSecondVFrequency(const u32 freq);
967 s32 gcmGetDisplayBufferByFlipIndex(const u32 qid);
968 u64 gcmGetVBlankCount();
969 s64 gcmGetLastSecondVTime();
970 u32 gcmGetCurrentField();
971 void gcmSetVBlankFrequency(const u32 freq);
972 s32 gcmGetCurrentDisplayBufferId(u8 *id);
973 
974 
975 /*
976  * hwcursor functions
977  */
978 s32 gcmInitCursor();
979 s32 gcmSetCursorEnable();
980 s32 gcmSetCursorDisable();
981 s32 gcmSetCursorImageOffset(const u32 offset);
982 s32 gcmSetCursorPosition(const s32 x, const s32 y);
983 s32 gcmUpdateCursor();
984 
985 
986 /*
987  * flow control functions
988  */
989 /* TODO: uint32_t *cellGcmGetCurrentBuffer(void); */
990 void cellGcmSetCurrentBuffer(const uint32_t *addr, const size_t size);
991 void gcmSetDefaultCommandBuffer();
992 /* TODO: void cellGcmSetUserCallback(CellGcmContextCallback callback); */
993 /* TODO: void cellGcmSetupContextData(CellGcmContextData *context, const uint32_t *addr, const uint32_t size, CellGcmContextCallback callback); */
994 s32 gcmSetDefaultCommandBufferAndSegmentWordSize(const u32 bufferSize, const u32 segmentSize);
995 u32 gcmGetDefaultCommandWordSize();
996 u32 gcmGetDefaultSegmentWordSize();
997 s32 gcmInitDefaultFifoMode(s32 mode);
998 s32 gcmSetDefaultFifoSize(const u32 bufferSize, const u32 segmentSize);
999 
1000 /*
1001  * render functions
1002  */
1003 u64 gcmGetTimeStamp(const u32 index);
1004 u32 gcmGetReport(const u32 type, const u32 index);
1005 void gcmSetTile(const u8 index, const u8 location, const u32 offset, const u32 size, const u32 pitch, const u8 comp, const u16 base, const u8 bank);
1006 void gcmSetInvalidateTile(const u8 index);
1007 void gcmSetZcull(const u8 index, const u32 offset, const u32 width, const u32 height, const u32 cullStart, const u32 zFormat, const u32 aaFormat, const u32 zCullDir, const u32 zCullFormat, const u32 sFunc, const u32 sRef, const u32 sMask);
1008 s32 gcmSetTileInfo(const u8 index, const u8 location, const u32 offset, const u32 size, const u32 pitch, const u8 comp, const u16 base, const u8 bank);
1009 s32 gcmBindTile(const u8 index);
1010 s32 gcmUnbindTile(const u8 index);
1011 s32 gcmBindZcull(const u8 index, const u32 offset, const u32 width, const u32 height, const u32 cullStart, const u32 zFormat, const u32 aaFormat, const u32 zCullDir, const u32 zCullFormat, const u32 sFunc, const u32 sRef, const u32 sMask);
1012 s32 gcmUnbindZcull(const u8 index);
1013 gcmReportData* gcmGetReportDataAddress(const u32 index);
1014 
1015 
1016 /*
1017  * report functions
1018  */
1019 gcmReportData* gcmGetReportDataAddressLocation(const u32 index, const u32 location);
1020 u64 gcmGetTimeStampLocation(const u32 index, const u32 location);
1021 u32 gcmGetReportDataLocation(const u32 index, const u32 location);
1022 
1023 
1024 /*
1025  * data xfer / format conversion functions
1026  */
1027 /* TODO: void cellGcmConvertSwizzleFormat(void *swizzledTexture, const void *texture, const uint32_t dstx0, const uint32_t dsty0, const uint32_t dstz0, const uint32_t dstWidth, const uint32_t dstHeight, const uint32_t dstDepth, const uint32_t srcx0, const uint32_t srcy0, const uint32_t srcz0, const uint32_t srcx1, const uint32_t srcy1, const uint32_t srcz1, const uint32_t srcWidth, const uint32_t srcHeight, const uint32_t srcDepth, const uint32_t dstLog2cdepth, const uint32_t srcColordepth, const uint32_t border, const uint32_t dim, void (*copyTexel)(void *dst, const void *src)); */
1028 
1029 
1030 /*
1031  * notify functions
1032  */
1033 gcmNotifyData* gcmGetNotifyDataAddress(const u32 index);
1034 
1035 
1036 /*
1037  * tile / zcull / display functions
1038  */
1039 const gcmTileInfo* gcmGetTileInfo();
1040 const gcmZcullInfo* gcmGetZcullInfo();
1041 const gcmDisplayInfo* gcmGetDisplayInfo();
1042 
1043 /*
1044  * debug functions
1045  */
1046 s32 gcmDumpGraphicsError();
1047 
1048 
1049 /* TODO: CELL_GCM_DECL CELL_GCM_FUNC_TYPE CELL_GCM_FUNC(SetUserCommand)(CELL_GCM_ARGS(const u32 cause)); */
1050 /* inline __attribute__((always_inline)) void gcmSetUserCommand(void (*handler)(const u32 cause)); */
1051 void gcmSetUserCommand(void (*handler)(const u32 cause));
1052 /* TODO: CELL_GCM_GLOBAL_DECL CELL_GCM_FUNC_TYPE_UINT32 CELL_GCM_FUNC(SetPrepareFlip)(CELL_GCM_ARGS(const u8 id)) */
1053 /* inline __attribute__((always_inline)) u32 gcmSetPrepareFlip(const u8 id); */
1054 u32 gcmSetPrepareFlip(const u8 id);
1055 
1056 /* TODO: gcmTerminate() no prototype */
1057 /* TODO: gcmFunc1 no prototype */
1058 /* TODO: gcmFunc2 no prototype */
1059 /* TODO: gcmFunc3 no prototype */
1060 /* TODO: gcmFunc4 no prototype */
1061 /* TODO: gcmFunc12 no prototype */
1062 /* TODO: gcmFunc13 no prototype */
1063 /* TODO: gcmFunc15 no prototype */
1064 /* TODO: gcmFunc38 no prototype */
1065 
1066 
1067 #ifdef __cplusplus
1068  }
1069 #endif
1070 
1071 #endif
1072 
void *ioAddress ATTRIBUTE_PRXPTR
effective start address of I/O mapped main memory to be used by RSX
Definition: gcm_sys.h:438
void *localAddress ATTRIBUTE_PRXPTR
effective start address of RSX memory
Definition: gcm_sys.h:437
s16 outY
Y origin of destination rectangle.
Definition: gcm_sys.h:697
#define GCM_MAX_MRT_COUNT
maximum count of multiple render targets
Definition: gcm_sys.h:23
u32 width
Width for display (in pixels)
Definition: gcm_sys.h:803
u32 *__restrict current ATTRIBUTE_PRXPTR
Current address of command buffer.
Definition: gcm_sys.h:416
Definition: gcm_sys.h:769
u8 colorTarget
Target of the color buffer.
Definition: gcm_sys.h:483
vu32 ref
member for accessing the REF register. Initial value is 0xFFFFFFFF
Definition: gcm_sys.h:428
u32 coreFreq
Core clock frequency of RSX.
Definition: gcm_sys.h:442
u32 pitch
Size of a texture line in bytes.
Definition: gcm_sys.h:633
struct _gcmTransferScale gcmTransferScale
Specify scaled image blit geometry and format for rsxSetTransferScaleSurface().
RSX target surface data structure.
Definition: gcm_sys.h:449
u16 depth
Texture depth.
Definition: gcm_sys.h:623
u8 _pad0[2]
unused padding bytes. most be 0.
Definition: gcm_sys.h:763
Definition: gcm_sys.h:777
u8 location
Location of texture. Possible values are:
Definition: gcm_sys.h:629
struct _gcmTexture gcmTexture
RSX Texture data structure.
Definition: gcm_sys.h:821
u8 colorFormat
Format of the color buffer.
Definition: gcm_sys.h:471
Definition: gcm_sys.h:785
s32 ratioX
Ratio in X direction of the source rectangle size to the destination rectangle size,...
Definition: gcm_sys.h:706
s32 gcmMapMainMemory(const void *address, const u32 size, u32 *offset)
Maps a memory block in main memory for RSX to access it.
vu32 put
member for accessing the PUT register
Definition: gcm_sys.h:426
s32 ratioY
Ratio in Y direction of the source rectangle size to the destination rectangle size,...
Definition: gcm_sys.h:709
u8 dimension
Texture dimension.
Definition: gcm_sys.h:586
u16 y
Window offset in y direction (0 - 4095).
Definition: gcm_sys.h:547
s32 gcmGetFlipStatus()
Gets the flip status. Once a flip occurred, querying for a subsequent flip requires the flip status t...
u16 inH
Height of the source rectangle.
Definition: gcm_sys.h:715
void gcmSetWaitFlip(gcmContextData *context)
Wait for a flip to be completed.
u8 origin
How the origin of each pixel is determined.
Definition: gcm_sys.h:726
u8 _pad[2]
unused padding bytes. most be 0.
Definition: gcm_sys.h:526
u8 mipmap
Indicates if this is a mip-mapped texture.
Definition: gcm_sys.h:577
u8 format
Texture format.
Definition: gcm_sys.h:569
void gcmResetFlipStatus()
Reset the flip status.
struct _gcmTransferSurface gcmTransferSurface
Specify destination surface characteristics for rsxSetTransferScaleSurface().
Specify destination surface characteristics for rsxSetTransferScaleSurface().
Definition: gcm_sys.h:750
u32 format
Format of destination surface. Possible values are:
Definition: gcm_sys.h:757
Specify scaled image blit geometry and format for rsxSetTransferScaleSurface().
Definition: gcm_sys.h:639
u8 depthFormat
Format of the depth buffer.
Definition: gcm_sys.h:515
RSX control data structure.
Definition: gcm_sys.h:424
u8 type
Type of render target.
Definition: gcm_sys.h:457
u32 * gcmGetLabelAddress(const u8 index)
Get address of specified label.
u16 outH
Height of the destination rectangle.
Definition: gcm_sys.h:703
u32 *__restrict end ATTRIBUTE_PRXPTR
End address of command buffer.
Definition: gcm_sys.h:415
Definition: gcm_sys.h:815
u32 format
Format of source image pixels.
Definition: gcm_sys.h:667
u16 x
Window offset in x direction (0 - 4095).
Definition: gcm_sys.h:544
Definition: gcm_sys.h:809
s32 gcmSetDisplayBuffer(u32 bufferId, u32 offset, u32 pitch, u32 width, u32 height)
Configures a display framebuffer.
u32 colorOffset[GCM_MAX_MRT_COUNT]
Offset from the base address of the color buffer.
Definition: gcm_sys.h:500
u8 _pad
unused padding byte.
Definition: gcm_sys.h:631
RSX Configuration structure.
Definition: gcm_sys.h:435
u8 depthLocation
Location of the depth buffer.
Definition: gcm_sys.h:523
Definition: gcm_sys.h:828
u32 remap
Color remapping bitfield.
Definition: gcm_sys.h:616
vu32 get
member for accessing the GET register
Definition: gcm_sys.h:427
u32 ioSize
maximum available size of I/O mapped main memory to be used by RSX
Definition: gcm_sys.h:440
u16 inX
X origin of the blit rectangle in the source image. Format is 16-bit fixed point, see rsxGetFixedUint...
Definition: gcm_sys.h:742
u32 offset
Destination suface memory offset, e.g., a value returned by gcmAddressToOffset() or gcmMapMainMemory(...
Definition: gcm_sys.h:766
u32 memoryFreq
RSX memory clock frequency.
Definition: gcm_sys.h:441
u8 interp
Sampling for scaled blits.
Definition: gcm_sys.h:734
struct _gcmCtxData gcmContextData
RSX Context data structure.
u32 *__restrict begin ATTRIBUTE_PRXPTR
Start address of command buffer.
Definition: gcm_sys.h:414
u16 inW
Width of the source rectangle.
Definition: gcm_sys.h:712
u16 height
Height of the render buffer (1 - 4096).
Definition: gcm_sys.h:541
void gcmSetFlipMode(s32 mode)
Set flip mode.
struct _gcmCfg gcmConfiguration
RSX Configuration structure.
u32 depthOffset
Offset from the base address of the depth buffer.
Definition: gcm_sys.h:532
s16 outX
X origin of destination rectangle.
Definition: gcm_sys.h:694
u32 operation
Blit operation.
Definition: gcm_sys.h:679
RSX Context data structure.
Definition: gcm_sys.h:412
s16 clipY
Y origin of clipping rectangle, within the destination surface.
Definition: gcm_sys.h:685
s32 gcmSetFlip(gcmContextData *context, u32 bufferId)
Enqueues a flip command into the command buffer.
u16 outW
Width of the destination rectangle.
Definition: gcm_sys.h:700
u32 depthPitch
Size of a depth buffer line in bytes.
Definition: gcm_sys.h:535
struct _gcmDisplayInfo gcmDisplayInfo
Display information.
u16 clipH
Height of clipping rectangle, within the destination surface.
Definition: gcm_sys.h:691
RSX Texture data structure.
Definition: gcm_sys.h:551
struct _gcmSurface gcmSurface
RSX target surface data structure.
u16 height
Texture height in pixels.
Definition: gcm_sys.h:621
s32 gcmInitBody(gcmContextData *ATTRIBUTE_PRXPTR *ctx, const u32 cmdSize, const u32 ioSize, const void *ioAddress)
Initialize the RSX context.
u8 cubemap
Indicates if this is a cube-mapped texture.
Definition: gcm_sys.h:594
u8 colorLocation[GCM_MAX_MRT_COUNT]
Location of the color buffer.
Definition: gcm_sys.h:493
u16 pitch
Pitch size, in bytes, of the source image data (width multiplied by the number of bytes in each pixel...
Definition: gcm_sys.h:718
u32 conversion
Conversion to perform when converting pixels to lower bit precision.
Definition: gcm_sys.h:648
u32 height
Height for display (in pixels)
Definition: gcm_sys.h:805
s32 gcmAddressToOffset(void *address, u32 *offset)
Converts an effective address in RSX memory to an offset.
s16 clipX
X origin of clipping rectangle, within the destination surface.
Definition: gcm_sys.h:682
s32 gcmIoOffsetToAddress(u32 offset, u32 *address)
Converts an offset to an effective address in RSX memory.
u16 width
Width of the render buffer (1 - 4096).
Definition: gcm_sys.h:538
u32 offset
Offset of texture data.
Definition: gcm_sys.h:635
u32 offset
Image data offset, e.g., a value returned by gcmAddressToOffset() or gcmMapMainMemory().
Definition: gcm_sys.h:738
u32 localSize
maximum available size of RSX memory
Definition: gcm_sys.h:439
u16 clipW
Width of clipping rectangle, within the destination surface.
Definition: gcm_sys.h:688
u8 antiAlias
Antialiasing format type.
Definition: gcm_sys.h:464
u16 inY
Y origin of the blit rectangle in the source image. Format is 16-bit fixed point, see rsxGetFixedUint...
Definition: gcm_sys.h:746
Display information.
Definition: gcm_sys.h:796
struct _gcmCtrlRegister gcmControlRegister
RSX control data structure.
u16 width
Texture width in pixels.
Definition: gcm_sys.h:619
u16 pitch
Pitch for destination surface (width multipied by the number of bytes per pixel).
Definition: gcm_sys.h:760
u32 colorPitch[GCM_MAX_MRT_COUNT]
Size of a color buffer line in bytes.
Definition: gcm_sys.h:507
u32 pitch
Pitch for display (width multipied by the number of bytes per pixel).
Definition: gcm_sys.h:801
s32 gcmGetConfiguration(gcmConfiguration *config)
Retrieves the RSX configuration.