RetroArch
gx.h
Go to the documentation of this file.
1 #ifndef __GX_H__
2 #define __GX_H__
3 
10 #include <gctypes.h>
11 #include "lwp.h"
12 #include "gx_struct.h"
13 #include "gu.h"
14 
15 #define GX_FALSE 0
16 #define GX_TRUE 1
17 #define GX_DISABLE 0
18 #define GX_ENABLE 1
19 
23 #define GX_CLIP_DISABLE 1
24 #define GX_CLIP_ENABLE 0
25 
27 #define GX_FIFO_MINSIZE (64*1024)
28 #define GX_FIFO_HIWATERMARK (16*1024)
29 #define GX_FIFO_OBJSIZE 128
30 
31 #define GX_PERSPECTIVE 0
32 #define GX_ORTHOGRAPHIC 1
33 
34 #define GX_MT_NULL 0
35 #define GX_MT_XF_FLUSH 1
36 #define GX_MT_DL_SAVE_CTX 2
37 
38 #define GX_XF_FLUSH_NONE 0
39 #define GX_XF_FLUSH_SAFE 1
40 
44 #define GX_COLOR0 0
45 #define GX_COLOR1 1
46 #define GX_ALPHA0 2
47 #define GX_ALPHA1 3
48 #define GX_COLOR0A0 4
49 #define GX_COLOR1A1 5
50 #define GX_COLORZERO 6
51 #define GX_ALPHA_BUMP 7
52 #define GX_ALPHA_BUMPN 8
53 #define GX_COLORNULL 0xff
54 
59 #define GX_MTX2x4 0
60 #define GX_MTX3x4 1
61 
66 #define GX_VTXFMT0 0
67 #define GX_VTXFMT1 1
68 #define GX_VTXFMT2 2
69 #define GX_VTXFMT3 3
70 #define GX_VTXFMT4 4
71 #define GX_VTXFMT5 5
72 #define GX_VTXFMT6 6
73 #define GX_VTXFMT7 7
74 #define GX_MAXVTXFMT 8
75 
82 #define GX_NONE 0
83 #define GX_DIRECT 1
84 #define GX_INDEX8 2
85 #define GX_INDEX16 3
93 #define GX_U8 0
94 #define GX_S8 1
95 #define GX_U16 2
96 #define GX_S16 3
97 #define GX_F32 4
98 #define GX_RGB565 0
99 #define GX_RGB8 1
100 #define GX_RGBX8 2
101 #define GX_RGBA4 3
102 #define GX_RGBA6 4
103 #define GX_RGBA8 5
109 #define GX_POS_XY 0
110 #define GX_POS_XYZ 1
111 #define GX_NRM_XYZ 0
112 #define GX_NRM_NBT 1
113 #define GX_NRM_NBT3 2
114 #define GX_CLR_RGB 0
115 #define GX_CLR_RGBA 1
116 #define GX_TEX_S 0
117 #define GX_TEX_ST 1
123 #define GX_VA_PTNMTXIDX 0
124 #define GX_VA_TEX0MTXIDX 1
125 #define GX_VA_TEX1MTXIDX 2
126 #define GX_VA_TEX2MTXIDX 3
127 #define GX_VA_TEX3MTXIDX 4
128 #define GX_VA_TEX4MTXIDX 5
129 #define GX_VA_TEX5MTXIDX 6
130 #define GX_VA_TEX6MTXIDX 7
131 #define GX_VA_TEX7MTXIDX 8
132 #define GX_VA_POS 9
133 #define GX_VA_NRM 10
134 #define GX_VA_CLR0 11
135 #define GX_VA_CLR1 12
136 #define GX_VA_TEX0 13
137 #define GX_VA_TEX1 14
138 #define GX_VA_TEX2 15
139 #define GX_VA_TEX3 16
140 #define GX_VA_TEX4 17
141 #define GX_VA_TEX5 18
142 #define GX_VA_TEX6 19
143 #define GX_VA_TEX7 20
144 #define GX_POSMTXARRAY 21
145 #define GX_NRMMTXARRAY 22
146 #define GX_TEXMTXARRAY 23
147 #define GX_LIGHTARRAY 24
148 #define GX_VA_NBT 25
149 #define GX_VA_MAXATTR 26
150 #define GX_VA_NULL 0xff
151 
159 #define GX_POINTS 0xB8
160 #define GX_LINES 0xA8
161 #define GX_LINESTRIP 0xB0
162 #define GX_TRIANGLES 0x90
163 #define GX_TRIANGLESTRIP 0x98
165 #define GX_TRIANGLEFAN 0xA0
168 #define GX_QUADS 0x80
172 #define GX_SRC_REG 0
173 #define GX_SRC_VTX 1
174 
178 #define GX_LIGHT0 0x001
179 #define GX_LIGHT1 0x002
180 #define GX_LIGHT2 0x004
181 #define GX_LIGHT3 0x008
182 #define GX_LIGHT4 0x010
183 #define GX_LIGHT5 0x020
184 #define GX_LIGHT6 0x040
185 #define GX_LIGHT7 0x080
186 #define GX_MAXLIGHT 0x100
187 #define GX_LIGHTNULL 0x000
193 #define GX_DF_NONE 0
194 #define GX_DF_SIGNED 1
195 #define GX_DF_CLAMP 2
196 
201 #define GX_AF_SPEC 0
202 #define GX_AF_SPOT 1
203 #define GX_AF_NONE 2
206 /* pos,nrm,tex,dtt matrix */
210 #define GX_PNMTX0 0
211 #define GX_PNMTX1 3
212 #define GX_PNMTX2 6
213 #define GX_PNMTX3 9
214 #define GX_PNMTX4 12
215 #define GX_PNMTX5 15
216 #define GX_PNMTX6 18
217 #define GX_PNMTX7 21
218 #define GX_PNMTX8 24
219 #define GX_PNMTX9 27
225 #define GX_TEXMTX0 30
226 #define GX_TEXMTX1 33
227 #define GX_TEXMTX2 36
228 #define GX_TEXMTX3 39
229 #define GX_TEXMTX4 42
230 #define GX_TEXMTX5 45
231 #define GX_TEXMTX6 48
232 #define GX_TEXMTX7 51
233 #define GX_TEXMTX8 54
234 #define GX_TEXMTX9 57
235 #define GX_IDENTITY 60
241 #define GX_DTTMTX0 64
242 #define GX_DTTMTX1 67
243 #define GX_DTTMTX2 70
244 #define GX_DTTMTX3 73
245 #define GX_DTTMTX4 76
246 #define GX_DTTMTX5 79
247 #define GX_DTTMTX6 82
248 #define GX_DTTMTX7 85
249 #define GX_DTTMTX8 88
250 #define GX_DTTMTX9 91
251 #define GX_DTTMTX10 94
252 #define GX_DTTMTX11 97
253 #define GX_DTTMTX12 100
254 #define GX_DTTMTX13 103
255 #define GX_DTTMTX14 106
256 #define GX_DTTMTX15 109
257 #define GX_DTTMTX16 112
258 #define GX_DTTMTX17 115
259 #define GX_DTTMTX18 118
260 #define GX_DTTMTX19 121
261 #define GX_DTTIDENTITY 125
264 /* tex coord id
265  used by: XF: 0x1040,0x1050
266  BP: 0x30
267 */
271 #define GX_TEXCOORD0 0x0
272 #define GX_TEXCOORD1 0x1
273 #define GX_TEXCOORD2 0x2
274 #define GX_TEXCOORD3 0x3
275 #define GX_TEXCOORD4 0x4
276 #define GX_TEXCOORD5 0x5
277 #define GX_TEXCOORD6 0x6
278 #define GX_TEXCOORD7 0x7
279 #define GX_MAXCOORD 0x8
280 #define GX_TEXCOORDNULL 0xff
283 /* tex format */
284 #define _GX_TF_ZTF 0x10
285 #define _GX_TF_CTF 0x20
286 
291 #define GX_TF_I4 0x0
292 #define GX_TF_I8 0x1
293 #define GX_TF_IA4 0x2
294 #define GX_TF_IA8 0x3
295 #define GX_TF_RGB565 0x4
296 #define GX_TF_RGB5A3 0x5
297 #define GX_TF_RGBA8 0x6
298 #define GX_TF_CI4 0x8
299 #define GX_TF_CI8 0x9
300 #define GX_TF_CI14 0xa
301 #define GX_TF_CMPR 0xE
303 #define GX_TL_IA8 0x00
304 #define GX_TL_RGB565 0x01
305 #define GX_TL_RGB5A3 0x02
306 
307 #define GX_CTF_R4 (0x0|_GX_TF_CTF)
308 #define GX_CTF_RA4 (0x2|_GX_TF_CTF)
309 #define GX_CTF_RA8 (0x3|_GX_TF_CTF)
310 #define GX_CTF_YUVA8 (0x6|_GX_TF_CTF)
311 #define GX_CTF_A8 (0x7|_GX_TF_CTF)
312 #define GX_CTF_R8 (0x8|_GX_TF_CTF)
313 #define GX_CTF_G8 (0x9|_GX_TF_CTF)
314 #define GX_CTF_B8 (0xA|_GX_TF_CTF)
315 #define GX_CTF_RG8 (0xB|_GX_TF_CTF)
316 #define GX_CTF_GB8 (0xC|_GX_TF_CTF)
322 #define GX_TF_Z8 (0x1|_GX_TF_ZTF)
323 #define GX_TF_Z16 (0x3|_GX_TF_ZTF)
324 #define GX_TF_Z24X8 (0x6|_GX_TF_ZTF)
328 #define GX_CTF_Z4 (0x0|_GX_TF_ZTF|_GX_TF_CTF)
329 #define GX_CTF_Z8M (0x9|_GX_TF_ZTF|_GX_TF_CTF)
330 #define GX_CTF_Z8L (0xA|_GX_TF_ZTF|_GX_TF_CTF)
331 #define GX_CTF_Z16L (0xC|_GX_TF_ZTF|_GX_TF_CTF)
333 #define GX_TF_A8 GX_CTF_A8
337 /* gx tlut size */
338 #define GX_TLUT_16 1 // number of 16 entry blocks.
339 #define GX_TLUT_32 2
340 #define GX_TLUT_64 4
341 #define GX_TLUT_128 8
342 #define GX_TLUT_256 16
343 #define GX_TLUT_512 32
344 #define GX_TLUT_1K 64
345 #define GX_TLUT_2K 128
346 #define GX_TLUT_4K 256
347 #define GX_TLUT_8K 512
348 #define GX_TLUT_16K 1024
354 #define GX_ZT_DISABLE 0
355 #define GX_ZT_ADD 1
356 #define GX_ZT_REPLACE 2
357 #define GX_MAX_ZTEXOP 3
365 #define GX_TG_MTX3x4 0
366 #define GX_TG_MTX2x4 1
368 #define GX_TG_BUMP0 2
369 #define GX_TG_BUMP1 3
370 #define GX_TG_BUMP2 4
371 #define GX_TG_BUMP3 5
372 #define GX_TG_BUMP4 6
373 #define GX_TG_BUMP5 7
374 #define GX_TG_BUMP6 8
375 #define GX_TG_BUMP7 9
376 #define GX_TG_SRTG 10
383 #define GX_TG_POS 0
384 #define GX_TG_NRM 1
385 #define GX_TG_BINRM 2
386 #define GX_TG_TANGENT 3
387 #define GX_TG_TEX0 4
388 #define GX_TG_TEX1 5
389 #define GX_TG_TEX2 6
390 #define GX_TG_TEX3 7
391 #define GX_TG_TEX4 8
392 #define GX_TG_TEX5 9
393 #define GX_TG_TEX6 10
394 #define GX_TG_TEX7 11
395 #define GX_TG_TEXCOORD0 12
396 #define GX_TG_TEXCOORD1 13
397 #define GX_TG_TEXCOORD2 14
398 #define GX_TG_TEXCOORD3 15
399 #define GX_TG_TEXCOORD4 16
400 #define GX_TG_TEXCOORD5 17
401 #define GX_TG_TEXCOORD6 18
402 #define GX_TG_COLOR0 19
403 #define GX_TG_COLOR1 20
409 #define GX_NEVER 0
410 #define GX_LESS 1
411 #define GX_EQUAL 2
412 #define GX_LEQUAL 3
413 #define GX_GREATER 4
414 #define GX_NEQUAL 5
415 #define GX_GEQUAL 6
416 #define GX_ALWAYS 7
419 /* Text Wrap Mode */
420 #define GX_CLAMP 0
421 #define GX_REPEAT 1
422 #define GX_MIRROR 2
423 #define GX_MAXTEXWRAPMODE 3
424 
428 #define GX_BM_NONE 0
429 #define GX_BM_BLEND 1
430 #define GX_BM_LOGIC 2
431 #define GX_BM_SUBTRACT 3
432 #define GX_MAX_BLENDMODE 4
433 
439 #define GX_BL_ZERO 0
440 #define GX_BL_ONE 1
441 #define GX_BL_SRCCLR 2
442 #define GX_BL_INVSRCCLR 3
443 #define GX_BL_SRCALPHA 4
444 #define GX_BL_INVSRCALPHA 5
445 #define GX_BL_DSTALPHA 6
446 #define GX_BL_INVDSTALPHA 7
447 #define GX_BL_DSTCLR GX_BL_SRCCLR
448 #define GX_BL_INVDSTCLR GX_BL_INVSRCCLR
455 #define GX_LO_CLEAR 0
456 #define GX_LO_AND 1
457 #define GX_LO_REVAND 2
458 #define GX_LO_COPY 3
459 #define GX_LO_INVAND 4
460 #define GX_LO_NOOP 5
461 #define GX_LO_XOR 6
462 #define GX_LO_OR 7
463 #define GX_LO_NOR 8
464 #define GX_LO_EQUIV 9
465 #define GX_LO_INV 10
466 #define GX_LO_REVOR 11
467 #define GX_LO_INVCOPY 12
468 #define GX_LO_INVOR 13
469 #define GX_LO_NAND 14
470 #define GX_LO_SET 15
477 #define GX_TO_ZERO 0
478 #define GX_TO_SIXTEENTH 1
479 #define GX_TO_EIGHTH 2
480 #define GX_TO_FOURTH 3
481 #define GX_TO_HALF 4
482 #define GX_TO_ONE 5
483 #define GX_MAX_TEXOFFSET 6
496 #define GX_MODULATE 0
497 #define GX_DECAL 1
498 #define GX_BLEND 2
499 #define GX_REPLACE 3
500 #define GX_PASSCLR 4
509 #define GX_CC_CPREV 0
510 #define GX_CC_APREV 1
511 #define GX_CC_C0 2
512 #define GX_CC_A0 3
513 #define GX_CC_C1 4
514 #define GX_CC_A1 5
515 #define GX_CC_C2 6
516 #define GX_CC_A2 7
517 #define GX_CC_TEXC 8
518 #define GX_CC_TEXA 9
519 #define GX_CC_RASC 10
520 #define GX_CC_RASA 11
521 #define GX_CC_ONE 12
522 #define GX_CC_HALF 13
523 #define GX_CC_KONST 14
524 #define GX_CC_ZERO 15
533 #define GX_CA_APREV 0
534 #define GX_CA_A0 1
535 #define GX_CA_A1 2
536 #define GX_CA_A2 3
537 #define GX_CA_TEXA 4
538 #define GX_CA_RASA 5
539 #define GX_CA_KONST 6
540 #define GX_CA_ZERO 7
553 #define GX_TEVSTAGE0 0
554 #define GX_TEVSTAGE1 1
555 #define GX_TEVSTAGE2 2
556 #define GX_TEVSTAGE3 3
557 #define GX_TEVSTAGE4 4
558 #define GX_TEVSTAGE5 5
559 #define GX_TEVSTAGE6 6
560 #define GX_TEVSTAGE7 7
561 #define GX_TEVSTAGE8 8
562 #define GX_TEVSTAGE9 9
563 #define GX_TEVSTAGE10 10
564 #define GX_TEVSTAGE11 11
565 #define GX_TEVSTAGE12 12
566 #define GX_TEVSTAGE13 13
567 #define GX_TEVSTAGE14 14
568 #define GX_TEVSTAGE15 15
569 #define GX_MAX_TEVSTAGE 16
578 #define GX_TEV_ADD 0
579 #define GX_TEV_SUB 1
580 #define GX_TEV_COMP_R8_GT 8
581 #define GX_TEV_COMP_R8_EQ 9
582 #define GX_TEV_COMP_GR16_GT 10
583 #define GX_TEV_COMP_GR16_EQ 11
584 #define GX_TEV_COMP_BGR24_GT 12
585 #define GX_TEV_COMP_BGR24_EQ 13
586 #define GX_TEV_COMP_RGB8_GT 14
587 #define GX_TEV_COMP_RGB8_EQ 15
588 #define GX_TEV_COMP_A8_GT GX_TEV_COMP_RGB8_GT // for alpha channel
589 #define GX_TEV_COMP_A8_EQ GX_TEV_COMP_RGB8_EQ // for alpha channel
598 #define GX_TB_ZERO 0
599 #define GX_TB_ADDHALF 1
600 #define GX_TB_SUBHALF 2
601 #define GX_MAX_TEVBIAS 3
602 
611 #define GX_TC_LINEAR 0
612 #define GX_TC_GE 1
613 #define GX_TC_EQ 2
614 #define GX_TC_LE 3
615 #define GX_MAX_TEVCLAMPMODE 4
616 
624 #define GX_CS_SCALE_1 0
625 #define GX_CS_SCALE_2 1
626 #define GX_CS_SCALE_4 2
627 #define GX_CS_DIVIDE_2 3
628 #define GX_MAX_TEVSCALE 4
629 
637 #define GX_TEVPREV 0
638 #define GX_TEVREG0 1
639 #define GX_TEVREG1 2
640 #define GX_TEVREG2 3
641 #define GX_MAX_TEVREG 4
642 
649 #define GX_CULL_NONE 0
650 #define GX_CULL_FRONT 1
651 #define GX_CULL_BACK 2
652 #define GX_CULL_ALL 3
665 #define GX_TEXMAP0 0
666 #define GX_TEXMAP1 1
667 #define GX_TEXMAP2 2
668 #define GX_TEXMAP3 3
669 #define GX_TEXMAP4 4
670 #define GX_TEXMAP5 5
671 #define GX_TEXMAP6 6
672 #define GX_TEXMAP7 7
673 #define GX_MAX_TEXMAP 8
674 #define GX_TEXMAP_NULL 0xff
675 #define GX_TEXMAP_DISABLE 0x100
681 #define GX_AOP_AND 0
682 #define GX_AOP_OR 1
683 #define GX_AOP_XOR 2
684 #define GX_AOP_XNOR 3
685 #define GX_MAX_ALPHAOP 4
686 
691 #define GX_KCOLOR0 0
692 #define GX_KCOLOR1 1
693 #define GX_KCOLOR2 2
694 #define GX_KCOLOR3 3
695 #define GX_KCOLOR_MAX 4
696 
701 #define GX_TEV_KCSEL_1 0x00
702 #define GX_TEV_KCSEL_7_8 0x01
703 #define GX_TEV_KCSEL_3_4 0x02
704 #define GX_TEV_KCSEL_5_8 0x03
705 #define GX_TEV_KCSEL_1_2 0x04
706 #define GX_TEV_KCSEL_3_8 0x05
707 #define GX_TEV_KCSEL_1_4 0x06
708 #define GX_TEV_KCSEL_1_8 0x07
709 #define GX_TEV_KCSEL_K0 0x0C
710 #define GX_TEV_KCSEL_K1 0x0D
711 #define GX_TEV_KCSEL_K2 0x0E
712 #define GX_TEV_KCSEL_K3 0x0F
713 #define GX_TEV_KCSEL_K0_R 0x10
714 #define GX_TEV_KCSEL_K1_R 0x11
715 #define GX_TEV_KCSEL_K2_R 0x12
716 #define GX_TEV_KCSEL_K3_R 0x13
717 #define GX_TEV_KCSEL_K0_G 0x14
718 #define GX_TEV_KCSEL_K1_G 0x15
719 #define GX_TEV_KCSEL_K2_G 0x16
720 #define GX_TEV_KCSEL_K3_G 0x17
721 #define GX_TEV_KCSEL_K0_B 0x18
722 #define GX_TEV_KCSEL_K1_B 0x19
723 #define GX_TEV_KCSEL_K2_B 0x1A
724 #define GX_TEV_KCSEL_K3_B 0x1B
725 #define GX_TEV_KCSEL_K0_A 0x1C
726 #define GX_TEV_KCSEL_K1_A 0x1D
727 #define GX_TEV_KCSEL_K2_A 0x1E
728 #define GX_TEV_KCSEL_K3_A 0x1F
734 #define GX_TEV_KASEL_1 0x00
735 #define GX_TEV_KASEL_7_8 0x01
736 #define GX_TEV_KASEL_3_4 0x02
737 #define GX_TEV_KASEL_5_8 0x03
738 #define GX_TEV_KASEL_1_2 0x04
739 #define GX_TEV_KASEL_3_8 0x05
740 #define GX_TEV_KASEL_1_4 0x06
741 #define GX_TEV_KASEL_1_8 0x07
742 #define GX_TEV_KASEL_K0_R 0x10
743 #define GX_TEV_KASEL_K1_R 0x11
744 #define GX_TEV_KASEL_K2_R 0x12
745 #define GX_TEV_KASEL_K3_R 0x13
746 #define GX_TEV_KASEL_K0_G 0x14
747 #define GX_TEV_KASEL_K1_G 0x15
748 #define GX_TEV_KASEL_K2_G 0x16
749 #define GX_TEV_KASEL_K3_G 0x17
750 #define GX_TEV_KASEL_K0_B 0x18
751 #define GX_TEV_KASEL_K1_B 0x19
752 #define GX_TEV_KASEL_K2_B 0x1A
753 #define GX_TEV_KASEL_K3_B 0x1B
754 #define GX_TEV_KASEL_K0_A 0x1C
755 #define GX_TEV_KASEL_K1_A 0x1D
756 #define GX_TEV_KASEL_K2_A 0x1E
757 #define GX_TEV_KASEL_K3_A 0x1F
765 #define GX_TEV_SWAP0 0
766 #define GX_TEV_SWAP1 1
767 #define GX_TEV_SWAP2 2
768 #define GX_TEV_SWAP3 3
769 #define GX_MAX_TEVSWAP 4
770 
774 /* tev color chan */
775 #define GX_CH_RED 0
776 #define GX_CH_GREEN 1
777 #define GX_CH_BLUE 2
778 #define GX_CH_ALPHA 3
779 
783 #define GX_INDTEXSTAGE0 0
784 #define GX_INDTEXSTAGE1 1
785 #define GX_INDTEXSTAGE2 2
786 #define GX_INDTEXSTAGE3 3
787 #define GX_MAX_INDTEXSTAGE 4
788 
795 #define GX_ITF_8 0
796 #define GX_ITF_5 1
797 #define GX_ITF_4 2
798 #define GX_ITF_3 3
799 #define GX_MAX_ITFORMAT 4
800 
808 #define GX_ITB_NONE 0
809 #define GX_ITB_S 1
810 #define GX_ITB_T 2
811 #define GX_ITB_ST 3
812 #define GX_ITB_U 4
813 #define GX_ITB_SU 5
814 #define GX_ITB_TU 6
815 #define GX_ITB_STU 7
816 #define GX_MAX_ITBIAS 8
822 #define GX_ITM_OFF 0
823 #define GX_ITM_0 1
824 #define GX_ITM_1 2
825 #define GX_ITM_2 3
826 #define GX_ITM_S0 5
827 #define GX_ITM_S1 6
828 #define GX_ITM_S2 7
829 #define GX_ITM_T0 9
830 #define GX_ITM_T1 10
831 #define GX_ITM_T2 11
840 #define GX_ITW_OFF 0
841 #define GX_ITW_256 1
842 #define GX_ITW_128 2
843 #define GX_ITW_64 3
844 #define GX_ITW_32 4
845 #define GX_ITW_16 5
846 #define GX_ITW_0 6
847 #define GX_MAX_ITWRAP 7
856 #define GX_ITBA_OFF 0
857 #define GX_ITBA_S 1
858 #define GX_ITBA_T 2
859 #define GX_ITBA_U 3
860 #define GX_MAX_ITBALPHA 4
861 
869 #define GX_ITS_1 0
870 #define GX_ITS_2 1
871 #define GX_ITS_4 2
872 #define GX_ITS_8 3
873 #define GX_ITS_16 4
874 #define GX_ITS_32 5
875 #define GX_ITS_64 6
876 #define GX_ITS_128 7
877 #define GX_ITS_256 8
878 #define GX_MAX_ITSCALE 9
884 #define GX_FOG_NONE 0
885 
886 #define GX_FOG_PERSP_LIN 2
887 #define GX_FOG_PERSP_EXP 4
888 #define GX_FOG_PERSP_EXP2 5
889 #define GX_FOG_PERSP_REVEXP 6
890 #define GX_FOG_PERSP_REVEXP2 7
891 
892 #define GX_FOG_ORTHO_LIN 10
893 #define GX_FOG_ORTHO_EXP 12
894 #define GX_FOG_ORTHO_EXP2 13
895 #define GX_FOG_ORTHO_REVEXP 14
896 #define GX_FOG_ORTHO_REVEXP2 15
897 
898 #define GX_FOG_LIN GX_FOG_PERSP_LIN
899 #define GX_FOG_EXP GX_FOG_PERSP_EXP
900 #define GX_FOG_EXP2 GX_FOG_PERSP_EXP2
901 #define GX_FOG_REVEXP GX_FOG_PERSP_REVEXP
902 #define GX_FOG_REVEXP2 GX_FOG_PERSP_REVEXP2
903 
906 /* pixel format */
907 #define GX_PF_RGB8_Z24 0
908 #define GX_PF_RGBA6_Z24 1
909 #define GX_PF_RGB565_Z16 2
910 #define GX_PF_Z24 3
911 #define GX_PF_Y8 4
912 #define GX_PF_U8 5
913 #define GX_PF_V8 6
914 #define GX_PF_YUV420 7
919 #define GX_ZC_LINEAR 0
920 #define GX_ZC_NEAR 1
921 #define GX_ZC_MID 2
922 #define GX_ZC_FAR 3
923 
929 #define GX_CLAMP_NONE 0
930 #define GX_CLAMP_TOP 1
931 #define GX_CLAMP_BOTTOM 2
932 
940 #define GX_GM_1_0 0
941 #define GX_GM_1_7 1
942 #define GX_GM_2_2 2
943 
951 #define GX_COPY_PROGRESSIVE 0
952 #define GX_COPY_INTLC_EVEN 2
953 #define GX_COPY_INTLC_ODD 3
954 
959 #define GX_READ_00 0
960 #define GX_READ_FF 1
961 #define GX_READ_NONE 2
968 #define GX_TEXCACHE_32K 0
969 #define GX_TEXCACHE_128K 1
970 #define GX_TEXCACHE_512K 2
971 #define GX_TEXCACHE_NONE 3
972 
978 #define GX_DA_OFF 0
979 #define GX_DA_GENTLE 1
980 #define GX_DA_MEDIUM 2
981 #define GX_DA_STEEP 3
982 
987 #define GX_SP_OFF 0
988 #define GX_SP_FLAT 1
989 #define GX_SP_COS 2
990 #define GX_SP_COS2 3
991 #define GX_SP_SHARP 4
992 #define GX_SP_RING1 5
993 #define GX_SP_RING2 6
999 #define GX_NEAR 0
1000 #define GX_LINEAR 1
1001 #define GX_NEAR_MIP_NEAR 2
1002 #define GX_LIN_MIP_NEAR 3
1003 #define GX_NEAR_MIP_LIN 4
1004 #define GX_LIN_MIP_LIN 5
1010 #define GX_ANISO_1 0
1011 #define GX_ANISO_2 1
1012 #define GX_ANISO_4 2
1013 #define GX_MAX_ANISOTROPY 3
1014 
1019 #define GX_VC_POS 0
1020 #define GX_VC_NRM 1
1021 #define GX_VC_CLR0 2
1022 #define GX_VC_CLR1 3
1023 #define GX_VC_TEX0 4
1024 #define GX_VC_TEX1 5
1025 #define GX_VC_TEX2 6
1026 #define GX_VC_TEX3 7
1027 #define GX_VC_TEX4 8
1028 #define GX_VC_TEX5 9
1029 #define GX_VC_TEX6 10
1030 #define GX_VC_TEX7 11
1031 #define GX_VC_ALL 15
1049 #define GX_PERF0_VERTICES 0
1050 #define GX_PERF0_CLIP_VTX 1
1051 #define GX_PERF0_CLIP_CLKS 2
1052 #define GX_PERF0_XF_WAIT_IN 3
1055 #define GX_PERF0_XF_WAIT_OUT 4
1057 #define GX_PERF0_XF_XFRM_CLKS 5
1058 #define GX_PERF0_XF_LIT_CLKS 6
1059 #define GX_PERF0_XF_BOT_CLKS 7
1060 #define GX_PERF0_XF_REGLD_CLKS 8
1061 #define GX_PERF0_XF_REGRD_CLKS 9
1062 #define GX_PERF0_CLIP_RATIO 10
1063 #define GX_PERF0_TRIANGLES 11
1064 #define GX_PERF0_TRIANGLES_CULLED 12
1065 #define GX_PERF0_TRIANGLES_PASSED 13
1066 #define GX_PERF0_TRIANGLES_SCISSORED 14
1067 #define GX_PERF0_TRIANGLES_0TEX 15
1068 #define GX_PERF0_TRIANGLES_1TEX 16
1069 #define GX_PERF0_TRIANGLES_2TEX 17
1070 #define GX_PERF0_TRIANGLES_3TEX 18
1071 #define GX_PERF0_TRIANGLES_4TEX 19
1072 #define GX_PERF0_TRIANGLES_5TEX 20
1073 #define GX_PERF0_TRIANGLES_6TEX 21
1074 #define GX_PERF0_TRIANGLES_7TEX 22
1075 #define GX_PERF0_TRIANGLES_8TEX 23
1076 #define GX_PERF0_TRIANGLES_0CLR 24
1077 #define GX_PERF0_TRIANGLES_1CLR 25
1078 #define GX_PERF0_TRIANGLES_2CLR 26
1079 #define GX_PERF0_QUAD_0CVG 27
1080 #define GX_PERF0_QUAD_NON0CVG 28
1081 #define GX_PERF0_QUAD_1CVG 29
1082 #define GX_PERF0_QUAD_2CVG 30
1083 #define GX_PERF0_QUAD_3CVG 31
1084 #define GX_PERF0_QUAD_4CVG 32
1085 #define GX_PERF0_AVG_QUAD_CNT 33
1086 #define GX_PERF0_CLOCKS 34
1087 #define GX_PERF0_NONE 35
1101 #define GX_PERF1_TEXELS 0
1102 #define GX_PERF1_TX_IDLE 1
1103 #define GX_PERF1_TX_REGS 2
1104 #define GX_PERF1_TX_MEMSTALL 3
1105 #define GX_PERF1_TC_CHECK1_2 4
1106 #define GX_PERF1_TC_CHECK3_4 5
1107 #define GX_PERF1_TC_CHECK5_6 6
1108 #define GX_PERF1_TC_CHECK7_8 7
1109 #define GX_PERF1_TC_MISS 8
1110 #define GX_PERF1_VC_ELEMQ_FULL 9
1111 #define GX_PERF1_VC_MISSQ_FULL 10
1112 #define GX_PERF1_VC_MEMREQ_FULL 11
1113 #define GX_PERF1_VC_STATUS7 12
1114 #define GX_PERF1_VC_MISSREP_FULL 13
1115 #define GX_PERF1_VC_STREAMBUF_LOW 14
1116 #define GX_PERF1_VC_ALL_STALLS 15
1117 #define GX_PERF1_VERTICES 16
1118 #define GX_PERF1_FIFO_REQ 17
1119 #define GX_PERF1_CALL_REQ 18
1120 #define GX_PERF1_VC_MISS_REQ 19
1121 #define GX_PERF1_CP_ALL_REQ 20
1123 #define GX_PERF1_CLOCKS 21
1124 #define GX_PERF1_NONE 22
1134 #define GX_TLUT0 0
1135 #define GX_TLUT1 1
1136 #define GX_TLUT2 2
1137 #define GX_TLUT3 3
1138 #define GX_TLUT4 4
1139 #define GX_TLUT5 5
1140 #define GX_TLUT6 6
1141 #define GX_TLUT7 7
1142 #define GX_TLUT8 8
1143 #define GX_TLUT9 9
1144 #define GX_TLUT10 10
1145 #define GX_TLUT11 11
1146 #define GX_TLUT12 12
1147 #define GX_TLUT13 13
1148 #define GX_TLUT14 14
1149 #define GX_TLUT15 15
1150 #define GX_BIGTLUT0 16
1151 #define GX_BIGTLUT1 17
1152 #define GX_BIGTLUT2 18
1153 #define GX_BIGTLUT3 19
1156 #define GX_MAX_VTXDESC GX_VA_MAXATTR
1157 #define GX_MAX_VTXDESC_LISTSIZE (GX_VA_MAXATTR+1)
1159 #define GX_MAX_VTXATTRFMT GX_VA_MAXATTR
1160 #define GX_MAX_VTXATTRFMT_LISTSIZE (GX_VA_MAXATTR+1)
1162 #define GX_MAX_Z24 0x00ffffff
1164 #ifdef __cplusplus
1165  extern "C" {
1166 #endif /* __cplusplus */
1168 typedef union _wgpipe
1171  vs8 S8;
1173  vs16 S16;
1174  vu32 U32;
1175  vs32 S32;
1176  vf32 F32;
1177 } WGPipe;
1182 typedef struct _gx_color {
1183  u8 r;
1184  u8 g;
1185  u8 b;
1186  u8 a;
1187 } GXColor;
1188 
1192 typedef struct _gx_colors10 {
1193  s16 r;
1194  s16 g;
1195  s16 b;
1196  s16 a;
1197 } GXColorS10;
1198 
1209 typedef struct _gx_texobj {
1210  u32 val[8];
1211 } GXTexObj;
1212 
1223 typedef struct _gx_tlutobj {
1224  u32 val[3];
1225 } GXTlutObj;
1226 
1237 typedef struct _gx_texreg {
1238  u32 val[4];
1239 } GXTexRegion;
1240 
1251 typedef struct _gx_tlutreg {
1252  u32 val[4];
1253 } GXTlutRegion;
1254 
1265 typedef struct _gx_litobj {
1266  u32 val[16];
1267 } GXLightObj;
1268 
1269 typedef struct _vtx {
1270  f32 x,y,z;
1271  u16 s,t;
1272  u32 rgba;
1273 } Vtx;
1274 
1281 typedef struct {
1282  u8 attr;
1283  u8 type;
1284 } GXVtxDesc;
1285 
1292 typedef struct {
1293  u32 vtxattr;
1294  u32 comptype;
1295  u32 compsize;
1296  u32 frac;
1297 } GXVtxAttrFmt;
1298 
1309 typedef struct {
1310  u8 pad[GX_FIFO_OBJSIZE];
1311 } GXFifoObj;
1312 
1313 typedef struct {
1314  u8 dummy[4];
1315 } GXTexReg;
1316 
1320 typedef struct {
1321  u16 r[10];
1322 } GXFogAdjTbl;
1327 typedef void (*GXBreakPtCallback)(void);
1328 
1332 typedef void (*GXDrawDoneCallback)(void);
1333 
1338 typedef void (*GXDrawSyncCallback)(u16 token);
1339 
1344 typedef GXTexRegion* (*GXTexRegionCallback)(GXTexObj *obj,u8 mapid);
1345 
1350 typedef GXTlutRegion* (*GXTlutRegionCallback)(u32 tlut_name);
1351 
1352 extern WGPipe* const wgPipe;
1377 GXFifoObj* GX_Init(void *base,u32 size);
1378 
1407 void GX_InitFifoBase(GXFifoObj *fifo,void *base,u32 size);
1408 
1431 void GX_InitFifoLimits(GXFifoObj *fifo,u32 hiwatermark,u32 lowatermark);
1432 
1445 void GX_InitFifoPtrs(GXFifoObj *fifo,void *rd_ptr,void *wt_ptr);
1446 
1459 void GX_GetFifoPtrs(GXFifoObj *fifo,void **rd_ptr,void **wt_ptr);
1460 
1472 void GX_SetCPUFifo(GXFifoObj *fifo);
1473 
1495 void GX_SetGPFifo(GXFifoObj *fifo);
1496 
1505 void GX_GetCPUFifo(GXFifoObj *fifo);
1506 
1515 void GX_GetGPFifo(GXFifoObj *fifo);
1516 
1525 void* GX_GetFifoBase(GXFifoObj *fifo);
1526 
1539 
1549 
1564 u8 GX_GetFifoWrap(GXFifoObj *fifo);
1565 
1579 
1591 
1604 void GX_AbortFrame();
1605 
1614 void GX_Flush();
1615 
1625 void GX_SetMisc(u32 token,u32 value);
1626 
1641 void GX_SetDrawDone();
1642 
1656 void GX_WaitDrawDone();
1657 
1665 
1678 void GX_SetDrawSync(u16 token);
1679 
1693 
1704 void GX_DisableBreakPt();
1705 
1729 void GX_EnableBreakPt(void *break_pt);
1730 
1739 void GX_DrawDone();
1740 
1754 void GX_TexModeSync();
1755 
1770 void GX_InvVtxCache();
1771 
1780 void GX_ClearVtxDesc();
1781 
1794 
1815 void GX_SetViewport(f32 xOrig,f32 yOrig,f32 wd,f32 ht,f32 nearZ,f32 farZ);
1816 
1837 void GX_SetViewportJitter(f32 xOrig,f32 yOrig,f32 wd,f32 ht,f32 nearZ,f32 farZ,u32 field);
1838 
1872 void GX_SetChanCtrl(s32 channel,u8 enable,u8 ambsrc,u8 matsrc,u8 litmask,u8 diff_fn,u8 attn_fn);
1873 
1886 
1899 
1928 void GX_SetArray(u32 attr,void *ptr,u8 stride);
1929 
1954 void GX_SetVtxAttrFmt(u8 vtxfmt,u32 vtxattr,u32 comptype,u32 compsize,u32 frac);
1955 
1969 void GX_SetVtxAttrFmtv(u8 vtxfmt,GXVtxAttrFmt *attr_list);
1970 
1984 void GX_SetVtxDesc(u8 attr,u8 type);
1985 
1998 void GX_SetVtxDescv(GXVtxDesc *attr_list);
1999 
2012 void GX_GetVtxDescv(GXVtxDesc *attr_list);
2013 
2038 
2054 void GX_Begin(u8 primitve,u8 vtxfmt,u16 vtxcnt);
2055 
2088 void GX_BeginDispList(void *list,u32 size);
2089 
2109 void GX_CallDispList(void *list,u32 nbytes);
2110 
2117 static inline void GX_End()
2118 {
2119 }
2120 
2121 static inline void GX_Position3f32(f32 x,f32 y,f32 z)
2122 {
2123  wgPipe->F32 = x;
2124  wgPipe->F32 = y;
2125  wgPipe->F32 = z;
2126 }
2128 static inline void GX_Position3u16(u16 x,u16 y,u16 z)
2129 {
2130  wgPipe->U16 = x;
2132  wgPipe->U16 = z;
2133 }
2134 
2135 static inline void GX_Position3s16(s16 x,s16 y,s16 z)
2136 {
2137  wgPipe->S16 = x;
2139  wgPipe->S16 = z;
2140 }
2141 
2142 static inline void GX_Position3u8(u8 x,u8 y,u8 z)
2143 {
2144  wgPipe->U8 = x;
2146  wgPipe->U8 = z;
2147 }
2148 
2149 static inline void GX_Position3s8(s8 x,s8 y,s8 z)
2150 {
2151  wgPipe->S8 = x;
2153  wgPipe->S8 = z;
2154 }
2155 
2156 static inline void GX_Position2f32(f32 x,f32 y)
2157 {
2158  wgPipe->F32 = x;
2160 }
2161 
2162 static inline void GX_Position2u16(u16 x,u16 y)
2163 {
2164  wgPipe->U16 = x;
2165  wgPipe->U16 = y;
2167 
2168 static inline void GX_Position2s16(s16 x,s16 y)
2169 {
2170  wgPipe->S16 = x;
2171  wgPipe->S16 = y;
2173 
2174 static inline void GX_Position2u8(u8 x,u8 y)
2175 {
2176  wgPipe->U8 = x;
2177  wgPipe->U8 = y;
2179 
2180 static inline void GX_Position2s8(s8 x,s8 y)
2181 {
2182  wgPipe->S8 = x;
2183  wgPipe->S8 = y;
2185 
2186 static inline void GX_Position1x8(u8 index)
2187 {
2188  wgPipe->U8 = index;
2189 }
2191 static inline void GX_Position1x16(u16 index)
2192 {
2193  wgPipe->U16 = index;
2194 }
2195 
2196 static inline void GX_Normal3f32(f32 nx,f32 ny,f32 nz)
2197 {
2198  wgPipe->F32 = nx;
2199  wgPipe->F32 = ny;
2200  wgPipe->F32 = nz;
2202 
2203 static inline void GX_Normal3s16(s16 nx,s16 ny,s16 nz)
2204 {
2205  wgPipe->S16 = nx;
2207  wgPipe->S16 = nz;
2208 }
2209 
2210 static inline void GX_Normal3s8(s8 nx,s8 ny,s8 nz)
2211 {
2212  wgPipe->S8 = nx;
2214  wgPipe->S8 = nz;
2215 }
2216 
2217 static inline void GX_Normal1x8(u8 index)
2218 {
2219  wgPipe->U8 = index;
2221 
2222 static inline void GX_Normal1x16(u16 index)
2223 {
2224  wgPipe->U16 = index;
2225 }
2226 
2227 static inline void GX_Color4u8(u8 r,u8 g,u8 b,u8 a)
2228 {
2229  wgPipe->U8 = r;
2230  wgPipe->U8 = g;
2231  wgPipe->U8 = b;
2233 }
2234 
2235 static inline void GX_Color3u8(u8 r,u8 g,u8 b)
2236 {
2238  wgPipe->U8 = g;
2239  wgPipe->U8 = b;
2240 }
2241 
2242 static inline void GX_Color3f32(f32 r, f32 g, f32 b)
2243 {
2244  wgPipe->U8 = (u8)(r * 255.0);
2245  wgPipe->U8 = (u8)(g * 255.0);
2246  wgPipe->U8 = (u8)(b * 255.0);
2247 }
2248 
2249 static inline void GX_Color1u32(u32 clr)
2250 {
2251  wgPipe->U32 = clr;
2253 
2254 static inline void GX_Color1u16(u16 clr)
2255 {
2256  wgPipe->U16 = clr;
2257 }
2258 
2259 static inline void GX_Color1x8(u8 index)
2260 {
2261  wgPipe->U8 = index;
2262 }
2263 
2264 static inline void GX_Color1x16(u16 index)
2265 {
2266  wgPipe->U16 = index;
2267 }
2268 
2269 static inline void GX_TexCoord2f32(f32 s,f32 t)
2270 {
2271  wgPipe->F32 = s;
2272  wgPipe->F32 = t;
2273 }
2275 static inline void GX_TexCoord2u16(u16 s,u16 t)
2276 {
2277  wgPipe->U16 = s;
2278  wgPipe->U16 = t;
2280 
2281 static inline void GX_TexCoord2s16(s16 s,s16 t)
2282 {
2283  wgPipe->S16 = s;
2284  wgPipe->S16 = t;
2286 
2287 static inline void GX_TexCoord2u8(u8 s,u8 t)
2288 {
2289  wgPipe->U8 = s;
2290  wgPipe->U8 = t;
2292 
2293 static inline void GX_TexCoord2s8(s8 s,s8 t)
2294 {
2295  wgPipe->S8 = s;
2296  wgPipe->S8 = t;
2298 
2299 static inline void GX_TexCoord1f32(f32 s)
2300 {
2301  wgPipe->F32 = s;
2302 }
2304 static inline void GX_TexCoord1u16(u16 s)
2305 {
2306  wgPipe->U16 = s;
2307 }
2308 
2309 static inline void GX_TexCoord1s16(s16 s)
2310 {
2311  wgPipe->S16 = s;
2312 }
2313 
2314 static inline void GX_TexCoord1u8(u8 s)
2315 {
2316  wgPipe->U8 = s;
2317 }
2318 
2319 static inline void GX_TexCoord1s8(s8 s)
2320 {
2321  wgPipe->S8 = s;
2322 }
2323 
2324 static inline void GX_TexCoord1x8(u8 index)
2325 {
2326  wgPipe->U8 = index;
2327 }
2328 
2329 static inline void GX_TexCoord1x16(u16 index)
2330 {
2331  wgPipe->U16 = index;
2332 }
2333 
2334 static inline void GX_MatrixIndex1x8(u8 index)
2335 {
2336  wgPipe->U8 = index;
2337 }
2338 
2358 void GX_AdjustForOverscan(GXRModeObj *rmin,GXRModeObj *rmout,u16 hor,u16 ver);
2359 
2381 void GX_LoadPosMtxImm(Mtx mt,u32 pnidx);
2382 
2404 void GX_LoadPosMtxIdx(u16 mtxidx,u32 pnidx);
2405 
2427 void GX_LoadNrmMtxImm(Mtx mt,u32 pnidx);
2428 
2451 void GX_LoadNrmMtxIdx3x3(u16 mtxidx,u32 pnidx);
2452 
2477 void GX_LoadTexMtxImm(Mtx mt,u32 texidx,u8 type);
2478 
2502 void GX_LoadTexMtxIdx(u16 mtxidx,u32 texidx,u8 type);
2503 
2516 void GX_SetCurrentMtx(u32 mtx);
2517 
2533 void GX_SetTevOp(u8 tevstage,u8 mode);
2534 
2549 void GX_SetTevColor(u8 tev_regid,GXColor color);
2550 
2565 void GX_SetTevColorS10(u8 tev_regid,GXColorS10 color);
2566 
2584 void GX_SetTevColorIn(u8 tevstage,u8 a,u8 b,u8 c,u8 d);
2585 
2602 void GX_SetTevAlphaIn(u8 tevstage,u8 a,u8 b,u8 c,u8 d);
2603 
2626 void GX_SetTevColorOp(u8 tevstage,u8 tevop,u8 tevbias,u8 tevscale,u8 clamp,u8 tevregid);
2627 
2628 
2650 void GX_SetTevAlphaOp(u8 tevstage,u8 tevop,u8 tevbias,u8 tevscale,u8 clamp,u8 tevregid);
2651 
2666 void GX_SetNumTexGens(u32 nr);
2667 
2700 void GX_SetTexCoordGen(u16 texcoord,u32 tgen_typ,u32 tgen_src,u32 mtxsrc);
2701 
2731 void GX_SetTexCoordGen2(u16 texcoord,u32 tgen_typ,u32 tgen_src,u32 mtxsrc,u32 normalize,u32 postmtx);
2732 
2762 void GX_SetZTexture(u8 op,u8 fmt,u32 bias);
2763 
2784 void GX_SetZMode(u8 enable,u8 func,u8 update_enable);
2785 
2797 void GX_SetZCompLoc(u8 before_tex);
2798 
2811 void GX_SetLineWidth(u8 width,u8 fmt);
2812 
2825 void GX_SetPointSize(u8 width,u8 fmt);
2826 
2856 void GX_SetBlendMode(u8 type,u8 src_fact,u8 dst_fact,u8 op);
2857 
2870 void GX_SetCullMode(u8 mode);
2871 
2888 void GX_SetCoPlanar(u8 enable);
2889 
2906 void GX_EnableTexOffsets(u8 coord,u8 line_enable,u8 point_enable);
2907 
2920 void GX_SetClipMode(u8 mode);
2921 
2942 void GX_SetScissor(u32 xOrigin,u32 yOrigin,u32 wd,u32 ht);
2943 
2969 
2985 void GX_SetNumChans(u8 num);
2986 
3025 void GX_SetTevOrder(u8 tevstage,u8 texcoord,u32 texmap,u8 color);
3026 
3044 void GX_SetNumTevStages(u8 num);
3045 
3080 void GX_SetAlphaCompare(u8 comp0,u8 ref0,u8 aop,u8 comp1,u8 ref1);
3081 
3093 void GX_SetTevKColor(u8 sel, GXColor col);
3094 
3107 void GX_SetTevKColorSel(u8 tevstage,u8 sel);
3108 
3121 void GX_SetTevKAlphaSel(u8 tevstage,u8 sel);
3122 
3139 void GX_SetTevKColorS10(u8 sel, GXColorS10 col);
3140 
3155 void GX_SetTevSwapMode(u8 tevstage,u8 ras_sel,u8 tex_sel);
3156 
3172 void GX_SetTevSwapModeTable(u8 swapid,u8 r,u8 g,u8 b,u8 a);
3173 
3191 void GX_SetTevIndirect(u8 tevstage,u8 indtexid,u8 format,u8 bias,u8 mtxid,u8 wrap_s,u8 wrap_t,u8 addprev,u8 utclod,u8 a);
3192 
3201 void GX_SetTevDirect(u8 tevstage);
3202 
3213 void GX_SetNumIndStages(u8 nstages);
3214 
3225 void GX_SetIndTexOrder(u8 indtexstage,u8 texcoord,u8 texmap);
3226 
3239 void GX_SetIndTexCoordScale(u8 indtexid,u8 scale_s,u8 scale_t);
3240 
3262 void GX_SetFog(u8 type,f32 startz,f32 endz,f32 nearz,f32 farz,GXColor col);
3263 
3284 
3294 
3310 void GX_InitFogAdjTable(GXFogAdjTbl *table,u16 width,f32 projmtx[4][4]);
3311 
3330 void GX_SetIndTexMatrix(u8 indtexmtx,f32 offset_mtx[2][3],s8 scale_exp);
3331 
3351 void GX_SetTevIndBumpST(u8 tevstage,u8 indstage,u8 mtx_sel);
3352 
3369 void GX_SetTevIndBumpXYZ(u8 tevstage,u8 indstage,u8 mtx_sel);
3370 
3394 void GX_SetTevIndTile(u8 tevstage,u8 indtexid,u16 tilesize_x,u16 tilesize_y,u16 tilespacing_x,u16 tilespacing_y,u8 indtexfmt,u8 indtexmtx,u8 bias_sel,u8 alpha_sel);
3395 
3406 void GX_SetTevIndRepeat(u8 tevstage);
3407 
3419 
3434 
3465 void GX_SetPixelFmt(u8 pix_fmt,u8 z_fmt);
3466 
3482 void GX_SetDither(u8 dither);
3483 
3497 void GX_SetDstAlpha(u8 enable,u8 a);
3498 
3513 void GX_SetFieldMask(u8 even_mask,u8 odd_mask);
3514 
3536 void GX_SetFieldMode(u8 field_mode,u8 half_aspect_ratio);
3537 
3548 f32 GX_GetYScaleFactor(u16 efbHeight,u16 xfbHeight);
3549 
3561 u32 GX_SetDispCopyYScale(f32 yscale);
3562 
3574 void GX_SetDispCopySrc(u16 left,u16 top,u16 wd,u16 ht);
3575 
3588 void GX_SetDispCopyDst(u16 wd,u16 ht);
3589 
3598 void GX_SetCopyClamp(u8 clamp);
3599 
3608 void GX_SetDispCopyGamma(u8 gamma);
3609 
3629 void GX_SetCopyFilter(u8 aa,u8 sample_pattern[12][2],u8 vf,u8 vfilter[7]);
3630 
3646 
3658 void GX_SetCopyClear(GXColor color,u32 zvalue);
3659 
3676 void GX_CopyDisp(void *dest,u8 clear);
3677 
3692 void GX_SetTexCopySrc(u16 left,u16 top,u16 wd,u16 ht);
3693 
3718 void GX_SetTexCopyDst(u16 wd,u16 ht,u32 fmt,u8 mipmap);
3719 
3732 void GX_CopyTex(void *dest,u8 clear);
3733 
3746 void GX_PixModeSync();
3747 
3756 void GX_ClearBoundingBox();
3757 
3777 void GX_PokeAlphaMode(u8 func,u8 threshold);
3778 
3789 void GX_PokeAlphaUpdate(u8 update_enable);
3790 
3799 void GX_PokeColorUpdate(u8 update_enable);
3800 
3813 void GX_PokeDither(u8 dither);
3814 
3841 void GX_PokeBlendMode(u8 type,u8 src_fact,u8 dst_fact,u8 op);
3842 
3857 void GX_PokeAlphaRead(u8 mode);
3858 
3871 void GX_PokeDstAlpha(u8 enable,u8 a);
3872 
3889 
3902 void GX_PeekARGB(u16 x,u16 y,GXColor *color);
3903 
3920 void GX_PokeZ(u16 x,u16 y,u32 z);
3921 
3937 void GX_PeekZ(u16 x,u16 y,u32 *z);
3938 
3961 void GX_PokeZMode(u8 comp_enable,u8 func,u8 update_enable);
3962 
3974 
3986 
3998 
4009 void* GX_GetTexObjData(GXTexObj *obj);
4010 
4022 
4034 
4046 
4058 
4072 void GX_GetTexObjAll(GXTexObj* obj, void** image_ptr, u16* width, u16* height, u8* format, u8* wrap_s, u8* wrap_t, u8* mipmap);
4073 
4092 u32 GX_GetTexBufferSize(u16 wd,u16 ht,u32 fmt,u8 mipmap,u8 maxlod);
4093 
4104 void GX_InvalidateTexAll();
4105 
4123 void GX_InvalidateTexRegion(GXTexRegion *region);
4124 
4152 
4177 
4202 void GX_InitTexObj(GXTexObj *obj,void *img_ptr,u16 wd,u16 ht,u8 fmt,u8 wrap_s,u8 wrap_t,u8 mipmap);
4203 
4235 void GX_InitTexObjCI(GXTexObj *obj,void *img_ptr,u16 wd,u16 ht,u8 fmt,u8 wrap_s,u8 wrap_t,u8 mipmap,u32 tlut_name);
4236 
4246 void GX_InitTexObjTlut(GXTexObj *obj,u32 tlut_name);
4247 
4260 void GX_InitTexObjData(GXTexObj *obj,void *img_ptr);
4261 
4272 void GX_InitTexObjWrapMode(GXTexObj *obj,u8 wrap_s,u8 wrap_t);
4273 
4284 void GX_InitTexObjFilterMode(GXTexObj *obj,u8 minfilt,u8 magfilt);
4285 
4293 void GX_InitTexObjMinLOD(GXTexObj *obj,f32 minlod);
4294 
4302 void GX_InitTexObjMaxLOD(GXTexObj *obj,f32 maxlod);
4303 
4315 void GX_InitTexObjLODBias(GXTexObj *obj,f32 lodbias);
4316 
4328 void GX_InitTexObjBiasClamp(GXTexObj *obj,u8 biasclamp);
4329 
4341 void GX_InitTexObjEdgeLOD(GXTexObj *obj,u8 edgelod);
4342 
4359 void GX_InitTexObjMaxAniso(GXTexObj *obj,u8 maxaniso);
4360 
4370 void GX_InitTexObjUserData(GXTexObj *obj,void *userdata);
4371 
4389 void GX_LoadTexObj(GXTexObj *obj,u8 mapid);
4390 
4409 void GX_LoadTlut(GXTlutObj *obj,u32 tlut_name);
4410 
4432 void GX_LoadTexObjPreloaded(GXTexObj *obj,GXTexRegion *region,u8 mapid);
4433 
4451 
4466 void GX_InitTlutObj(GXTlutObj *obj,void *lut,u8 fmt,u16 entries);
4467 
4481 void GX_InitTlutRegion(GXTlutRegion *region,u32 tmem_addr,u8 tlut_sz);
4482 
4514 void GX_InitTexObjLOD(GXTexObj *obj,u8 minfilt,u8 magfilt,f32 minlod,f32 maxlod,f32 lodbias,u8 biasclamp,u8 edgelod,u8 maxaniso);
4515 
4535 void GX_SetTexCoordScaleManually(u8 texcoord,u8 enable,u16 ss,u16 ts);
4536 
4556 void GX_SetTexCoordBias(u8 texcoord,u8 s_enable,u8 t_enable);
4557 
4571 
4590 
4612 void GX_InitLightPos(GXLightObj *lit_obj,f32 x,f32 y,f32 z);
4613 
4626 void GX_InitLightColor(GXLightObj *lit_obj,GXColor col);
4627 
4650 void GX_InitLightDir(GXLightObj *lit_obj,f32 nx,f32 ny,f32 nz);
4651 
4668 void GX_LoadLightObj(GXLightObj *lit_obj,u8 lit_id);
4669 
4685 void GX_LoadLightObjIdx(u32 litobjidx,u8 litid);
4686 
4713 void GX_InitLightDistAttn(GXLightObj *lit_obj,f32 ref_dist,f32 ref_brite,u8 dist_fn);
4714 
4752 
4779 void GX_InitLightAttnA(GXLightObj *lit_obj,f32 a0,f32 a1,f32 a2);
4780 
4807 void GX_InitLightAttnK(GXLightObj *lit_obj,f32 k0,f32 k1,f32 k2);
4808 
4832 void GX_InitSpecularDirHA(GXLightObj *lit_obj,f32 nx,f32 ny,f32 nz,f32 hx,f32 hy,f32 hz);
4833 
4858 void GX_InitSpecularDir(GXLightObj *lit_obj,f32 nx,f32 ny,f32 nz);
4859 
4887 void GX_InitLightSpot(GXLightObj *lit_obj,f32 cut_off,u8 spotfn);
4888 
4892 
4907 
4925 
4939 
4965 void GX_SetGPMetric(u32 perf0,u32 perf1);
4966 
4977 void GX_ClearGPMetric();
4978 
4987 void GX_InitXfRasMetric();
4988 
5004 void GX_ReadXfRasMetric(u32 *xfwaitin,u32 *xfwaitout,u32 *rasbusy,u32 *clks);
5005 
5016 void GX_ClearVCacheMetric();
5017 
5033 void GX_ReadVCacheMetric(u32 *check,u32 *miss,u32 *stall);
5034 
5047 void GX_SetVCacheMetric(u32 attr);
5048 
5067 void GX_GetGPStatus(u8 *overhi,u8 *underlow,u8 *readIdle,u8 *cmdIdle,u8 *brkpt);
5068 
5087 void GX_ReadGPMetric(u32 *cnt0,u32 *cnt1);
5088 
5107 
5136 volatile void* GX_RedirectWriteGatherPipe(void *ptr);
5137 
5153 #define GX_InitLightPosv(lo,vec) \
5154  (GX_InitLightPos((lo), *(f32*)(vec), *((f32*)(vec)+1), *((f32*)(vec)+2)))
5155 
5176 #define GX_InitLightDirv(lo,vec) \
5177  (GX_InitLightDir((lo), *(f32*)(vec), *((f32*)(vec)+1), *((f32*)(vec)+2)))
5178 
5203 #define GX_InitSpecularDirv(lo,vec) \
5204  (GX_InitSpecularDir((lo), *(f32*)(vec), *((f32*)(vec)+1), *((f32*)(vec)+2)))
5205 
5227 #define GX_InitSpecularDirHAv(lo,vec0,vec1) \
5228  (GX_InitSpecularDirHA((lo), \
5229  *(f32*)(vec0), *((f32*)(vec0)+1), *((f32*)(vec0)+2), \
5230  *(f32*)(vec1), *((f32*)(vec1)+1), *((f32*)(vec1)+2)))
5231 
5247 #define GX_InitLightShininess(lobj, shininess) \
5248  (GX_InitLightAttn(lobj, 0.0F, 0.0F, 1.0F, \
5249  (shininess)/2.0F, 0.0F, \
5250  1.0F-(shininess)/2.0F ))
5251 
5252 #ifdef __cplusplus
5253  }
5254 #endif /* __cplusplus */
5255 
5256 #endif
static void GX_Normal3s8(s8 nx, s8 ny, s8 nz)
Definition: gx.h:2220
static void GX_TexCoord1u16(u16 s)
Definition: gx.h:2314
void GX_SetColorUpdate(u8 enable)
Enables or disables color-buffer updates when rendering into the Embedded Frame Buffer (EFB).
Definition: gx.c:4277
void * GX_GetTexObjUserData(GXTexObj *obj)
Used to get a pointer to user data from the GXTexObj structure.
Definition: gx.c:3328
void GX_InitFogAdjTable(GXFogAdjTbl *table, u16 width, f32 projmtx[4][4])
Generates the standard range adjustment table and puts the results into table.
Definition: gx.c:4221
vu32 rd_ptr
Definition: gx_regdef.h:5097
u16 GX_GetDrawSync()
Returns the value of the token register, which is written using the GX_SetDrawSync() function.
Definition: gx.c:1640
void GX_RestoreWriteGatherPipe()
Restores the write-gather pipe.
Definition: gx.c:1533
struct _gx_color GXColor
Structure used to pass colors to some GX functions.
void GX_InitTexObjCI(GXTexObj *obj, void *img_ptr, u16 wd, u16 ht, u8 fmt, u8 wrap_s, u8 wrap_t, u8 mipmap, u32 tlut_name)
Used to initialize or change a texture object when the texture is color index format.
Definition: gx.c:3211
u8 r
Definition: gx.h:1193
void GX_InitTlutObj(GXTlutObj *obj, void *lut, u8 fmt, u16 entries)
Initializes a Texture Look-Up Table (TLUT) object.
Definition: gx.c:3334
volatile float vf32
Definition: gctypes.h:46
const GLvoid * ptr
Definition: nx_glsym.h:242
void GX_InitTexCacheRegion(GXTexRegion *region, u8 is32bmipmap, u32 tmem_even, u8 size_even, u32 tmem_odd, u8 size_odd)
Initializes a texture memory (TMEM) region object for cache.
Definition: gx.c:3059
static void GX_Normal1x8(u8 index)
Definition: gx.h:2227
vu8 U8
Definition: gx.h:1180
void GX_SetZTexture(u8 op, u8 fmt, u32 bias)
Controls Z texture operations.
Definition: gx.c:2753
static void GX_Position3f32(f32 x, f32 y, f32 z)
Definition: gx.h:2131
f32 x
Definition: gx.h:1280
void GX_InitFifoBase(GXFifoObj *fifo, void *base, u32 size)
Describes the area of main memory that will be used for this fifo.
Definition: gx.c:1226
static void GX_Normal3s16(s16 nx, s16 ny, s16 nz)
Definition: gx.h:2213
int32_t s32
32bit signed integer
Definition: gctypes.h:24
static void GX_End()
Used to end the drawing of a graphics primitive. This does nothing in libogc.
Definition: gx.h:2127
Definition: gx.h:1233
GLenum mode
Definition: glext.h:6857
GLuint GLfloat * val
Definition: glext.h:7847
set set set set set set set macro pixldst1 op
Definition: pixman-arm-neon-asm.h:54
u32 GX_GetTexObjFmt(GXTexObj *obj)
Returns the texture format described by texture object obj.
Definition: gx.c:2932
Definition: gx.h:1192
Thread subsystem I.
void GX_SetTevIndRepeat(u8 tevstage)
Set a given TEV stage to use the same texture coordinates as were computed in the previous stage.
Definition: gx.c:4082
void GX_SetTevColorS10(u8 tev_regid, GXColorS10 color)
Used to set one of the constant color registers in the TEV unit.
Definition: gx.c:3703
void GX_PeekARGB(u16 x, u16 y, GXColor *color)
Allows the CPU to read a color value directly from the Embedded Frame Buffer (EFB) at position x,...
Definition: gx.c:4406
volatile u8 vu8
8bit unsigned volatile integer
Definition: gctypes.h:27
void GX_SetTevIndirect(u8 tevstage, u8 indtexid, u8 format, u8 bias, u8 mtxid, u8 wrap_s, u8 wrap_t, u8 addprev, u8 utclod, u8 a)
Controls how the results from an indirect lookup will be used to modify a given regular TEV stage loo...
Definition: gx.c:4003
void GX_LoadTexObj(GXTexObj *obj, u8 mapid)
Loads the state describing a texture into one of eight hardware register sets.
Definition: gx.c:3346
struct _gx_litobj GXLightObj
Object containing information on a light.
u8 GX_GetFifoWrap(GXFifoObj *fifo)
Returns a non-zero value if the write pointer has passed the TOP of the FIFO.
Definition: gx.c:1473
static void GX_Normal1x16(u16 index)
Definition: gx.h:2232
static void GX_Normal3f32(f32 nx, f32 ny, f32 nz)
Definition: gx.h:2206
static void GX_TexCoord1f32(f32 s)
Definition: gx.h:2309
void GX_InitXfRasMetric()
Initialize the transformation unit (XF) rasterizer unit (RAS) to take performance measurements.
Definition: gx.c:4983
void GX_SetFogRangeAdj(u8 enable, u16 center, GXFogAdjTbl *table)
Enables or disables horizontal fog-range adjustment.
Definition: gx.c:4248
void GX_PokeZ(u16 x, u16 y, u32 z)
Allows the CPU to write a z value directly to the Embedded Frame Buffer (EFB) at position x,...
Definition: gx.c:4419
GXFifoObj * GX_Init(void *base, u32 size)
Initializes the graphics processor to its initial state.
Definition: gx.c:1053
void GX_InvVtxCache()
Invalidates the vertex cache.
Definition: gx.c:2919
void GX_InitTexObjData(GXTexObj *obj, void *img_ptr)
Allows one to modify the image data pointer for an existing texture object.
Definition: gx.c:3246
Data type definitions.
u32 tmem_odd
Definition: gx_regdef.h:5093
void GX_PokeDither(u8 dither)
Enables dithering when writing the Embedded Frame Buffer (EFB) using GX_Poke*() functions.
Definition: gx.c:4371
u32 GX_SetDispCopyYScale(f32 yscale)
Sets the vertical scale factor for the EFB to XFB copy operation.
Definition: gx.c:1960
float f32
Definition: gctypes.h:43
void GX_SetFogColor(GXColor color)
Sets the fog color.
Definition: gx.c:4272
void GX_SetIndTexCoordScale(u8 indtexid, u8 scale_s, u8 scale_t)
Allows the sharing of a texcoord between an indirect stage and a regular TEV stage.
Definition: gx.c:4087
void GX_InitLightPos(GXLightObj *lit_obj, f32 x, f32 y, f32 z)
Sets the position of the light in the light object.
Definition: gx.c:4472
static void GX_TexCoord1x16(u16 index)
Definition: gx.h:2339
GLdouble GLdouble GLdouble r
Definition: glext.h:6406
vu32 U32
Definition: gx.h:1184
u8 g
Definition: gx.h:1194
Structure describing how a single vertex attribute will be referenced.
Definition: gx.h:1291
f32 Mtx44[4][4]
4x4 matrix.
Definition: gu.h:137
void GX_SetCullMode(u8 mode)
Enables or disables culling of geometry based on its orientation to the viewer.
Definition: gx.c:3842
GLdouble GLdouble t
Definition: glext.h:6398
void GX_InitLightAttnK(GXLightObj *lit_obj, f32 k0, f32 k1, f32 k2)
Sets coefficients used in the lighting distance attenuation calculation in a given light object.
Definition: gx.c:4653
void GX_InitSpecularDir(GXLightObj *lit_obj, f32 nx, f32 ny, f32 nz)
Sets the direction of a specular light in the light object.
Definition: gx.c:4679
u32 lwp_t
typedef for the thread context handle
Definition: lwp.h:62
void GX_InitTexObjLODBias(GXTexObj *obj, f32 lodbias)
Sets the LOD bias for a given texture.
Definition: gx.c:3294
volatile void * GX_RedirectWriteGatherPipe(void *ptr)
Temporarily points the CPU's write-gather pipe at a new location.
Definition: gx.c:1507
void GX_SetVtxAttrFmt(u8 vtxfmt, u32 vtxattr, u32 comptype, u32 compsize, u32 frac)
Sets the attribute format (vtxattr) for a single attribute in the Vertex Attribute Table (VAT).
Definition: gx.c:2598
volatile s8 vs8
8bit signed volatile integer
Definition: gctypes.h:32
void GX_GetCPUFifo(GXFifoObj *fifo)
Copies the information from the currently attached CPU FIFO into fifo.
Definition: gx.c:1334
Definition: gx.h:1261
void GX_SetDispCopyGamma(u8 gamma)
Sets the gamma correction applied to pixels during EFB to XFB copy operation.
Definition: gx.c:1887
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:6296
int8_t s8
8bit signed integer
Definition: gctypes.h:22
void GX_SetPixelFmt(u8 pix_fmt, u8 z_fmt)
Sets the format of pixels in the Embedded Frame Buffer (EFB).
Definition: gx.c:4295
GLsizeiptr size
Definition: glext.h:6559
void GX_SetVCacheMetric(u32 attr)
Sets the metric the Vertex Cache performance counter will measure.
Definition: gx.c:5017
void GX_SetTevKColorS10(u8 sel, GXColorS10 col)
Used to set one of the constant color registers in the Texture Environment (TEV) unit.
Definition: gx.c:3733
Definition: gx.h:1219
void GX_LoadProjectionMtx(Mtx44 mt, u8 type)
Sets the projection matrix.
Definition: gx.c:1774
void GX_InitTexObjMaxAniso(GXTexObj *obj, u8 maxaniso)
Sets the maximum anisotropic filter to use for a texture.
Definition: gx.c:3316
static void GX_Position3u16(u16 x, u16 y, u16 z)
Definition: gx.h:2138
void GX_InitTexObj(GXTexObj *obj, void *img_ptr, u16 wd, u16 ht, u8 fmt, u8 wrap_s, u8 wrap_t, u8 mipmap)
Used to initialize or change a texture object for non-color index textures.
Definition: gx.c:3136
static void GX_Position3s8(s8 x, s8 y, s8 z)
Definition: gx.h:2159
void GX_SetTevOp(u8 tevstage, u8 mode)
Simplified function to set various TEV parameters for this tevstage based on a predefined combiner mo...
Definition: gx.c:3748
void GX_InitLightAttn(GXLightObj *lit_obj, f32 a0, f32 a1, f32 a2, f32 k0, f32 k1, f32 k2)
Sts coefficients used in the lighting attenuation calculation in a given light object.
Definition: gx.c:4632
void GX_InitTexObjFilterMode(GXTexObj *obj, u8 minfilt, u8 magfilt)
Sets the filter mode for a texture.
Definition: gx.c:3265
void GX_InitFifoLimits(GXFifoObj *fifo, u32 hiwatermark, u32 lowatermark)
Sets the high and low water mark for the fifo.
Definition: gx.c:1241
GLboolean enable
Definition: glext.h:12027
Definition: gx.h:1178
u32 GX_GetOverflowCount()
Definition: gx.c:1478
void GX_SetTevSwapMode(u8 tevstage, u8 ras_sel, u8 tex_sel)
Selects a set of swap modes for the rasterized color and texture color for a given TEV stage.
Definition: gx.c:3981
GLdouble s
Definition: glext.h:6390
f32 k1
Definition: gx_regdef.h:5098
static void GX_Position2u16(u16 x, u16 y)
Definition: gx.h:2172
static void GX_Color1u32(u32 clr)
Definition: gx.h:2259
GLdouble GLdouble z
Definition: glext.h:6514
void GX_CopyDisp(void *dest, u8 clear)
Copies the embedded framebuffer (EFB) to the external framebuffer(XFB) in main memory.
Definition: gx.c:1986
void GX_SetMisc(u32 token, u32 value)
Sets miscellanous settings in the GP.
Definition: gx.c:1724
GLint GLint bottom
Definition: glext.h:8393
void GX_InvalidateTexAll()
Invalidates the current caches of the Texture Memory (TMEM).
Definition: gx.c:3518
void GX_CopyTex(void *dest, u8 clear)
Copies the embedded framebuffer (EFB) to the texture image buffer dest in main memory.
Definition: gx.c:2028
Definition: gx_struct.h:58
WGPipe *const wgPipe
Definition: gx.c:74
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
void GX_LoadPosMtxIdx(u16 mtxidx, u32 pnidx)
Loads a 3x4 modelview matrix at index mtxidx from the array in main memory.
Definition: gx.c:2854
vs8 S8
Definition: gx.h:1181
void GX_SetCoPlanar(u8 enable)
Enables or disables coplanar triangle processing.
Definition: gx.c:3850
void GX_InitTexObjMaxLOD(GXTexObj *obj, f32 maxlod)
Sets the maximum LOD for a given texture.
Definition: gx.c:3284
void GX_PokeARGB(u16 x, u16 y, GXColor color)
Allows the CPU to write color directly to the Embedded Frame Buffer (EFB) at position x,...
Definition: gx.c:4397
void GX_PokeBlendMode(u8 type, u8 src_fact, u8 dst_fact, u8 op)
Determines how the source image, is blended with the current Embedded Frame Buffer (EFB).
Definition: gx.c:4376
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:11766
void GX_InitLightDistAttn(GXLightObj *lit_obj, f32 ref_dist, f32 ref_brite, u8 dist_fn)
Sets coefficients for distance attenuation in a light object.
Definition: gx.c:4595
void GX_SetTevOrder(u8 tevstage, u8 texcoord, u32 texmap, u8 color)
Specifies the texture and rasterized color that will be available as inputs to this TEV tevstage.
Definition: gx.c:3901
void GX_PokeAlphaRead(u8 mode)
Determines what value of alpha will be read from the Embedded Frame Buffer (EFB).
Definition: gx.c:4351
u32 tmem_even
Definition: gx_regdef.h:5092
void GX_DrawDone()
Sends a DrawDone command to the GP and stalls until its subsequent execution.
Definition: gx.c:1665
void GX_SetViewportJitter(f32 xOrig, f32 yOrig, f32 wd, f32 ht, f32 nearZ, f32 farZ, u32 field)
Sets the viewport and adjusts the viewport's line offset for interlaced field rendering.
Definition: gx.c:1743
void GX_ReadGPMetric(u32 *cnt0, u32 *cnt1)
Returns the count of the previously set performance metrics.
Definition: gx.c:5031
void GX_InitTexObjBiasClamp(GXTexObj *obj, u8 biasclamp)
Enables bias clamping for texture LOD.
Definition: gx.c:3304
Object describing a graphics FIFO.
Definition: gx.h:1319
static void GX_TexCoord2u8(u8 s, u8 t)
Definition: gx.h:2297
u32 GX_ResetOverflowCount()
Definition: gx.c:1483
void GX_AdjustForOverscan(GXRModeObj *rmin, GXRModeObj *rmout, u16 hor, u16 ver)
Takes a given render mode and returns a version that is reduced in size to account for overscan.
Definition: gx.c:5050
GXBreakPtCallback GX_SetBreakPtCallback(GXBreakPtCallback cb)
Registers cb as a function to be invoked when a break point is encountered.
Definition: gx.c:1703
GU/Matrix subsystem.
void GX_SetClipMode(u8 mode)
Enables or disables clipping of geometry.
Definition: gx.c:3865
GXDrawSyncCallback GX_SetDrawSyncCallback(GXDrawSyncCallback cb)
Installs a callback that is invoked whenever a DrawSync token is encountered by the graphics pipeline...
Definition: gx.c:1692
void GX_ReadVCacheMetric(u32 *check, u32 *miss, u32 *stall)
Returns Vertex Cache performance counters.
Definition: gx.c:5010
void GX_SetZMode(u8 enable, u8 func, u8 update_enable)
Sets the Z-buffer compare mode.
Definition: gx.c:2924
GLdouble GLdouble right
Definition: glext.h:11766
Definition: gx.h:1279
const GLubyte * c
Definition: glext.h:9812
static void GX_Position1x8(u8 index)
Definition: gx.h:2196
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
void GX_SetPointSize(u8 width, u8 fmt)
Sets the size of point primitives.
Definition: gx.c:3681
int dummy
Definition: lstrlib.c:1125
Definition: gx.h:1247
volatile s32 vs32
32bit signed volatile integer
Definition: gctypes.h:34
GLuint GLuint num
Definition: glext.h:10525
static void GX_Color1x8(u8 index)
Definition: gx.h:2269
void GX_SetVtxDesc(u8 attr, u8 type)
Sets the type of a single attribute (attr) in the current vertex descriptor.
Definition: gx.c:2345
struct _gx_colors10 GXColorS10
Structure used to pass signed 10-bit colors to some GX functions.
void GX_SetVtxDescv(GXVtxDesc *attr_list)
Sets the type of multiple attributes.
Definition: gx.c:2351
static void GX_Position2u8(u8 x, u8 y)
Definition: gx.h:2184
void GX_SetTevIndBumpXYZ(u8 tevstage, u8 indstage, u8 mtx_sel)
Sets up an environment-mapped bump-mapped indirect lookup.
Definition: gx.c:4077
void GX_InitTexObjTlut(GXTexObj *obj, u32 tlut_name)
Allows one to modify the TLUT that is associated with an existing texture object.
Definition: gx.c:3252
vs32 S32
Definition: gx.h:1185
void GX_ClearVtxDesc()
Clears all vertex attributes of the current vertex descriptor to GX_NONE.
Definition: gx.c:3666
static void GX_TexCoord2u16(u16 s, u16 t)
Definition: gx.h:2285
void GX_LoadLightObj(GXLightObj *lit_obj, u8 lit_id)
Loads a light object into a set of hardware registers associated with a Light ID.
Definition: gx.c:4487
void * GX_GetFifoBase(GXFifoObj *fifo)
Get the base address for a given fifo.
Definition: gx.c:1458
void GX_Begin(u8 primitve, u8 vtxfmt, u16 vtxcnt)
Begins drawing of a graphics primitive.
Definition: gx.c:2618
void GX_GetGPStatus(u8 *overhi, u8 *underlow, u8 *readIdle, u8 *cmdIdle, u8 *brkpt)
Reads the current status of the GP.
Definition: gx.c:5021
u32 GX_EndDispList()
Ends a display list and resumes writing graphics commands to the CPU FIFO.
Definition: gx.c:2134
Fog range adjustment parameter table.
Definition: gx.h:1330
GLfloat ny
Definition: glext.h:9803
void GX_SetTexCopySrc(u16 left, u16 top, u16 wd, u16 ht)
Sets the source parameters for the Embedded Frame Buffer (EFB) to texture image copy.
Definition: gx.c:2073
GLenum type
Definition: glext.h:6233
void GX_SetDstAlpha(u8 enable, u8 a)
Sets a constant alpha value for writing to the Embedded Frame Buffer (EFB).
Definition: gx.c:4321
void GX_SetAlphaUpdate(u8 enable)
Enables or disables alpha-buffer updates of the Embedded Frame Buffer (EFB).
Definition: gx.c:4283
Structure describing the attribute format for one attribute.
Definition: gx.h:1302
u32 GX_GetFifoCount(GXFifoObj *fifo)
Returns number of cache lines in the FIFO.
Definition: gx.c:1468
support header
uint16_t u16
16bit unsigned integer
Definition: gctypes.h:18
void GX_SetIndTexMatrix(u8 indtexmtx, f32 offset_mtx[2][3], s8 scale_exp)
Sets one of the three static indirect matrices and the associated scale factor.
Definition: gx.c:4020
void GX_LoadTexMtxIdx(u16 mtxidx, u32 texidx, u8 type)
Loads a texture matrix at index mtxidx from the array in main memory.
Definition: gx.c:2896
void GX_LoadNrmMtxImm(Mtx mt, u32 pnidx)
Used to load a normal transform matrix into matrix memory at location pnidx from the 4x3 matrix mt.
Definition: gx.c:2860
void GX_GetGPFifo(GXFifoObj *fifo)
Copies the information from the currently attached GP FIFO info fifo.
Definition: gx.c:1436
f32 Mtx[3][4]
Standard 3x4 matrix.
Definition: gu.h:115
void GX_SetDrawDone()
Sends a DrawDone command to the GP.
Definition: gx.c:1645
void GX_SetZCompLoc(u8 before_tex)
Sets whether Z buffering happens before or after texturing.
Definition: gx.c:4289
void GX_ClearVCacheMetric()
Clears the Vertex Cache performance counter.
Definition: gx.c:5005
GXTexRegionCallback GX_SetTexRegionCallback(GXTexRegionCallback cb)
Sets the callback function called by GX_LoadTexObj() to obtain an available texture region.
Definition: gx.c:3622
void GX_SetTexCoordScaleManually(u8 texcoord, u8 enable, u16 ss, u16 ts)
Overrides the automatic texture coordinate scaling (based upon the associated map size) and lets one ...
Definition: gx.c:3579
static void GX_Position3u8(u8 x, u8 y, u8 z)
Definition: gx.h:2152
GLuint coord
Definition: glext.h:10418
void GX_SetScissorBoxOffset(s32 xoffset, s32 yoffset)
Repositions the scissorbox rectangle within the Embedded Frame Buffer (EFB) memory space.
Definition: gx.c:3887
void GX_SetTevAlphaOp(u8 tevstage, u8 tevop, u8 tevbias, u8 tevscale, u8 clamp, u8 tevregid)
Sets the tevop, tevbias, tevscale and clamp-mode operation for the alpha combiner for this tevstage o...
Definition: gx.c:3824
void GX_InitTexPreloadRegion(GXTexRegion *region, u32 tmem_even, u32 size_even, u32 tmem_odd, u32 size_odd)
Initializes a Texture Memory (TMEM) region object for preloading.
Definition: gx.c:3106
void GX_SetNumTexGens(u32 nr)
Sets the number of texture coordinates that are generated and available for use in the Texture Enviro...
Definition: gx.c:2913
GLenum func
Definition: glext.h:6668
void GX_TexModeSync()
Inserts a synchronization command into the graphics FIFO. When the Graphics Processor sees this comma...
Definition: gx.c:1719
void GX_ReadBoundingBox(u16 *top, u16 *bottom, u16 *left, u16 *right)
Returns the bounding box of pixel coordinates that are drawn in the Embedded Framebuffer (EFB).
Definition: gx.c:5091
static void GX_Position2s8(s8 x, s8 y)
Definition: gx.h:2190
void GX_SetChanMatColor(s32 channel, GXColor color)
Sets the material color register for color channel chan.
Definition: gx.c:2223
void GX_PixModeSync()
Causes the GPU to wait for the pipe to flush.
Definition: gx.c:1714
void GX_ReadXfRasMetric(u32 *xfwaitin, u32 *xfwaitout, u32 *rasbusy, u32 *clks)
Read performance metric values from the XF and RAS units.
Definition: gx.c:4989
void GX_SetChanAmbColor(s32 channel, GXColor color)
Sets the ambient color register for color channel chan.
Definition: gx.c:2187
void GX_SetCurrentMtx(u32 mtx)
Selects a specific matrix to use for transformations.
Definition: gx.c:2907
void GX_EnableBreakPt(void *break_pt)
Sets a breakpoint that causes the GP to halt when encountered.
Definition: gx.c:1581
void GX_LoadPosMtxImm(Mtx mt, u32 pnidx)
Used to load a 3x4 modelview matrix mt into matrix memory at location pnidx.
Definition: gx.c:2848
void GX_SetAlphaCompare(u8 comp0, u8 ref0, u8 aop, u8 comp1, u8 ref1)
Sets the parameters for the alpha compare function which uses the alpha output from the last active T...
Definition: gx.c:3952
void GX_GetVtxDescv(GXVtxDesc *attr_list)
Gets the type of multiple attributes.
Definition: gx.c:2365
f32 a0
Definition: gx_regdef.h:5094
GLfloat bias
Definition: glext.h:8812
void GX_SetChanCtrl(s32 channel, u8 enable, u8 ambsrc, u8 matsrc, u8 litmask, u8 diff_fn, u8 attn_fn)
Sets the lighting controls for a particular color channel.
Definition: gx.c:2169
u32 GX_ReadClksPerVtx()
Definition: gx.c:4997
void GX_SetTevKColorSel(u8 tevstage, u8 sel)
Selects a "konstant" color input to be used in a given TEV stage.
Definition: gx.c:3959
f32 k2
Definition: gx_regdef.h:5099
GLint GLint GLint GLint GLint GLint y
Definition: glext.h:6295
void GX_SetDispCopyDst(u16 wd, u16 ht)
Sets the witdth and height of the display buffer in pixels.
Definition: gx.c:1972
u8 GX_GetTexObjWrapS(GXTexObj *obj)
Returns the texture wrap s mode described by texture object obj.
Definition: gx.c:2946
u16 size_even
Definition: gx_regdef.h:5094
vf32 F32
Definition: gx.h:1186
static void GX_Position2f32(f32 x, f32 y)
Definition: gx.h:2166
u16 GX_GetTexObjHeight(GXTexObj *obj)
Returns the texture height described by texture object obj.
Definition: gx.c:2956
void GX_SetTexCopyDst(u16 wd, u16 ht, u32 fmt, u8 mipmap)
This function sets the width and height of the destination texture buffer in texels.
Definition: gx.c:2081
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
void GX_LoadTexObjPreloaded(GXTexObj *obj, GXTexRegion *region, u8 mapid)
Loads the state describing a preloaded texture into one of eight hardware register sets.
Definition: gx.c:3356
void GX_InitTexObjLOD(GXTexObj *obj, u8 minfilt, u8 magfilt, f32 minlod, f32 maxlod, f32 lodbias, u8 biasclamp, u8 edgelod, u8 maxaniso)
Sets texture Level Of Detail (LOD) controls explicitly for a texture object.
Definition: gx.c:3220
void GX_ClearBoundingBox()
Clears the bounding box values before a new image is drawn.
Definition: gx.c:2102
GLenum clamp
Definition: glext.h:6856
void GX_SetTevColor(u8 tev_regid, GXColor color)
Used to set one of the primary color registers in the TEV unit.
Definition: gx.c:3688
static void GX_Color3f32(f32 r, f32 g, f32 b)
Definition: gx.h:2252
static void check(LexState *ls, int c)
Definition: lparser.c:106
f32 a2
Definition: gx_regdef.h:5096
u8 b
Definition: gx.h:1195
void GX_InitTexObjEdgeLOD(GXTexObj *obj, u8 edgelod)
Changes LOD computing mode.
Definition: gx.c:3310
static void GX_MatrixIndex1x8(u8 index)
Definition: gx.h:2344
static void GX_Position3s16(s16 x, s16 y, s16 z)
Definition: gx.h:2145
void GX_DisableBreakPt()
Allows reads from the FIFO currently attached to the Graphics Processor (GP) to resume.
Definition: gx.c:1595
void GX_PokeAlphaMode(u8 func, u8 threshold)
Sets a threshold which is compared to the alpha of pixels written to the Embedded Frame Buffer (EFB) ...
Definition: gx.c:4346
GXTexRegion *(* GXTexRegionCallback)(GXTexObj *obj, u8 mapid)
function pointer typedef for the texture region callback
Definition: gx.h:1354
GXTlutRegionCallback GX_SetTlutRegionCallback(GXTlutRegionCallback cb)
Sets the callback function called by GX_LoadTlut() to find the region into which to load the TLUT.
Definition: gx.c:3635
u32 rgba
Definition: gx.h:1282
GLint GLint xoffset
Definition: glext.h:6294
void GX_EnableTexOffsets(u8 coord, u8 line_enable, u8 point_enable)
Enables a special texture offset feature for points and lines.
Definition: gx.c:3857
void GX_SetDispCopySrc(u16 left, u16 top, u16 wd, u16 ht)
Sets the source parameters for the EFB to XFB copy operation.
Definition: gx.c:1978
u16 s
Definition: gx.h:1281
void GX_LoadNrmMtxIdx3x3(u16 mtxidx, u32 pnidx)
Loads a 3x3 normal matrix into matrix memory at location pnidx from a 3x3 matrix located at index mtx...
Definition: gx.c:2872
void GX_Flush()
Flushes all commands to the GP.
Definition: gx.c:1564
void * GX_GetTexObjData(GXTexObj *obj)
Used to get a pointer to texture data from the GXTexObj structure.
Definition: gx.c:2941
void GX_CallDispList(void *list, u32 nbytes)
Causes the GP to execute graphics commands from the display list instead of from the GP FIFO.
Definition: gx.c:2156
void GX_SetTevKAlphaSel(u8 tevstage, u8 sel)
Selects a "konstant" alpha input to be used in a given TEV stage.
Definition: gx.c:3970
u8 a
Definition: gx.h:1196
void GX_PeekZ(u16 x, u16 y, u32 *z)
Allows the CPU to read a z value directly from the Embedded Frame Buffer (EFB) at position x,...
Definition: gx.c:4429
int16_t s16
16bit signed integer
Definition: gctypes.h:23
void GX_SetCPUFifo(GXFifoObj *fifo)
Attaches a FIFO to the CPU.
Definition: gx.c:1274
GLuint index
Definition: glext.h:6671
vs16 S16
Definition: gx.h:1183
void GX_SetLineWidth(u8 width, u8 fmt)
Sets the width of line primitives.
Definition: gx.c:3674
f32 a1
Definition: gx_regdef.h:5095
void GX_SetArray(u32 attr, void *ptr, u8 stride)
Sets the array base pointer and stride for a single attribute.
Definition: gx.c:2259
void GX_AbortFrame()
Aborts the current frame.
void GX_LoadTlut(GXTlutObj *obj, u32 tlut_name)
Copies a Texture Look-Up Table (TLUT) from main memory to Texture Memory (TMEM).
Definition: gx.c:3561
u8 GX_GetTexObjWrapT(GXTexObj *obj)
Returns the texture wrap t mode described by texture object obj.
Definition: gx.c:2951
void GX_GetFifoPtrs(GXFifoObj *fifo, void **rd_ptr, void **wt_ptr)
Returns the current value of the Graphics FIFO read and write pointers.
Definition: gx.c:1267
void GX_SetDrawSync(u16 token)
This function sends a token into the command stream.
Definition: gx.c:1630
u16 t
Definition: gx.h:1281
void GX_SetTexCoordBias(u8 texcoord, u8 s_enable, u8 t_enable)
Sets the texture coordinate bias of a particular texture.
Definition: gx.c:3608
void GX_SetTevColorOp(u8 tevstage, u8 tevop, u8 tevbias, u8 tevscale, u8 clamp, u8 tevregid)
Sets the tevop, tevbias, tevscale and clamp-mode operation for the color combiner for this tevstage o...
Definition: gx.c:3806
void GX_LoadLightObjIdx(u32 litobjidx, u8 litid)
Instructs the GP to fetch the light object at ltobjindx from an array.
Definition: gx.c:4543
lwp_t GX_SetCurrentGXThread()
Sets the current GX thread to the calling thread.
Definition: gx.c:1495
static void GX_TexCoord2f32(f32 s, f32 t)
Definition: gx.h:2279
#define GX_FIFO_OBJSIZE
Definition: gx.h:29
vu32 wt_ptr
Definition: gx_regdef.h:5098
void GX_InitLightSpot(GXLightObj *lit_obj, f32 cut_off, u8 spotfn)
Sets coefficients for angular (spotlight) attenuation in light object.
Definition: gx.c:4708
u32 col
Definition: gx_regdef.h:5093
void GX_InitTlutRegion(GXTlutRegion *region, u32 tmem_addr, u8 tlut_sz)
Initializes a Texture Look-Up Table (TLUT) region object.
Definition: gx.c:3124
void GX_BeginDispList(void *list, u32 size)
Begins a display list and disables writes to the FIFO currently attached to the CPU.
Definition: gx.c:2108
void GX_SetNumIndStages(u8 nstages)
Used to set how many indirect lookups will take place.
Definition: gx.c:4014
GLboolean GLboolean g
Definition: glext.h:6844
Definition: ibxm.c:40
void GX_SetTevIndTile(u8 tevstage, u8 indtexid, u16 tilesize_x, u16 tilesize_y, u16 tilespacing_x, u16 tilespacing_y, u8 indtexfmt, u8 indtexmtx, u8 bias_sel, u8 alpha_sel)
Used to implement tiled texturing using indirect textures.
Definition: gx.c:4113
GLuint color
Definition: glext.h:6883
struct _gx_tlutreg GXTlutRegion
Object containing information on a TLUT cache region.
void GX_InitTexObjMinLOD(GXTexObj *obj, f32 minlod)
Sets the minimum LOD for a given texture.
Definition: gx.c:3274
void GX_SetTevColorIn(u8 tevstage, u8 a, u8 b, u8 c, u8 d)
Sets the color input sources for one tevstage of the Texture Environment (TEV) color combiner.
Definition: gx.c:3784
void GX_SetIndTexOrder(u8 indtexstage, u8 texcoord, u8 texmap)
Used to specify the texcoord and texmap to used with a given indirect lookup.
Definition: gx.c:4448
void GX_InitSpecularDirHA(GXLightObj *lit_obj, f32 nx, f32 ny, f32 nz, f32 hx, f32 hy, f32 hz)
Sets the direction and half-angle vector of a specular light in the light object.
Definition: gx.c:4662
void GX_PokeDstAlpha(u8 enable, u8 a)
Sets a constant alpha value for writing to the Embedded Frame Buffer (EFB).
Definition: gx.c:4356
void GX_SetTevDirect(u8 tevstage)
Used to turn off all indirect texture processing for the specified regular TEV stage.
Definition: gx.c:4009
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glext.h:6293
void GX_SetDispCopyFrame2Field(u8 mode)
Determines which lines are read from the Embedded Frame Buffer (EFB) when using GX_CopyDisp().
Definition: gx.c:1955
void GX_SetFog(u8 type, f32 startz, f32 endz, f32 nearz, f32 farz, GXColor col)
Enables fog.
Definition: gx.c:4149
void GX_SetDither(u8 dither)
Enables or disables dithering.
Definition: gx.c:4315
void GX_SetViewport(f32 xOrig, f32 yOrig, f32 wd, f32 ht, f32 nearZ, f32 farZ)
Sets the viewport rectangle in screen coordinates.
Definition: gx.c:1769
GLint GLint GLsizei width
Definition: glext.h:6293
f32 y
Definition: gx.h:1280
u32 GX_GetTexBufferSize(u16 wd, u16 ht, u32 fmt, u8 mipmap, u8 maxlod)
Returns the amount of memory in bytes needed to store a texture of the given size and fmt.
Definition: gx.c:2979
GLfloat GLfloat GLfloat GLfloat nx
Definition: glext.h:9805
void GX_SetTevKColor(u8 sel, GXColor col)
Sets one of the "konstant" color registers in the TEV unit.
Definition: gx.c:3718
void GX_InitFifoPtrs(GXFifoObj *fifo, void *rd_ptr, void *wt_ptr)
Sets the fifo read and write pointers.
Definition: gx.c:1249
struct _gx_texobj GXTexObj
Object containing information about a texture.
void GX_InitTexObjWrapMode(GXTexObj *obj, u8 wrap_s, u8 wrap_t)
Allows one to modify the texture coordinate wrap modes for an existing texture object.
Definition: gx.c:3257
static void GX_Color4u8(u8 r, u8 g, u8 b, u8 a)
Definition: gx.h:2237
void(* GXBreakPtCallback)(void)
function pointer typedef for the GP breakpoint-token callback
Definition: gx.h:1337
void GX_SetVtxAttrFmtv(u8 vtxfmt, GXVtxAttrFmt *attr_list)
Sets multiple attribute formats within a single vertex format.
Definition: gx.c:2605
f32 z
Definition: gx.h:1280
Definition: gx.h:1202
volatile u32 vu32
32bit unsigned volatile integer
Definition: gctypes.h:29
void(* GXDrawDoneCallback)(void)
function pointer typedef for the GP drawdone-token callback
Definition: gx.h:1342
void GX_PreloadEntireTexture(GXTexObj *obj, GXTexRegion *region)
Loads a given texture from DRAM into the texture memory.
Definition: gx.c:3394
void GX_PokeAlphaUpdate(u8 update_enable)
Enables or disables alpha-buffer updates for GX_Poke*() functions.
Definition: gx.c:4361
void GX_SetGPFifo(GXFifoObj *fifo)
Attaches fifo to the GP.
Definition: gx.c:1357
static void GX_TexCoord1s8(s8 s)
Definition: gx.h:2329
f32 k0
Definition: gx_regdef.h:5097
static void GX_Color1u16(u16 clr)
Definition: gx.h:2264
GLsizei const GLfloat * value
Definition: glext.h:6709
u32 GX_GetFifoSize(GXFifoObj *fifo)
Get the size of a given fifo.
Definition: gx.c:1463
void GX_SetCopyFilter(u8 aa, u8 sample_pattern[12][2], u8 vf, u8 vfilter[7])
Sets the subpixel sample patterns and vertical filter coefficients used to filter subpixels into pixe...
Definition: gx.c:1892
u16 size_odd
Definition: gx_regdef.h:5095
void GX_SetScissor(u32 xOrigin, u32 yOrigin, u32 wd, u32 ht)
Sets the scissor rectangle.
Definition: gx.c:3870
struct _gx_tlutobj GXTlutObj
Object containing information on a TLUT.
void GX_LoadTexMtxImm(Mtx mt, u32 texidx, u8 type)
Loads a texture matrix mt into the matrix memory at location texidx.
Definition: gx.c:2878
GLsizei stride
Definition: glext.h:6488
static void GX_Position2s16(s16 x, s16 y)
Definition: gx.h:2178
GLfloat GLfloat nz
Definition: glext.h:9803
void GX_InitLightColor(GXLightObj *lit_obj, GXColor col)
Sets the color of the light in the light object.
Definition: gx.c:4481
static void GX_TexCoord2s16(s16 s, s16 t)
Definition: gx.h:2291
void GX_SetFieldMask(u8 even_mask, u8 odd_mask)
selectively enables and disables interlacing of the frame buffer image.
Definition: gx.c:4328
vu16 U16
Definition: gx.h:1182
static void field(LexState *ls, struct ConsControl *cc)
Definition: lparser.c:702
static void GX_Color1x16(u16 index)
Definition: gx.h:2274
volatile s16 vs16
16bit signed volatile integer
Definition: gctypes.h:33
void GX_WaitDrawDone()
Stalls until DrawDone is encountered by the GP.
Definition: gx.c:1656
void GX_SetFieldMode(u8 field_mode, u8 half_aspect_ratio)
Controls various rasterization and texturing parameters that relate to field-mode and double-strike r...
Definition: gx.c:4336
static void GX_Color3u8(u8 r, u8 g, u8 b)
Definition: gx.h:2245
GLint left
Definition: glext.h:8393
Definition: gx.h:1275
void GX_ClearGPMetric()
Clears the two virtual GP performance counters to zero.
Definition: gx.c:4978
static void GX_TexCoord1u8(u8 s)
Definition: gx.h:2324
void GX_SetTevAlphaIn(u8 tevstage, u8 a, u8 b, u8 c, u8 d)
Sets the alpha input sources for one tevstage of the Texture Environment (TEV) alpha combiner.
Definition: gx.c:3795
void GX_SetCopyClear(GXColor color, u32 zvalue)
Sets color and Z value to clear the EFB to during copy operations.
Definition: gx.c:1867
void GX_SetTexCoordGen2(u16 texcoord, u32 tgen_typ, u32 tgen_src, u32 mtxsrc, u32 normalize, u32 postmtx)
An extension of GX_SetTexCoordGen(). It allows one to specify additional texgen options.
Definition: gx.c:2634
void(* GXDrawSyncCallback)(u16 token)
function pointer typedef for the drawsync-token callback
Definition: gx.h:1348
uint8_t u8
8bit unsigned integer
Definition: gctypes.h:17
void GX_PokeZMode(u8 comp_enable, u8 func, u8 update_enable)
Sets the Z-buffer compare mode when writing the Embedded Frame Buffer (EFB).
Definition: gx.c:4439
void GX_InitLightDir(GXLightObj *lit_obj, f32 nx, f32 ny, f32 nz)
Sets the direction of a light in the light object.
Definition: gx.c:4586
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
void GX_GetTexObjAll(GXTexObj *obj, void **image_ptr, u16 *width, u16 *height, u8 *format, u8 *wrap_s, u8 *wrap_t, u8 *mipmap)
Returns the parameters described by a texture object. Texture objects are used to describe all the pa...
Definition: gx.c:2967
lwp_t GX_GetCurrentGXThread()
Returns the current GX thread.
Definition: gx.c:1490
void GX_SetTevSwapModeTable(u8 swapid, u8 r, u8 g, u8 b, u8 a)
Sets up the TEV color swap table.
Definition: gx.c:3989
void GX_SetGPMetric(u32 perf0, u32 perf1)
Sets two performance metrics to measure in the GP.
Definition: gx.c:4765
union _wgpipe WGPipe
void GX_SetTevIndBumpST(u8 tevstage, u8 indstage, u8 mtx_sel)
Sets up an environment-mapped bump-mapped indirect lookup.
Definition: gx.c:4049
u16 GX_GetTexObjWidth(GXTexObj *obj)
Returns the texture width described by texture object obj.
Definition: gx.c:2961
u32 GX_GetTexObjMipMap(GXTexObj *obj)
Returns the texture mipmap enable described by texture object obj.
Definition: gx.c:2937
GLint GLint GLint yoffset
Definition: glext.h:6294
void GX_SetBlendMode(u8 type, u8 src_fact, u8 dst_fact, u8 op)
Determines how the source image, generated by the graphics processor, is blended with the Embedded Fr...
Definition: gx.c:3648
void GX_InitTexObjUserData(GXTexObj *obj, void *userdata)
Used to set a pointer to user data in the GXTexObj structure.
Definition: gx.c:3322
static void GX_Position1x16(u16 index)
Definition: gx.h:2201
void GX_PokeColorUpdate(u8 update_enable)
Enables or disables color-buffer updates when writing the Embedded Frame Buffer (EFB) using the GX_Po...
Definition: gx.c:4366
static void GX_TexCoord2s8(s8 s, s8 t)
Definition: gx.h:2303
f32 GX_GetYScaleFactor(u16 efbHeight, u16 xfbHeight)
Calculates an appropriate Y scale factor value for GX_SetDispCopyYScale() based on the height of the ...
Definition: gx.c:5067
GXTlutRegion *(* GXTlutRegionCallback)(u32 tlut_name)
function pointer typedef for the TLUT region callback
Definition: gx.h:1360
void GX_SetNumTevStages(u8 num)
Enables a consecutive number of TEV stages.
Definition: gx.c:3946
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6844
volatile u16 vu16
16bit unsigned volatile integer
Definition: gctypes.h:28
static void GX_TexCoord1s16(s16 s)
Definition: gx.h:2319
void GX_InvalidateTexRegion(GXTexRegion *region)
Invalidates the texture cache in Texture Memory (TMEM) described by region.
Definition: gx.c:3526
void GX_SetNumChans(u8 num)
Sets the number of color channels that are output to the TEV stages.
Definition: gx.c:3895
GLint GLint GLsizei GLsizei height
Definition: glext.h:6293
void GX_SetTexCoordGen(u16 texcoord, u32 tgen_typ, u32 tgen_src, u32 mtxsrc)
Specifies how texture coordinates are generated.
Definition: gx.c:2629
struct _vtx Vtx
GLsizei GLsizei GLuint * obj
Definition: glext.h:6682
Definition: gx.h:1323
void GX_SetCopyClamp(u8 clamp)
Sets the vertical clamping mode to use during the EFB to XFB or texture copy.
Definition: gx.c:1881
struct _gx_texreg GXTexRegion
Object containing information on a texture cache region.
GXDrawDoneCallback GX_SetDrawDoneCallback(GXDrawDoneCallback cb)
Installs a callback that is invoked whenever a DrawDone command is encountered by the GP.
Definition: gx.c:1681
static void GX_TexCoord1x8(u8 index)
Definition: gx.h:2334
void GX_InitLightAttnA(GXLightObj *lit_obj, f32 a0, f32 a1, f32 a2)
Sets coefficients used in the lighting angle attenuation calculation in a given light object.
Definition: gx.c:4644