23 const char *MicrocodeTypes[] =
36 "Conker's Bad Fur Day",
40 extern const char *MicrocodeTypes[];
43 static const int numMicrocodeTypes = 11;
45 // Fixed point conversion factors
46 #define FIXED2FLOATRECIP1 0.5f
47 #define FIXED2FLOATRECIP2 0.25f
48 #define FIXED2FLOATRECIP3 0.125f
49 #define FIXED2FLOATRECIP4 0.0625f
50 #define FIXED2FLOATRECIP5 0.03125f
51 #define FIXED2FLOATRECIP6 0.015625f
52 #define FIXED2FLOATRECIP7 0.0078125f
53 #define FIXED2FLOATRECIP8 0.00390625f
54 #define FIXED2FLOATRECIP9 0.001953125f
55 #define FIXED2FLOATRECIP10 0.0009765625f
56 #define FIXED2FLOATRECIP11 0.00048828125f
57 #define FIXED2FLOATRECIP12 0.00024414063f
58 #define FIXED2FLOATRECIP13 0.00012207031f
59 #define FIXED2FLOATRECIP14 6.1035156e-05f
60 #define FIXED2FLOATRECIP15 3.0517578e-05f
61 #define FIXED2FLOATRECIP16 1.5258789e-05f
63 #define _FIXED2FLOAT( v, b ) \
64 ((f32)v * FIXED2FLOATRECIP##b)
66 // Useful macros for decoding GBI command's parameters
67 #define _SHIFTL( v, s, w ) \
68 (((u32)v & ((0x01 << w) - 1)) << s)
69 #define _SHIFTR( v, s, w ) \
70 (((u32)v >> s) & ((0x01 << w) - 1))
73 #define G_BGLT_LOADBLOCK 0x0033
74 #define G_BGLT_LOADTILE 0xfff4
76 #define G_BG_FLAG_FLIPS 0x01
77 #define G_BG_FLAG_FLIPT 0x10
79 // Sprite object render modes
80 #define G_OBJRM_NOTXCLAMP 0x01
81 #define G_OBJRM_XLU 0x02 /* Ignored */
82 #define G_OBJRM_ANTIALIAS 0x04 /* Ignored */
83 #define G_OBJRM_BILERP 0x08
84 #define G_OBJRM_SHRINKSIZE_1 0x10
85 #define G_OBJRM_SHRINKSIZE_2 0x20
86 #define G_OBJRM_WIDEN 0x40
88 // Sprite texture loading types
89 #define G_OBJLT_TXTRBLOCK 0x00001033
90 #define G_OBJLT_TXTRTILE 0x00fc1034
91 #define G_OBJLT_TLUT 0x00000030
94 // These are all the constant flags
95 #define G_ZBUFFER 0x00000001
96 #define G_SHADE 0x00000004
97 #define G_FOG 0x00010000
98 #define G_LIGHTING 0x00020000
99 #define G_TEXTURE_GEN 0x00040000
100 #define G_TEXTURE_GEN_LINEAR 0x00080000
101 #define G_LOD 0x00100000
105 #define G_MV_LIGHT 10
106 #define G_MV_POINT 12
107 #define G_MV_MATRIX 14
109 #define G_MVO_LOOKATX 0
110 #define G_MVO_LOOKATY 24
120 #define G_MV_LOOKATY 0x82
121 #define G_MV_LOOKATX 0x84
130 #define G_MV_TXTATT 0x96
131 #define G_MV_MATRIX_1 0x9E
132 #define G_MV_MATRIX_2 0x98
133 #define G_MV_MATRIX_3 0x9A
134 #define G_MV_MATRIX_4 0x9C
136 #define G_MW_MATRIX 0x00
137 #define G_MW_NUMLIGHT 0x02
138 #define G_MW_CLIP 0x04
139 #define G_MW_SEGMENT 0x06
140 #define G_MW_FOG 0x08
141 #define G_MW_LIGHTCOL 0x0A
142 #define G_MW_FORCEMTX 0x0C
143 #define G_MW_POINTS 0x0C
144 #define G_MW_PERSPNORM 0x0E
145 #define G_MV_COORDMOD 0x10 //Conker Bad Fur Day
147 #define G_MWO_NUMLIGHT 0x00
148 #define G_MWO_CLIP_RNX 0x04
149 #define G_MWO_CLIP_RNY 0x0c
150 #define G_MWO_CLIP_RPX 0x14
151 #define G_MWO_CLIP_RPY 0x1c
152 #define G_MWO_SEGMENT_0 0x00
153 #define G_MWO_SEGMENT_1 0x01
154 #define G_MWO_SEGMENT_2 0x02
155 #define G_MWO_SEGMENT_3 0x03
156 #define G_MWO_SEGMENT_4 0x04
157 #define G_MWO_SEGMENT_5 0x05
158 #define G_MWO_SEGMENT_6 0x06
159 #define G_MWO_SEGMENT_7 0x07
160 #define G_MWO_SEGMENT_8 0x08
161 #define G_MWO_SEGMENT_9 0x09
162 #define G_MWO_SEGMENT_A 0x0a
163 #define G_MWO_SEGMENT_B 0x0b
164 #define G_MWO_SEGMENT_C 0x0c
165 #define G_MWO_SEGMENT_D 0x0d
166 #define G_MWO_SEGMENT_E 0x0e
167 #define G_MWO_SEGMENT_F 0x0f
168 #define G_MWO_FOG 0x00
170 #define G_MWO_MATRIX_XX_XY_I 0x00
171 #define G_MWO_MATRIX_XZ_XW_I 0x04
172 #define G_MWO_MATRIX_YX_YY_I 0x08
173 #define G_MWO_MATRIX_YZ_YW_I 0x0C
174 #define G_MWO_MATRIX_ZX_ZY_I 0x10
175 #define G_MWO_MATRIX_ZZ_ZW_I 0x14
176 #define G_MWO_MATRIX_WX_WY_I 0x18
177 #define G_MWO_MATRIX_WZ_WW_I 0x1C
178 #define G_MWO_MATRIX_XX_XY_F 0x20
179 #define G_MWO_MATRIX_XZ_XW_F 0x24
180 #define G_MWO_MATRIX_YX_YY_F 0x28
181 #define G_MWO_MATRIX_YZ_YW_F 0x2C
182 #define G_MWO_MATRIX_ZX_ZY_F 0x30
183 #define G_MWO_MATRIX_ZZ_ZW_F 0x34
184 #define G_MWO_MATRIX_WX_WY_F 0x38
185 #define G_MWO_MATRIX_WZ_WW_F 0x3C
186 #define G_MWO_POINT_RGBA 0x10
187 #define G_MWO_POINT_ST 0x14
188 #define G_MWO_POINT_XYSCREEN 0x18
189 #define G_MWO_POINT_ZSCREEN 0x1C
192 static const char *MWOPointText[] =
196 "G_MWO_POINT_XYSCREEN",
197 "G_MWO_POINT_ZSCREEN"
200 static const char *MWOMatrixText[] =
202 "G_MWO_MATRIX_XX_XY_I", "G_MWO_MATRIX_XZ_XW_I", "G_MWO_MATRIX_YX_YY_I", "G_MWO_MATRIX_YZ_YW_I",
203 "G_MWO_MATRIX_ZX_ZY_I", "G_MWO_MATRIX_ZZ_ZW_I", "G_MWO_MATRIX_WX_WY_I", "G_MWO_MATRIX_WZ_WW_I",
204 "G_MWO_MATRIX_XX_XY_F", "G_MWO_MATRIX_XZ_XW_F", "G_MWO_MATRIX_YX_YY_F", "G_MWO_MATRIX_YZ_YW_F",
205 "G_MWO_MATRIX_ZX_ZY_F", "G_MWO_MATRIX_ZZ_ZW_F", "G_MWO_MATRIX_WX_WY_F", "G_MWO_MATRIX_WZ_WW_F"
209 // These flags change between ucodes
210 extern u32 G_MTX_STACKSIZE;
212 extern u32 G_MTX_MODELVIEW;
213 extern u32 G_MTX_PROJECTION;
214 extern u32 G_MTX_MUL;
215 extern u32 G_MTX_LOAD;
216 extern u32 G_MTX_NOPUSH;
217 extern u32 G_MTX_PUSH;
219 extern u32 G_TEXTURE_ENABLE;
220 extern u32 G_SHADING_SMOOTH;
221 extern u32 G_CULL_FRONT;
222 extern u32 G_CULL_BACK;
223 extern u32 G_CULL_BOTH;
224 extern u32 G_CLIPPING;
226 extern u32 G_MV_VIEWPORT;
228 extern u32 G_MWO_aLIGHT_1, G_MWO_bLIGHT_1;
229 extern u32 G_MWO_aLIGHT_2, G_MWO_bLIGHT_2;
230 extern u32 G_MWO_aLIGHT_3, G_MWO_bLIGHT_3;
231 extern u32 G_MWO_aLIGHT_4, G_MWO_bLIGHT_4;
232 extern u32 G_MWO_aLIGHT_5, G_MWO_bLIGHT_5;
233 extern u32 G_MWO_aLIGHT_6, G_MWO_bLIGHT_6;
234 extern u32 G_MWO_aLIGHT_7, G_MWO_bLIGHT_7;
235 extern u32 G_MWO_aLIGHT_8, G_MWO_bLIGHT_8;
238 #define G_IM_FMT_RGBA 0
239 #define G_IM_FMT_YUV 1
240 #define G_IM_FMT_CI 2
241 #define G_IM_FMT_IA 3
243 #define G_IM_FMT_CI_IA 5 //not real
246 #define G_IM_SIZ_4b 0
247 #define G_IM_SIZ_8b 1
248 #define G_IM_SIZ_16b 2
249 #define G_IM_SIZ_32b 3
250 #define G_IM_SIZ_DD 5
252 #define G_TX_MIRROR 0x1
253 #define G_TX_CLAMP 0x2
256 static const char *ImageFormatText[] =
268 static const char *ImageSizeText[] =
276 static const char *SegmentText[] =
278 "G_MWO_SEGMENT_0", "G_MWO_SEGMENT_1", "G_MWO_SEGMENT_2", "G_MWO_SEGMENT_3",
279 "G_MWO_SEGMENT_4", "G_MWO_SEGMENT_5", "G_MWO_SEGMENT_6", "G_MWO_SEGMENT_7",
280 "G_MWO_SEGMENT_8", "G_MWO_SEGMENT_9", "G_MWO_SEGMENT_A", "G_MWO_SEGMENT_B",
281 "G_MWO_SEGMENT_C", "G_MWO_SEGMENT_D", "G_MWO_SEGMENT_E", "G_MWO_SEGMENT_F"
287 #define G_IMMFIRST -65
289 // These GBI commands are common to all ucodes
290 #define G_SETCIMG 0xFF /* -1 */
291 #define G_SETZIMG 0xFE /* -2 */
292 #define G_SETTIMG 0xFD /* -3 */
293 #define G_SETCOMBINE 0xFC /* -4 */
294 #define G_SETENVCOLOR 0xFB /* -5 */
295 #define G_SETPRIMCOLOR 0xFA /* -6 */
296 #define G_SETBLENDCOLOR 0xF9 /* -7 */
297 #define G_SETFOGCOLOR 0xF8 /* -8 */
298 #define G_SETFILLCOLOR 0xF7 /* -9 */
299 #define G_FILLRECT 0xF6 /* -10 */
300 #define G_SETTILE 0xF5 /* -11 */
301 #define G_LOADTILE 0xF4 /* -12 */
302 #define G_LOADBLOCK 0xF3 /* -13 */
303 #define G_SETTILESIZE 0xF2 /* -14 */
304 #define G_LOADTLUT 0xF0 /* -16 */
305 #define G_RDPSETOTHERMODE 0xEF /* -17 */
306 #define G_SETPRIMDEPTH 0xEE /* -18 */
307 #define G_SETSCISSOR 0xED /* -19 */
308 #define G_SETCONVERT 0xEC /* -20 */
309 #define G_SETKEYR 0xEB /* -21 */
310 #define G_SETKEYGB 0xEA /* -22 */
311 #define G_RDPFULLSYNC 0xE9 /* -23 */
312 #define G_RDPTILESYNC 0xE8 /* -24 */
313 #define G_RDPPIPESYNC 0xE7 /* -25 */
314 #define G_RDPLOADSYNC 0xE6 /* -26 */
315 #define G_TEXRECTFLIP 0xE5 /* -27 */
316 #define G_TEXRECT 0xE4 /* -28 */
318 #define G_RDPNOOP 0xC0
320 #define G_TRI_FILL 0xC8 /* fill triangle: 11001000 */
321 #define G_TRI_FILL_ZBUFF 0xC9 /* fill, zbuff triangle: 11001001 */
322 #define G_TRI_TXTR 0xCA /* texture triangle: 11001010 */
323 #define G_TRI_TXTR_ZBUFF 0xCB /* texture, zbuff triangle: 11001011 */
324 #define G_TRI_SHADE 0xCC /* shade triangle: 11001100 */
325 #define G_TRI_SHADE_ZBUFF 0xCD /* shade, zbuff triangle: 11001101 */
326 #define G_TRI_SHADE_TXTR 0xCE /* shade, texture triangle: 11001110 */
327 #define G_TRI_SHADE_TXTR_ZBUFF 0xCF /* shade, txtr, zbuff trngl: 11001111 */
330 * G_SETOTHERMODE_L sft: shift count
332 #define G_MDSFT_ALPHACOMPARE 0
333 #define G_MDSFT_ZSRCSEL 2
334 #define G_MDSFT_RENDERMODE 3
335 #define G_MDSFT_BLENDER 16
338 * G_SETOTHERMODE_H sft: shift count
340 #define G_MDSFT_BLENDMASK 0 /* unsupported */
341 #define G_MDSFT_ALPHADITHER 4
342 #define G_MDSFT_RGBDITHER 6
344 #define G_MDSFT_COMBKEY 8
345 #define G_MDSFT_TEXTCONV 9
346 #define G_MDSFT_TEXTFILT 12
347 #define G_MDSFT_TEXTLUT 14
348 #define G_MDSFT_TEXTLOD 16
349 #define G_MDSFT_TEXTDETAIL 17
350 #define G_MDSFT_TEXTPERSP 19
351 #define G_MDSFT_CYCLETYPE 20
352 #define G_MDSFT_COLORDITHER 22 /* unsupported in HW 2.0 */
353 #define G_MDSFT_PIPELINE 23
355 /* G_SETOTHERMODE_H gPipelineMode */
356 #define G_PM_1PRIMITIVE 1
357 #define G_PM_NPRIMITIVE 0
359 /* G_SETOTHERMODE_H gSetCycleType */
360 #define G_CYC_1CYCLE 0
361 #define G_CYC_2CYCLE 1
365 /* G_SETOTHERMODE_H gSetTexturePersp */
369 /* G_SETOTHERMODE_H gSetTextureDetail */
371 #define G_TD_SHARPEN 1
372 #define G_TD_DETAIL 2
374 /* G_SETOTHERMODE_H gSetTextureLOD */
378 /* G_SETOTHERMODE_H gSetTextureLUT */
380 #define G_TT_RGBA16 2
383 /* G_SETOTHERMODE_H gSetTextureFilter */
385 #define G_TF_AVERAGE 3
386 #define G_TF_BILERP 2
388 /* G_SETOTHERMODE_H gSetTextureConvert */
390 #define G_TC_FILTCONV 5
393 /* G_SETOTHERMODE_H gSetCombineKey */
397 /* G_SETOTHERMODE_H gSetColorDither */
398 #define G_CD_MAGICSQ 0
402 #define G_CD_DISABLE 3
403 #define G_CD_ENABLE G_CD_NOISE /* HW 1.0 compatibility mode */
405 /* G_SETOTHERMODE_H gSetAlphaDither */
406 #define G_AD_PATTERN 0
407 #define G_AD_NOTPATTERN 1
409 #define G_AD_DISABLE 3
411 /* G_SETOTHERMODE_L gSetAlphaCompare */
413 #define G_AC_THRESHOLD 1
414 #define G_AC_DITHER 3
416 /* G_SETOTHERMODE_L gSetDepthSource */
420 /* G_SETOTHERMODE_L gSetRenderMode */
426 #define CVG_DST_CLAMP 0
427 #define CVG_DST_WRAP 1
428 #define CVG_DST_FULL 2
429 #define CVG_DST_SAVE 3
431 #define ZMODE_INTER 1
434 #define CVG_X_ALPHA 1
435 #define ALPHA_CVG_SEL 1
437 #define TEX_EDGE 0 // not used
439 #define G_SC_NON_INTERLACE 0
440 #define G_SC_EVEN_INTERLACE 2
441 #define G_SC_ODD_INTERLACE 3
444 static const char *AAEnableText = "AA_EN";
445 static const char *DepthCompareText = "Z_CMP";
446 static const char *DepthUpdateText = "Z_UPD";
447 static const char *ClearOnCvgText = "CLR_ON_CVG";
448 static const char *CvgXAlphaText = "CVG_X_ALPHA";
449 static const char *AlphaCvgSelText = "ALPHA_CVG_SEL";
450 static const char *ForceBlenderText = "FORCE_BL";
452 static const char *AlphaCompareText[] =
454 "G_AC_NONE", "G_AC_THRESHOLD", "G_AC_INVALID", "G_AC_DITHER"
457 static const char *DepthSourceText[] =
459 "G_ZS_PIXEL", "G_ZS_PRIM"
462 static const char *AlphaDitherText[] =
464 "G_AD_PATTERN", "G_AD_NOTPATTERN", "G_AD_NOISE", "G_AD_DISABLE"
467 static const char *ColorDitherText[] =
469 "G_CD_MAGICSQ", "G_CD_BAYER", "G_CD_NOISE", "G_CD_DISABLE"
472 static const char *CombineKeyText[] =
474 "G_CK_NONE", "G_CK_KEY"
477 static const char *TextureConvertText[] =
479 "G_TC_CONV", "G_TC_INVALID", "G_TC_INVALID", "G_TC_INVALID", "G_TC_INVALID", "G_TC_FILTCONV", "G_TC_FILT", "G_TC_INVALID"
482 static const char *TextureFilterText[] =
484 "G_TF_POINT", "G_TF_INVALID", "G_TF_BILERP", "G_TF_AVERAGE"
487 static const char *TextureLUTText[] =
489 "G_TT_NONE", "G_TT_INVALID", "G_TT_RGBA16", "G_TT_IA16"
492 static const char *TextureLODText[] =
494 "G_TL_TILE", "G_TL_LOD"
497 static const char *TextureDetailText[] =
499 "G_TD_CLAMP", "G_TD_SHARPEN", "G_TD_DETAIL"
502 static const char *TexturePerspText[] =
504 "G_TP_NONE", "G_TP_PERSP"
507 static const char *CycleTypeText[] =
509 "G_CYC_1CYCLE", "G_CYC_2CYCLE", "G_CYC_COPY", "G_CYC_FILL"
512 static const char *PipelineModeText[] =
514 "G_PM_NPRIMITIVE", "G_PM_1PRIMITIVE"
517 static const char *CvgDestText[] =
519 "CVG_DST_CLAMP", "CVG_DST_WRAP", "CVG_DST_FULL", "CVG_DST_SAVE"
522 static const char *DepthModeText[] =
524 "ZMODE_OPA", "ZMODE_INTER", "ZMODE_XLU", "ZMODE_DEC"
527 static const char *ScissorModeText[] =
529 "G_SC_NON_INTERLACE", "G_SC_INVALID", "G_SC_EVEN_INTERLACE", "G_SC_ODD_INTERLACE"
533 /* Color combiner constants: */
534 #define G_CCMUX_COMBINED 0
535 #define G_CCMUX_TEXEL0 1
536 #define G_CCMUX_TEXEL1 2
537 #define G_CCMUX_PRIMITIVE 3
538 #define G_CCMUX_SHADE 4
539 #define G_CCMUX_ENVIRONMENT 5
540 #define G_CCMUX_CENTER 6
541 #define G_CCMUX_SCALE 6
542 #define G_CCMUX_COMBINED_ALPHA 7
543 #define G_CCMUX_TEXEL0_ALPHA 8
544 #define G_CCMUX_TEXEL1_ALPHA 9
545 #define G_CCMUX_PRIMITIVE_ALPHA 10
546 #define G_CCMUX_SHADE_ALPHA 11
547 #define G_CCMUX_ENV_ALPHA 12
548 #define G_CCMUX_LOD_FRACTION 13
549 #define G_CCMUX_PRIM_LOD_FRAC 14
550 #define G_CCMUX_NOISE 7
552 #define G_CCMUX_K5 15
556 /* Alpha combiner constants: */
557 #define G_ACMUX_COMBINED 0
558 #define G_ACMUX_TEXEL0 1
559 #define G_ACMUX_TEXEL1 2
560 #define G_ACMUX_PRIMITIVE 3
561 #define G_ACMUX_SHADE 4
562 #define G_ACMUX_ENVIRONMENT 5
563 #define G_ACMUX_LOD_FRACTION 0
564 #define G_ACMUX_PRIM_LOD_FRAC 6
569 static const char *saRGBText[] =
571 "COMBINED", "TEXEL0", "TEXEL1", "PRIMITIVE",
572 "SHADE", "ENVIRONMENT", "NOISE", "1",
577 static const char *sbRGBText[] =
579 "COMBINED", "TEXEL0", "TEXEL1", "PRIMITIVE",
580 "SHADE", "ENVIRONMENT", "CENTER", "K4",
585 static const char *mRGBText[] =
587 "COMBINED", "TEXEL0", "TEXEL1", "PRIMITIVE",
588 "SHADE", "ENVIRONMENT", "SCALE", "COMBINED_ALPHA",
589 "TEXEL0_ALPHA", "TEXEL1_ALPHA", "PRIMITIVE_ALPHA", "SHADE_ALPHA",
590 "ENV_ALPHA", "LOD_FRACTION", "PRIM_LOD_FRAC", "K5",
597 static const char *aRGBText[] =
599 "COMBINED", "TEXEL0", "TEXEL1", "PRIMITIVE",
600 "SHADE", "ENVIRONMENT", "1", "0",
603 static const char *saAText[] =
605 "COMBINED", "TEXEL0", "TEXEL1", "PRIMITIVE",
606 "SHADE", "ENVIRONMENT", "1", "0",
609 static const char *sbAText[] =
611 "COMBINED", "TEXEL0", "TEXEL1", "PRIMITIVE",
612 "SHADE", "ENVIRONMENT", "1", "0",
615 static const char *mAText[] =
617 "LOD_FRACTION", "TEXEL0", "TEXEL1", "PRIMITIVE",
618 "SHADE", "ENVIRONMENT", "PRIM_LOD_FRAC", "0",
621 static const char *aAText[] =
623 "COMBINED", "TEXEL0", "TEXEL1", "PRIMITIVE",
624 "SHADE", "ENVIRONMENT", "1", "0",
628 extern u32 G_RDPHALF_1, G_RDPHALF_2, G_RDPHALF_CONT;
630 extern u32 G_SETOTHERMODE_H, G_SETOTHERMODE_L;
631 extern u32 G_DL, G_ENDDL, G_CULLDL, G_BRANCH_Z;
632 extern u32 G_LOAD_UCODE;
633 extern u32 G_MOVEMEM, G_MOVEWORD;
634 extern u32 G_MTX, G_POPMTX;
635 extern u32 G_GEOMETRYMODE, G_SETGEOMETRYMODE, G_CLEARGEOMETRYMODE;
636 extern u32 G_TEXTURE;
637 extern u32 G_DMA_IO, G_DMA_DL, G_DMA_TRI, G_DMA_MTX, G_DMA_VTX, G_DMA_OFFSETS;
638 extern u32 G_SPECIAL_1, G_SPECIAL_2, G_SPECIAL_3;
639 extern u32 G_VTX, G_MODIFYVTX, G_VTXCOLORBASE;
640 extern u32 G_TRI1, G_TRI2, G_TRI4;
641 extern u32 G_QUAD, G_LINE3D;
642 extern u32 G_RESERVED0, G_RESERVED1, G_RESERVED2, G_RESERVED3;
643 extern u32 G_SPRITE2D_BASE;
644 extern u32 G_BG_1CYC, G_BG_COPY;
645 extern u32 G_OBJ_RECTANGLE, G_OBJ_SPRITE, G_OBJ_MOVEMEM;
646 extern u32 G_SELECT_DL, G_OBJ_RENDERMODE, G_OBJ_RECTANGLE_R;
647 extern u32 G_OBJ_LOADTXTR, G_OBJ_LDTX_SPRITE, G_OBJ_LDTX_RECT, G_OBJ_LDTX_RECT_R;
648 extern u32 G_RDPHALF_0, G_TRI_UNKNOWN;
659 #define G_DL_PUSH 0x00
660 #define G_DL_NOPUSH 0x01
724 typedef void (*GBIFunc)( u32 w0, u32 w1 );
725 //extern GBIFunc GBICmd[256];
727 struct SpecialMicrocodeInfo
737 u32 address, dataAddress;
744 MicrocodeInfo *higher, *lower;
751 u32 PCStackSize, numMicrocodes;
752 MicrocodeInfo *current, *top, *bottom;
755 unsigned int profileTimer[256 * 12];
756 unsigned int profileNum[256 * 12];
757 unsigned int profileTmp;
764 void GBI_ProfileReset();
765 void GBI_ProfileInit();
766 void GBI_ProfileBegin(u32 cmd);
767 void GBI_ProfileEnd(u32 cmd);
768 u32 GBI_ProfilePrint(FILE *file);
769 const char* GBI_GetFuncName(u32 ucode, u32 cmd);
770 u32 GBI_GetFuncTime(u32 ucode, u32 cmd);
773 void GBI_MakeCurrent( MicrocodeInfo *current );
774 MicrocodeInfo *GBI_DetectMicrocode( u32 uc_start, u32 uc_dstart, u16 uc_dsize );
775 extern u32 last_good_ucode;
779 // Allows easier setting of GBI commands
780 #define GBI_SetGBI( command, value, function ) \
782 GBI.cmd[command] = function
784 #define GBI_InitFlags( ucode ) \
785 G_MTX_STACKSIZE = ucode##_MTX_STACKSIZE; \
786 G_MTX_MODELVIEW = ucode##_MTX_MODELVIEW; \
787 G_MTX_PROJECTION = ucode##_MTX_PROJECTION; \
788 G_MTX_MUL = ucode##_MTX_MUL; \
789 G_MTX_LOAD = ucode##_MTX_LOAD; \
790 G_MTX_NOPUSH = ucode##_MTX_NOPUSH; \
791 G_MTX_PUSH = ucode##_MTX_PUSH; \
793 G_TEXTURE_ENABLE = ucode##_TEXTURE_ENABLE; \
794 G_SHADING_SMOOTH = ucode##_SHADING_SMOOTH; \
795 G_CULL_FRONT = ucode##_CULL_FRONT; \
796 G_CULL_BACK = ucode##_CULL_BACK; \
797 G_CULL_BOTH = ucode##_CULL_BOTH; \
798 G_CLIPPING = ucode##_CLIPPING; \
800 G_MV_VIEWPORT = ucode##_MV_VIEWPORT; \
802 G_MWO_aLIGHT_1 = ucode##_MWO_aLIGHT_1; \
803 G_MWO_bLIGHT_1 = ucode##_MWO_bLIGHT_1; \
804 G_MWO_aLIGHT_2 = ucode##_MWO_aLIGHT_2; \
805 G_MWO_bLIGHT_2 = ucode##_MWO_bLIGHT_2; \
806 G_MWO_aLIGHT_3 = ucode##_MWO_aLIGHT_3; \
807 G_MWO_bLIGHT_3 = ucode##_MWO_bLIGHT_3; \
808 G_MWO_aLIGHT_4 = ucode##_MWO_aLIGHT_4; \
809 G_MWO_bLIGHT_4 = ucode##_MWO_bLIGHT_4; \
810 G_MWO_aLIGHT_5 = ucode##_MWO_aLIGHT_5; \
811 G_MWO_bLIGHT_5 = ucode##_MWO_bLIGHT_5; \
812 G_MWO_aLIGHT_6 = ucode##_MWO_aLIGHT_6; \
813 G_MWO_bLIGHT_6 = ucode##_MWO_bLIGHT_6; \
814 G_MWO_aLIGHT_7 = ucode##_MWO_aLIGHT_7; \
815 G_MWO_bLIGHT_7 = ucode##_MWO_bLIGHT_7; \
816 G_MWO_aLIGHT_8 = ucode##_MWO_aLIGHT_8; \
817 G_MWO_bLIGHT_8 = ucode##_MWO_bLIGHT_8;