1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
|
#ifndef __GXENUM_H__
#define __GXENUM_H__
/********************************/
#ifdef __cplusplus
extern "C" {
#endif
/********************************/
typedef u8 GXBool;
/********************************/
#define GX_TRUE ((GXBool)1)
#define GX_FALSE ((GXBool)0)
#define GX_ENABLE ((GXBool)1)
#define GX_DISABLE ((GXBool)0)
/********************************/
typedef enum _GXAttr
{
GX_VA_PNMTXIDX = 0, // position/normal matrix index
GX_VA_TEX0MTXIDX, // texture 0 matrix index
GX_VA_TEX1MTXIDX, // texture 1 matrix index
GX_VA_TEX2MTXIDX, // texture 2 matrix index
GX_VA_TEX3MTXIDX, // texture 3 matrix index
GX_VA_TEX4MTXIDX, // texture 4 matrix index
GX_VA_TEX5MTXIDX, // texture 5 matrix index
GX_VA_TEX6MTXIDX, // texture 6 matrix index
GX_VA_TEX7MTXIDX, // texture 7 matrix index
GX_VA_POS = 9, // position
GX_VA_NRM, // normal
GX_VA_CLR0, // color 0
GX_VA_CLR1, // color 1
GX_VA_TEX0, // input texture coordinate 0
GX_VA_TEX1, // input texture coordinate 1
GX_VA_TEX2, // input texture coordinate 2
GX_VA_TEX3, // input texture coordinate 3
GX_VA_TEX4, // input texture coordinate 4
GX_VA_TEX5, // input texture coordinate 5
GX_VA_TEX6, // input texture coordinate 6
GX_VA_TEX7, // input texture coordinate 7
GX_POS_MTX_ARRAY, // position matrix array pointer
GX_NRM_MTX_ARRAY, // normal matrix array pointer
GX_TEX_MTX_ARRAY, // texture matrix array pointer
GX_LIGHT_ARRAY, // light parameter array pointer
GX_VA_NBT, // normal, bi-normal, tangent
GX_VA_MAX_ATTR, // maximum number of vertex attributes
GX_VA_NULL = 0xff // NULL attribute (to mark end of lists)
} GXAttr;
#define GX_MAX_VTXDESC GX_VA_MAX_ATTR
#define GX_MAX_VTXDESCLIST_SZ (GX_MAX_VTXDESC+1) // +1 for GX_VA_NULL
#define GX_MAX_VTXATTRFMT GX_VA_MAX_ATTR
#define GX_MAX_VTXATTRFMTLIST_SZ (GX_MAX_VTXATTRFMT+1) // +1 for GX_VA_NULL
#define GX_MAX_VTXARRAY 16
/********************************/
typedef enum _GXVtxFmt
{
GX_VTXFMT0 = 0,
GX_VTXFMT1,
GX_VTXFMT2,
GX_VTXFMT3,
GX_VTXFMT4,
GX_VTXFMT5,
GX_VTXFMT6,
GX_VTXFMT7,
GX_MAX_VTXFMT
} GXVtxFmt;
#define GX_MAX_VTXFMT GX_MAX_VTXFMT
/********************************/
typedef enum _GXAttrType
{
GX_NONE = 0,
GX_DIRECT,
GX_INDEX8,
GX_INDEX16
} GXAttrType;
/********************************/
typedef enum _GXTexCoordID
{
GX_TEXCOORD0 = 0x0, // generated texture coordinate 0
GX_TEXCOORD1, // generated texture coordinate 1
GX_TEXCOORD2, // generated texture coordinate 2
GX_TEXCOORD3, // generated texture coordinate 3
GX_TEXCOORD4, // generated texture coordinate 4
GX_TEXCOORD5, // generated texture coordinate 5
GX_TEXCOORD6, // generated texture coordinate 6
GX_TEXCOORD7, // generated texture coordinate 7
GX_MAX_TEXCOORD = 8,
GX_TEXCOORD_NULL = 0xff
} GXTexCoordID;
#define GX_MAX_TEXCOORDGEN GX_MAX_TEXCOORD
/********************************/
typedef enum _GXTexGenType
{
GX_TG_MTX3x4 = 0,
GX_TG_MTX2x4,
GX_TG_BUMP0,
GX_TG_BUMP1,
GX_TG_BUMP2,
GX_TG_BUMP3,
GX_TG_BUMP4,
GX_TG_BUMP5,
GX_TG_BUMP6,
GX_TG_BUMP7,
GX_TG_SRTG
} GXTexGenType;
/********************************/
typedef enum _GXTexGenSrc
{
GX_TG_POS = 0,
GX_TG_NRM,
GX_TG_BINRM,
GX_TG_TANGENT,
GX_TG_TEX0,
GX_TG_TEX1,
GX_TG_TEX2,
GX_TG_TEX3,
GX_TG_TEX4,
GX_TG_TEX5,
GX_TG_TEX6,
GX_TG_TEX7,
GX_TG_TEXCOORD0,
GX_TG_TEXCOORD1,
GX_TG_TEXCOORD2,
GX_TG_TEXCOORD3,
GX_TG_TEXCOORD4,
GX_TG_TEXCOORD5,
GX_TG_TEXCOORD6,
GX_TG_COLOR0,
GX_TG_COLOR1
} GXTexGenSrc;
/********************************/
typedef enum _GXCompCnt
{
#if ( GX_REV == 1 )
GX_POS_XY = 0,
GX_POS_XYZ = 1,
GX_NRM_XYZ = 0,
GX_NRM_NBT = 1, // not really used, just to make api consistent
GX_CLR_RGB = 0,
GX_CLR_RGBA = 1,
GX_TEX_S = 0,
GX_TEX_ST = 1
#else // ( GX_REV >= 2 )
GX_POS_XY = 0,
GX_POS_XYZ = 1,
GX_NRM_XYZ = 0,
GX_NRM_NBT = 1, // one index per NBT
GX_NRM_NBT3 = 2, // one index per each of N/B/T
GX_CLR_RGB = 0,
GX_CLR_RGBA = 1,
GX_TEX_S = 0,
GX_TEX_ST = 1
#endif
} GXCompCnt;
/********************************/
typedef enum _GXCompType
{
GX_U8 = 0,
GX_S8 = 1,
GX_U16 = 2,
GX_S16 = 3,
GX_F32 = 4,
GX_RGB565 = 0,
GX_RGB8 = 1,
GX_RGBX8 = 2,
GX_RGBA4 = 3,
GX_RGBA6 = 4,
GX_RGBA8 = 5
} GXCompType;
/********************************/
typedef enum _GXChannelID
{
GX_COLOR0,
GX_COLOR1,
GX_ALPHA0,
GX_ALPHA1,
GX_COLOR0A0, // Color 0 + Alpha 0
GX_COLOR1A1, // Color 1 + Alpha 1
GX_COLOR_ZERO, // RGBA = 0
GX_ALPHA_BUMP, // bump alpha 0-248, RGB=0
GX_ALPHA_BUMPN, // normalized bump alpha, 0-255, RGB=0
GX_COLOR_NULL = 0xff
} GXChannelID;
/********************************/
typedef enum _GXColorSrc
{
GX_SRC_REG = 0,
GX_SRC_VTX
} GXColorSrc;
/********************************/
typedef enum _GXLightID
{
GX_LIGHT0 = 0x001,
GX_LIGHT1 = 0x002,
GX_LIGHT2 = 0x004,
GX_LIGHT3 = 0x008,
GX_LIGHT4 = 0x010,
GX_LIGHT5 = 0x020,
GX_LIGHT6 = 0x040,
GX_LIGHT7 = 0x080,
GX_MAX_LIGHT = 0x100,
GX_LIGHT_NULL = 0x000
} GXLightID;
/********************************/
typedef enum _GXDiffuseFn
{
GX_DF_NONE = 0,
GX_DF_SIGN,
GX_DF_CLAMP
} GXDiffuseFn;
/********************************/
typedef enum _GXAttnFn
{
GX_AF_SPEC = 0, // use specular attenuation
GX_AF_SPOT = 1, // use distance/spotlight attenuation
GX_AF_NONE // attenuation is off
} GXAttnFn;
/********************************/
typedef enum _GXSpotFn
{
GX_SP_OFF = 0,
GX_SP_FLAT,
GX_SP_COS,
GX_SP_COS2,
GX_SP_SHARP,
GX_SP_RING1,
GX_SP_RING2
} GXSpotFn;
/********************************/
typedef enum _GXDistAttnFn
{
GX_DA_OFF = 0,
GX_DA_GENTLE,
GX_DA_MEDIUM,
GX_DA_STEEP
} GXDistAttnFn;
/********************************/
typedef enum _GXPosNrmMtx
{
GX_PNMTX0 = 0,
GX_PNMTX1 = 3,
GX_PNMTX2 = 6,
GX_PNMTX3 = 9,
GX_PNMTX4 = 12,
GX_PNMTX5 = 15,
GX_PNMTX6 = 18,
GX_PNMTX7 = 21,
GX_PNMTX8 = 24,
GX_PNMTX9 = 27
} GXPosNrmMtx;
/********************************/
typedef enum _GXTexMtx
{
GX_TEXMTX0 = 30,
GX_TEXMTX1 = 33,
GX_TEXMTX2 = 36,
GX_TEXMTX3 = 39,
GX_TEXMTX4 = 42,
GX_TEXMTX5 = 45,
GX_TEXMTX6 = 48,
GX_TEXMTX7 = 51,
GX_TEXMTX8 = 54,
GX_TEXMTX9 = 57,
GX_IDENTITY = 60
} GXTexMtx;
/********************************/
#if ( GX_REV != 1 ) // Revision 2 or greater only
typedef enum _GXPTTexMtx
{
GX_PTTEXMTX0 = 64,
GX_PTTEXMTX1 = 67,
GX_PTTEXMTX2 = 70,
GX_PTTEXMTX3 = 73,
GX_PTTEXMTX4 = 76,
GX_PTTEXMTX5 = 79,
GX_PTTEXMTX6 = 82,
GX_PTTEXMTX7 = 85,
GX_PTTEXMTX8 = 88,
GX_PTTEXMTX9 = 91,
GX_PTTEXMTX10 = 94,
GX_PTTEXMTX11 = 97,
GX_PTTEXMTX12 = 100,
GX_PTTEXMTX13 = 103,
GX_PTTEXMTX14 = 106,
GX_PTTEXMTX15 = 109,
GX_PTTEXMTX16 = 112,
GX_PTTEXMTX17 = 115,
GX_PTTEXMTX18 = 118,
GX_PTTEXMTX19 = 121,
GX_PTIDENTITY = 125
} GXPTTexMtx;
#endif // ( GX_REV != 1 )
/********************************/
typedef enum _GXTexMtxType
{
GX_MTX3x4 = 0,
GX_MTX2x4
} GXTexMtxType;
/********************************/
typedef enum _GXPrimitive
{
GX_POINTS = 0xb8,
GX_LINES = 0xa8,
GX_LINESTRIP = 0xb0,
GX_TRIANGLES = 0x90,
GX_TRIANGLESTRIP = 0x98,
GX_TRIANGLEFAN = 0xa0,
GX_QUADS = 0x80
} GXPrimitive;
/********************************/
typedef enum _GXTexOffset
{
GX_TO_ZERO,
GX_TO_SIXTEENTH,
GX_TO_EIGHTH,
GX_TO_FOURTH,
GX_TO_HALF,
GX_TO_ONE,
GX_MAX_TEXOFFSET
} GXTexOffset;
/********************************/
typedef enum _GXCullMode
{
GX_CULL_NONE,
GX_CULL_FRONT,
GX_CULL_BACK,
GX_CULL_ALL
} GXCullMode;
/********************************/
typedef enum _GXClipMode
{
// Note: these are (by design) backwards of typical enable/disables!
GX_CLIP_ENABLE = 0,
GX_CLIP_DISABLE = 1
} GXClipMode;
/********************************/
typedef enum _GXTexWrapMode
{
GX_CLAMP,
GX_REPEAT,
GX_MIRROR,
GX_MAX_TEXWRAPMODE
} GXTexWrapMode;
/********************************/
typedef enum _GXTexFilter
{
GX_NEAR,
GX_LINEAR,
GX_NEAR_MIP_NEAR,
GX_LIN_MIP_NEAR,
GX_NEAR_MIP_LIN,
GX_LIN_MIP_LIN
} GXTexFilter;
/********************************/
typedef enum _GXCITexFmt
{
GX_TF_C4 = 0x8,
GX_TF_C8 = 0x9,
GX_TF_C14X2 = 0xa
} GXCITexFmt;
/********************************/
typedef enum _GXTexFmt
{
#if ( GX_REV == 1 )
GX_TF_I4 = 0x0,
GX_TF_I8 = 0x1,
GX_TF_IA4 = 0x2,
GX_TF_IA8 = 0x3,
GX_TF_RGB565 = 0x4,
GX_TF_RGB5A3 = 0x5,
GX_TF_RGBA8 = 0x6,
GX_TF_CMPR = 0xE,
GX_TF_A8 = (0x20 | GX_TF_I8),
GX_TF_Z8 = (0x10 | GX_TF_I8),
GX_TF_Z16 = (0x10 | GX_TF_IA8),
GX_TF_Z24X8 = (0x10 | GX_TF_RGBA8)
#else // ( GX_REV >= 2 )
#define _GX_TF_CTF 0x20 /* copy-texture-format only */
#define _GX_TF_ZTF 0x10 /* Z-texture-format */
GX_TF_I4 = 0x0,
GX_TF_I8 = 0x1,
GX_TF_IA4 = 0x2,
GX_TF_IA8 = 0x3,
GX_TF_RGB565 = 0x4,
GX_TF_RGB5A3 = 0x5,
GX_TF_RGBA8 = 0x6,
GX_TF_CMPR = 0xE,
GX_CTF_R4 = 0x0 | _GX_TF_CTF,
GX_CTF_RA4 = 0x2 | _GX_TF_CTF,
GX_CTF_RA8 = 0x3 | _GX_TF_CTF,
GX_CTF_YUVA8 = 0x6 | _GX_TF_CTF,
GX_CTF_A8 = 0x7 | _GX_TF_CTF,
GX_CTF_R8 = 0x8 | _GX_TF_CTF,
GX_CTF_G8 = 0x9 | _GX_TF_CTF,
GX_CTF_B8 = 0xA | _GX_TF_CTF,
GX_CTF_RG8 = 0xB | _GX_TF_CTF,
GX_CTF_GB8 = 0xC | _GX_TF_CTF,
GX_TF_Z8 = 0x1 | _GX_TF_ZTF,
GX_TF_Z16 = 0x3 | _GX_TF_ZTF,
GX_TF_Z24X8 = 0x6 | _GX_TF_ZTF,
GX_CTF_Z4 = 0x0 | _GX_TF_ZTF | _GX_TF_CTF,
GX_CTF_Z8M = 0x9 | _GX_TF_ZTF | _GX_TF_CTF,
GX_CTF_Z8L = 0xA | _GX_TF_ZTF | _GX_TF_CTF,
GX_CTF_Z16L = 0xC | _GX_TF_ZTF | _GX_TF_CTF,
GX_TF_A8 = GX_CTF_A8 // to keep compatibility
#endif
} GXTexFmt;
/********************************/
typedef enum _GXTlutFmt
{
GX_TL_IA8 = 0x0,
GX_TL_RGB565 = 0x1,
GX_TL_RGB5A3 = 0x2,
GX_MAX_TLUTFMT
} GXTlutFmt;
/********************************/
typedef enum _GXTlutSize
{
GX_TLUT_16 = 1, // number of 16 entry blocks.
GX_TLUT_32 = 2,
GX_TLUT_64 = 4,
GX_TLUT_128 = 8,
GX_TLUT_256 = 16,
GX_TLUT_512 = 32,
GX_TLUT_1K = 64,
GX_TLUT_2K = 128,
GX_TLUT_4K = 256,
GX_TLUT_8K = 512,
GX_TLUT_16K = 1024
} GXTlutSize;
/********************************/
typedef enum _GXTlut
{
// default 256-entry TLUTs
GX_TLUT0 = 0,
GX_TLUT1,
GX_TLUT2,
GX_TLUT3,
GX_TLUT4,
GX_TLUT5,
GX_TLUT6,
GX_TLUT7,
GX_TLUT8,
GX_TLUT9,
GX_TLUT10,
GX_TLUT11,
GX_TLUT12,
GX_TLUT13,
GX_TLUT14,
GX_TLUT15,
GX_BIGTLUT0,
GX_BIGTLUT1,
GX_BIGTLUT2,
GX_BIGTLUT3
} GXTlut;
/********************************/
typedef enum _GXTexMapID
{
GX_TEXMAP0,
GX_TEXMAP1,
GX_TEXMAP2,
GX_TEXMAP3,
GX_TEXMAP4,
GX_TEXMAP5,
GX_TEXMAP6,
GX_TEXMAP7,
GX_MAX_TEXMAP,
GX_TEXMAP_NULL = 0xff,
GX_TEX_DISABLE = 0x100 // mask : disables texture look up
} GXTexMapID;
#define GX_MAX_TEXMAPS GX_MAX_TEXMAP
/********************************/
typedef enum _GXTexCacheSize
{
GX_TEXCACHE_32K,
GX_TEXCACHE_128K,
GX_TEXCACHE_512K,
GX_TEXCACHE_NONE
} GXTexCacheSize;
/********************************/
typedef enum _GXIndTexFormat
{
GX_ITF_8, // 8 bit texture offsets.
GX_ITF_5, // 5 bit texture offsets.
GX_ITF_4, // 4 bit texture offsets.
GX_ITF_3, // 3 bit texture offsets.
GX_MAX_ITFORMAT
} GXIndTexFormat;
/********************************/
typedef enum _GXIndTexBiasSel
{
GX_ITB_NONE,
GX_ITB_S,
GX_ITB_T,
GX_ITB_ST,
GX_ITB_U,
GX_ITB_SU,
GX_ITB_TU,
GX_ITB_STU,
GX_MAX_ITBIAS
} GXIndTexBiasSel;
/********************************/
typedef enum _GXIndTexAlphaSel
{
GX_ITBA_OFF,
GX_ITBA_S,
GX_ITBA_T,
GX_ITBA_U,
GX_MAX_ITBALPHA
} GXIndTexAlphaSel;
/********************************/
typedef enum _GXIndTexMtxID
{
GX_ITM_OFF,
GX_ITM_0,
GX_ITM_1,
GX_ITM_2,
GX_ITM_S0 = 5,
GX_ITM_S1,
GX_ITM_S2,
GX_ITM_T0 = 9,
GX_ITM_T1,
GX_ITM_T2
} GXIndTexMtxID;
/********************************/
typedef enum _GXIndTexWrap
{
GX_ITW_OFF, // no wrapping
GX_ITW_256, // wrap 256
GX_ITW_128, // wrap 128
GX_ITW_64, // wrap 64
GX_ITW_32, // wrap 32
GX_ITW_16, // wrap 16
GX_ITW_0, // wrap 0
GX_MAX_ITWRAP
} GXIndTexWrap;
/********************************/
typedef enum _GXIndTexScale
{
GX_ITS_1, // Scale by 1.
GX_ITS_2, // Scale by 1/2.
GX_ITS_4, // Scale by 1/4.
GX_ITS_8, // Scale by 1/8.
GX_ITS_16, // Scale by 1/16.
GX_ITS_32, // Scale by 1/32.
GX_ITS_64, // Scale by 1/64.
GX_ITS_128, // Scale by 1/128.
GX_ITS_256, // Scale by 1/256.
GX_MAX_ITSCALE
} GXIndTexScale;
/********************************/
typedef enum _GXIndTexStageID
{
GX_INDTEXSTAGE0, // Indirect Texture Stage Names.
GX_INDTEXSTAGE1,
GX_INDTEXSTAGE2,
GX_INDTEXSTAGE3,
GX_MAX_INDTEXSTAGE
} GXIndTexStageID;
/********************************/
typedef enum _GXTevStageID
{
GX_TEVSTAGE0,
GX_TEVSTAGE1,
GX_TEVSTAGE2,
GX_TEVSTAGE3,
GX_TEVSTAGE4,
GX_TEVSTAGE5,
GX_TEVSTAGE6,
GX_TEVSTAGE7,
GX_TEVSTAGE8,
GX_TEVSTAGE9,
GX_TEVSTAGE10,
GX_TEVSTAGE11,
GX_TEVSTAGE12,
GX_TEVSTAGE13,
GX_TEVSTAGE14,
GX_TEVSTAGE15,
GX_MAX_TEVSTAGE
} GXTevStageID;
#define GX_MAX_TEVSTAGES GX_MAX_TEVSTAGE
/********************************/
typedef enum _GXTevRegID
{
GX_TEVPREV = 0,
GX_TEVREG0,
GX_TEVREG1,
GX_TEVREG2,
GX_MAX_TEVREG
} GXTevRegID;
/********************************/
typedef enum _GXTevOp
{
#if ( GX_REV == 1 )
GX_TEV_ADD,
GX_TEV_SUB
#else // ( GX_REV >= 2 )
GX_TEV_ADD = 0,
GX_TEV_SUB = 1,
GX_TEV_COMP_R8_GT = 8,
GX_TEV_COMP_R8_EQ = 9,
GX_TEV_COMP_GR16_GT = 10,
GX_TEV_COMP_GR16_EQ = 11,
GX_TEV_COMP_BGR24_GT = 12,
GX_TEV_COMP_BGR24_EQ = 13,
GX_TEV_COMP_RGB8_GT = 14,
GX_TEV_COMP_RGB8_EQ = 15,
GX_TEV_COMP_A8_GT = GX_TEV_COMP_RGB8_GT, // for alpha channel
GX_TEV_COMP_A8_EQ = GX_TEV_COMP_RGB8_EQ // for alpha channel
#endif
} GXTevOp;
/********************************/
typedef enum _GXTevColorArg
{
#if ( GX_REV == 1 )
GX_CC_CPREV,
GX_CC_APREV,
GX_CC_C0,
GX_CC_A0,
GX_CC_C1,
GX_CC_A1,
GX_CC_C2,
GX_CC_A2,
GX_CC_TEXC,
GX_CC_TEXA,
GX_CC_RASC,
GX_CC_RASA,
GX_CC_ONE,
GX_CC_HALF,
GX_CC_QUARTER,
GX_CC_ZERO,
GX_CC_TEXRRR,
GX_CC_TEXGGG,
GX_CC_TEXBBB
#else // ( GX_REV >= 2 )
GX_CC_CPREV,
GX_CC_APREV,
GX_CC_C0,
GX_CC_A0,
GX_CC_C1,
GX_CC_A1,
GX_CC_C2,
GX_CC_A2,
GX_CC_TEXC,
GX_CC_TEXA,
GX_CC_RASC,
GX_CC_RASA,
GX_CC_ONE,
GX_CC_HALF,
GX_CC_KONST,
GX_CC_ZERO
#ifndef GX_NO_LEGACY_HW1
, // separator needed only in this case
GX_CC_TEXRRR, // obsolete
GX_CC_TEXGGG, // obsolete
GX_CC_TEXBBB, // obsolete
GX_CC_QUARTER = GX_CC_KONST // obsolete, to keep compatibility
#endif
#endif
} GXTevColorArg;
/********************************/
typedef enum _GXTevAlphaArg
{
#if ( GX_REV == 1 )
GX_CA_APREV,
GX_CA_A0,
GX_CA_A1,
GX_CA_A2,
GX_CA_TEXA,
GX_CA_RASA,
GX_CA_ONE,
GX_CA_ZERO
#else // ( GX_REV >= 2 )
GX_CA_APREV,
GX_CA_A0,
GX_CA_A1,
GX_CA_A2,
GX_CA_TEXA,
GX_CA_RASA,
GX_CA_KONST,
GX_CA_ZERO
#ifndef GX_NO_LEGACY_HW1
, // separator needed only in this case
GX_CA_ONE = GX_CA_KONST // obsolete, to keep compatibility
#endif
#endif
} GXTevAlphaArg;
/********************************/
typedef enum _GXTevBias
{
GX_TB_ZERO,
GX_TB_ADDHALF,
GX_TB_SUBHALF,
GX_MAX_TEVBIAS
} GXTevBias;
/********************************/
typedef enum _GXTevClampMode
{
GX_TC_LINEAR,
GX_TC_GE,
GX_TC_EQ,
GX_TC_LE,
GX_MAX_TEVCLAMPMODE
} GXTevClampMode;
/********************************/
#if ( GX_REV != 1 ) // GX Revision 2 or later only
typedef enum _GXTevKColorID
{
GX_KCOLOR0 = 0,
GX_KCOLOR1,
GX_KCOLOR2,
GX_KCOLOR3,
GX_MAX_KCOLOR
} GXTevKColorID;
#endif // ( GX_REV != 1 )
/********************************/
#if ( GX_REV != 1 ) // GX Revision 2 or later only
typedef enum _GXTevKColorSel
{
GX_TEV_KCSEL_8_8 = 0x00,
GX_TEV_KCSEL_7_8 = 0x01,
GX_TEV_KCSEL_6_8 = 0x02,
GX_TEV_KCSEL_5_8 = 0x03,
GX_TEV_KCSEL_4_8 = 0x04,
GX_TEV_KCSEL_3_8 = 0x05,
GX_TEV_KCSEL_2_8 = 0x06,
GX_TEV_KCSEL_1_8 = 0x07,
GX_TEV_KCSEL_1 = GX_TEV_KCSEL_8_8,
GX_TEV_KCSEL_3_4 = GX_TEV_KCSEL_6_8,
GX_TEV_KCSEL_1_2 = GX_TEV_KCSEL_4_8,
GX_TEV_KCSEL_1_4 = GX_TEV_KCSEL_2_8,
GX_TEV_KCSEL_K0 = 0x0C,
GX_TEV_KCSEL_K1 = 0x0D,
GX_TEV_KCSEL_K2 = 0x0E,
GX_TEV_KCSEL_K3 = 0x0F,
GX_TEV_KCSEL_K0_R = 0x10,
GX_TEV_KCSEL_K1_R = 0x11,
GX_TEV_KCSEL_K2_R = 0x12,
GX_TEV_KCSEL_K3_R = 0x13,
GX_TEV_KCSEL_K0_G = 0x14,
GX_TEV_KCSEL_K1_G = 0x15,
GX_TEV_KCSEL_K2_G = 0x16,
GX_TEV_KCSEL_K3_G = 0x17,
GX_TEV_KCSEL_K0_B = 0x18,
GX_TEV_KCSEL_K1_B = 0x19,
GX_TEV_KCSEL_K2_B = 0x1A,
GX_TEV_KCSEL_K3_B = 0x1B,
GX_TEV_KCSEL_K0_A = 0x1C,
GX_TEV_KCSEL_K1_A = 0x1D,
GX_TEV_KCSEL_K2_A = 0x1E,
GX_TEV_KCSEL_K3_A = 0x1F
} GXTevKColorSel;
#endif // ( GX_REV != 1 )
/********************************/
#if ( GX_REV != 1 ) // GX Revision 2 or later only
typedef enum _GXTevKAlphaSel
{
GX_TEV_KASEL_8_8 = 0x00,
GX_TEV_KASEL_7_8 = 0x01,
GX_TEV_KASEL_6_8 = 0x02,
GX_TEV_KASEL_5_8 = 0x03,
GX_TEV_KASEL_4_8 = 0x04,
GX_TEV_KASEL_3_8 = 0x05,
GX_TEV_KASEL_2_8 = 0x06,
GX_TEV_KASEL_1_8 = 0x07,
GX_TEV_KASEL_1 = GX_TEV_KASEL_8_8,
GX_TEV_KASEL_3_4 = GX_TEV_KASEL_6_8,
GX_TEV_KASEL_1_2 = GX_TEV_KASEL_4_8,
GX_TEV_KASEL_1_4 = GX_TEV_KASEL_2_8,
GX_TEV_KASEL_K0_R = 0x10,
GX_TEV_KASEL_K1_R = 0x11,
GX_TEV_KASEL_K2_R = 0x12,
GX_TEV_KASEL_K3_R = 0x13,
GX_TEV_KASEL_K0_G = 0x14,
GX_TEV_KASEL_K1_G = 0x15,
GX_TEV_KASEL_K2_G = 0x16,
GX_TEV_KASEL_K3_G = 0x17,
GX_TEV_KASEL_K0_B = 0x18,
GX_TEV_KASEL_K1_B = 0x19,
GX_TEV_KASEL_K2_B = 0x1A,
GX_TEV_KASEL_K3_B = 0x1B,
GX_TEV_KASEL_K0_A = 0x1C,
GX_TEV_KASEL_K1_A = 0x1D,
GX_TEV_KASEL_K2_A = 0x1E,
GX_TEV_KASEL_K3_A = 0x1F
} GXTevKAlphaSel;
#endif // ( GX_REV != 1 )
/********************************/
#if ( GX_REV != 1 ) // GX Revision 2 or later only
typedef enum _GXTevSwapSel
{
GX_TEV_SWAP0 = 0,
GX_TEV_SWAP1,
GX_TEV_SWAP2,
GX_TEV_SWAP3,
GX_MAX_TEVSWAP
} GXTevSwapSel;
#endif // ( GX_REV != 1 )
/********************************/
#if ( GX_REV != 1 ) // GX Revision 2 or later only
typedef enum _GXTevColorChan
{
GX_CH_RED = 0,
GX_CH_GREEN,
GX_CH_BLUE,
GX_CH_ALPHA
} GXTevColorChan;
#endif // ( GX_REV != 1 )
/********************************/
typedef enum _GXAlphaOp
{
GX_AOP_AND,
GX_AOP_OR,
GX_AOP_XOR,
GX_AOP_XNOR,
GX_MAX_ALPHAOP
} GXAlphaOp;
/********************************/
typedef enum _GXTevScale
{
GX_CS_SCALE_1,
GX_CS_SCALE_2,
GX_CS_SCALE_4,
GX_CS_DIVIDE_2,
GX_MAX_TEVSCALE
} GXTevScale;
/********************************/
typedef enum _GXFogType
{
GX_FOG_NONE = 0x00,
GX_FOG_PERSP_LIN = 0x02,
GX_FOG_PERSP_EXP = 0x04,
GX_FOG_PERSP_EXP2 = 0x05,
GX_FOG_PERSP_REVEXP = 0x06,
GX_FOG_PERSP_REVEXP2 = 0x07,
GX_FOG_ORTHO_LIN = 0x0A,
GX_FOG_ORTHO_EXP = 0x0C,
GX_FOG_ORTHO_EXP2 = 0x0D,
GX_FOG_ORTHO_REVEXP = 0x0E,
GX_FOG_ORTHO_REVEXP2 = 0x0F,
// For compatibility with former versions
GX_FOG_LIN = GX_FOG_PERSP_LIN,
GX_FOG_EXP = GX_FOG_PERSP_EXP,
GX_FOG_EXP2 = GX_FOG_PERSP_EXP2,
GX_FOG_REVEXP = GX_FOG_PERSP_REVEXP,
GX_FOG_REVEXP2 = GX_FOG_PERSP_REVEXP2
} GXFogType;
/********************************/
typedef enum _GXBlendMode
{
#if ( GX_REV == 1 )
GX_BM_NONE,
GX_BM_BLEND,
GX_BM_LOGIC,
GX_MAX_BLENDMODE
#else // ( GX_REV >= 2 )
GX_BM_NONE,
GX_BM_BLEND,
GX_BM_LOGIC,
GX_BM_SUBTRACT,
GX_MAX_BLENDMODE
#endif
} GXBlendMode;
/********************************/
typedef enum _GXBlendFactor
{
GX_BL_ZERO,
GX_BL_ONE,
GX_BL_SRCCLR,
GX_BL_INVSRCCLR,
GX_BL_SRCALPHA,
GX_BL_INVSRCALPHA,
GX_BL_DSTALPHA,
GX_BL_INVDSTALPHA,
GX_BL_DSTCLR = GX_BL_SRCCLR,
GX_BL_INVDSTCLR = GX_BL_INVSRCCLR
} GXBlendFactor;
/********************************/
typedef enum _GXCompare
{
GX_NEVER,
GX_LESS,
GX_EQUAL,
GX_LEQUAL,
GX_GREATER,
GX_NEQUAL,
GX_GEQUAL,
GX_ALWAYS
} GXCompare;
/********************************/
typedef enum _GXLogicOp
{
GX_LO_CLEAR,
GX_LO_AND,
GX_LO_REVAND,
GX_LO_COPY,
GX_LO_INVAND,
GX_LO_NOOP,
GX_LO_XOR,
GX_LO_OR,
GX_LO_NOR,
GX_LO_EQUIV,
GX_LO_INV,
GX_LO_REVOR,
GX_LO_INVCOPY,
GX_LO_INVOR,
GX_LO_NAND,
GX_LO_SET
} GXLogicOp;
/********************************/
typedef enum _GXPixelFmt
{
GX_PF_RGB8_Z24,
GX_PF_RGBA6_Z24,
GX_PF_RGB565_Z16,
GX_PF_Z24,
GX_PF_Y8,
GX_PF_U8,
GX_PF_V8,
GX_PF_YUV420
} GXPixelFmt;
/********************************/
typedef enum _GXZFmt16
{
GX_ZC_LINEAR,
GX_ZC_NEAR,
GX_ZC_MID,
GX_ZC_FAR
} GXZFmt16;
/********************************/
typedef enum _GXTevMode
{
GX_MODULATE,
GX_DECAL,
GX_BLEND,
GX_REPLACE,
GX_PASSCLR
} GXTevMode;
/********************************/
typedef enum _GXGamma
{
GX_GM_1_0,
GX_GM_1_7,
GX_GM_2_2
} GXGamma;
/********************************/
typedef enum _GXProjectionType
{
GX_PERSPECTIVE,
GX_ORTHOGRAPHIC
} GXProjectionType;
/********************************/
typedef enum _GXEvent
{
GX_VCACHE_MISS_ALL,
GX_VCACHE_MISS_POS,
GX_VCACHE_MISS_NRM
} GXEvent;
/********************************/
typedef enum _GXFBClamp
{
GX_CLAMP_NONE,
GX_CLAMP_TOP,
GX_CLAMP_BOTTOM
} GXFBClamp;
/********************************/
typedef enum _GXAnisotropy
{
GX_ANISO_1,
GX_ANISO_2,
GX_ANISO_4,
GX_MAX_ANISOTROPY
} GXAnisotropy;
/********************************/
typedef enum _GXZTexOp
{
GX_ZT_DISABLE,
GX_ZT_ADD,
GX_ZT_REPLACE,
GX_MAX_ZTEXOP
} GXZTexOp;
/********************************/
typedef enum _GXAlphaReadMode
{
GX_READ_00,
GX_READ_FF,
GX_READ_NONE
} GXAlphaReadMode;
/********************************/
typedef enum _GXPerf0
{
GX_PERF0_VERTICES,
GX_PERF0_CLIP_VTX,
GX_PERF0_CLIP_CLKS,
GX_PERF0_XF_WAIT_IN,
GX_PERF0_XF_WAIT_OUT,
GX_PERF0_XF_XFRM_CLKS,
GX_PERF0_XF_LIT_CLKS,
GX_PERF0_XF_BOT_CLKS,
GX_PERF0_XF_REGLD_CLKS,
GX_PERF0_XF_REGRD_CLKS,
GX_PERF0_CLIP_RATIO,
GX_PERF0_TRIANGLES,
GX_PERF0_TRIANGLES_CULLED,
GX_PERF0_TRIANGLES_PASSED,
GX_PERF0_TRIANGLES_SCISSORED,
GX_PERF0_TRIANGLES_0TEX,
GX_PERF0_TRIANGLES_1TEX,
GX_PERF0_TRIANGLES_2TEX,
GX_PERF0_TRIANGLES_3TEX,
GX_PERF0_TRIANGLES_4TEX,
GX_PERF0_TRIANGLES_5TEX,
GX_PERF0_TRIANGLES_6TEX,
GX_PERF0_TRIANGLES_7TEX,
GX_PERF0_TRIANGLES_8TEX,
GX_PERF0_TRIANGLES_0CLR,
GX_PERF0_TRIANGLES_1CLR,
GX_PERF0_TRIANGLES_2CLR,
GX_PERF0_QUAD_0CVG,
GX_PERF0_QUAD_NON0CVG,
GX_PERF0_QUAD_1CVG,
GX_PERF0_QUAD_2CVG,
GX_PERF0_QUAD_3CVG,
GX_PERF0_QUAD_4CVG,
GX_PERF0_AVG_QUAD_CNT,
GX_PERF0_CLOCKS,
GX_PERF0_NONE
} GXPerf0;
/********************************/
typedef enum _GXPerf1
{
GX_PERF1_TEXELS,
GX_PERF1_TX_IDLE,
GX_PERF1_TX_REGS,
GX_PERF1_TX_MEMSTALL,
GX_PERF1_TC_CHECK1_2,
GX_PERF1_TC_CHECK3_4,
GX_PERF1_TC_CHECK5_6,
GX_PERF1_TC_CHECK7_8,
GX_PERF1_TC_MISS,
GX_PERF1_VC_ELEMQ_FULL,
GX_PERF1_VC_MISSQ_FULL,
GX_PERF1_VC_MEMREQ_FULL,
GX_PERF1_VC_STATUS7,
GX_PERF1_VC_MISSREP_FULL,
GX_PERF1_VC_STREAMBUF_LOW,
GX_PERF1_VC_ALL_STALLS,
GX_PERF1_VERTICES,
GX_PERF1_FIFO_REQ,
GX_PERF1_CALL_REQ,
GX_PERF1_VC_MISS_REQ,
GX_PERF1_CP_ALL_REQ,
GX_PERF1_CLOCKS,
GX_PERF1_NONE
} GXPerf1;
/********************************/
typedef enum _GXVCachePerf
{
GX_VC_POS,
GX_VC_NRM,
GX_VC_CLR0,
GX_VC_CLR1,
GX_VC_TEX0,
GX_VC_TEX1,
GX_VC_TEX2,
GX_VC_TEX3,
GX_VC_TEX4,
GX_VC_TEX5,
GX_VC_TEX6,
GX_VC_TEX7,
GX_VC_ALL = 0xf
} GXVCachePerf;
/********************************/
typedef enum _GXCopyMode
{
GX_COPY_PROGRESSIVE = 0,
GX_COPY_INTLC_EVEN = 2,
GX_COPY_INTLC_ODD = 3
} GXCopyMode;
/********************************/
typedef enum _GXMiscToken
{
GX_MT_XF_FLUSH = 1,
GX_MT_DL_SAVE_CONTEXT = 2,
GX_MT_ABORT_WAIT_COPYOUT = 3,
GX_MT_NULL = 0
} GXMiscToken;
/********************************/
typedef enum _GXXFFlushVal
{
GX_XF_FLUSH_NONE = 0,
GX_XF_FLUSH_SAFE = 8
} GXXFFlushVal;
/********************************/
// Compile-time checks to ensure that enumerations are compiled
// as 32-bit integers. If your build breaks at this line,
// please ensure that you enable the "enumerations are integers"
// option for the compiler.
#define GXCTASSERT(cond) int GXCTASSERT( int assertion_failed[ (cond) != 0 ] )
GXCTASSERT(sizeof(GXAttrType) == sizeof(u32));
/*---------------------------------------------------------------------------*/
#ifdef __cplusplus
}
#endif
#endif // __GXENUM_H__
|