[Video] Make gfxCombineMode_t an enum

This commit is contained in:
zilmar 2017-07-21 06:11:34 +10:00
parent d03285413f
commit 556c26730a
7 changed files with 972 additions and 948 deletions

File diff suppressed because one or more lines are too long

View File

@ -57,17 +57,29 @@ typedef struct
uint32_t mod_0, modcolor_0, modcolor1_0, modcolor2_0, modfactor_0;
uint32_t mod_1, modcolor_1, modcolor1_1, modcolor2_1, modfactor_1;
//combine extensions
uint32_t c_ext_a, c_ext_a_mode, c_ext_b, c_ext_b_mode, c_ext_c, c_ext_d;
uint32_t c_ext_a, c_ext_b, c_ext_c, c_ext_d;
gfxCombineMode_t c_ext_a_mode;
gfxCombineMode_t c_ext_b_mode;
int c_ext_c_invert, c_ext_d_invert;
uint32_t a_ext_a, a_ext_a_mode, a_ext_b, a_ext_b_mode, a_ext_c, a_ext_d;
uint32_t a_ext_a, a_ext_b, a_ext_c, a_ext_d;
gfxCombineMode_t a_ext_a_mode;
gfxCombineMode_t a_ext_b_mode;
int a_ext_c_invert, a_ext_d_invert;
uint32_t t0c_ext_a, t0c_ext_a_mode, t0c_ext_b, t0c_ext_b_mode, t0c_ext_c, t0c_ext_d;
uint32_t t0c_ext_a, t0c_ext_b, t0c_ext_c, t0c_ext_d;
gfxCombineMode_t t0c_ext_a_mode;
gfxCombineMode_t t0c_ext_b_mode;
int t0c_ext_c_invert, t0c_ext_d_invert;
uint32_t t0a_ext_a, t0a_ext_a_mode, t0a_ext_b, t0a_ext_b_mode, t0a_ext_c, t0a_ext_d;
uint32_t t0a_ext_a, t0a_ext_b, t0a_ext_c, t0a_ext_d;
gfxCombineMode_t t0a_ext_a_mode;
gfxCombineMode_t t0a_ext_b_mode;
int t0a_ext_c_invert, t0a_ext_d_invert;
uint32_t t1c_ext_a, t1c_ext_a_mode, t1c_ext_b, t1c_ext_b_mode, t1c_ext_c, t1c_ext_d;
uint32_t t1c_ext_a, t1c_ext_b, t1c_ext_c, t1c_ext_d;
gfxCombineMode_t t1c_ext_a_mode;
gfxCombineMode_t t1c_ext_b_mode;
int t1c_ext_c_invert, t1c_ext_d_invert;
uint32_t t1a_ext_a, t1a_ext_a_mode, t1a_ext_b, t1a_ext_b_mode, t1a_ext_c, t1a_ext_d;
uint32_t t1a_ext_a, t1a_ext_b, t1a_ext_c, t1a_ext_d;
gfxCombineMode_t t1a_ext_a_mode;
gfxCombineMode_t t1a_ext_b_mode;
int t1a_ext_c_invert, t1a_ext_d_invert;
uint32_t tex_ccolor;
int combine_ext;

View File

@ -1727,7 +1727,7 @@ void gfxStippleMode(GrStippleMode_t mode)
need_to_compile = 1;
}
void gfxColorCombineExt(gfxCCUColor_t a, GrCombineMode_t a_mode, gfxCCUColor_t b, GrCombineMode_t b_mode, gfxCCUColor_t c, FxBool c_invert, gfxCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
void gfxColorCombineExt(gfxCCUColor_t a, gfxCombineMode_t a_mode, gfxCCUColor_t b, gfxCombineMode_t b_mode, gfxCCUColor_t c, FxBool c_invert, gfxCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
{
WriteTrace(TraceGlitch, TraceDebug, "a: %d a_mode: %d b: %d b_mode: %d c: %d c_invert: %d d: %d d_invert: %d shift: %d invert: %d", a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
if (invert) WriteTrace(TraceGlitch, TraceWarning, "gfxColorCombineExt : inverted result");
@ -1770,16 +1770,16 @@ void gfxColorCombineExt(gfxCCUColor_t a, GrCombineMode_t a_mode, gfxCCUColor_t b
switch (a_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
strcat(fragment_shader_color_combiner, "vec4 c_a = vec4(0.0); \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
strcat(fragment_shader_color_combiner, "vec4 c_a = cs_a; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
strcat(fragment_shader_color_combiner, "vec4 c_a = vec4(1.0) - cs_a; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
strcat(fragment_shader_color_combiner, "vec4 c_a = -cs_a; \n");
break;
default:
@ -1817,16 +1817,16 @@ void gfxColorCombineExt(gfxCCUColor_t a, GrCombineMode_t a_mode, gfxCCUColor_t b
switch (b_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
strcat(fragment_shader_color_combiner, "vec4 c_b = vec4(0.0); \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
strcat(fragment_shader_color_combiner, "vec4 c_b = cs_b; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
strcat(fragment_shader_color_combiner, "vec4 c_b = vec4(1.0) - cs_b; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
strcat(fragment_shader_color_combiner, "vec4 c_b = -cs_b; \n");
break;
default:
@ -1904,7 +1904,7 @@ void gfxColorCombineExt(gfxCCUColor_t a, GrCombineMode_t a_mode, gfxCCUColor_t b
need_to_compile = 1;
}
void gfxAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b, GrCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
void gfxAlphaCombineExt(GrACUColor_t a, gfxCombineMode_t a_mode, GrACUColor_t b, gfxCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
{
WriteTrace(TraceGlitch, TraceDebug, "a: %d a_mode: %d b: %d b_mode: %d c: %d c_invert: %d d: %d d_invert: %d shift: %d invert: %d", a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
if (invert) WriteTrace(TraceGlitch, TraceWarning, "gfxAlphaCombineExt : inverted result");
@ -1938,16 +1938,16 @@ void gfxAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b,
switch (a_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
strcat(fragment_shader_alpha_combiner, "float a_a = 0.0; \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
strcat(fragment_shader_alpha_combiner, "float a_a = as_a; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
strcat(fragment_shader_alpha_combiner, "float a_a = 1.0 - as_a; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
strcat(fragment_shader_alpha_combiner, "float a_a = -as_a; \n");
break;
default:
@ -1976,16 +1976,16 @@ void gfxAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b,
switch (b_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
strcat(fragment_shader_alpha_combiner, "float a_b = 0.0; \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
strcat(fragment_shader_alpha_combiner, "float a_b = as_b; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
strcat(fragment_shader_alpha_combiner, "float a_b = 1.0 - as_b; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
strcat(fragment_shader_alpha_combiner, "float a_b = -as_b; \n");
break;
default:
@ -2051,7 +2051,7 @@ void gfxAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b,
need_to_compile = 1;
}
void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mode, GrTCCUColor_t b, GrCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, gfxCombineMode_t a_mode, GrTCCUColor_t b, gfxCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
{
int num_tex;
WriteTrace(TraceGlitch, TraceDebug, "tmu: %d a: %d a_mode: %d b: %d b_mode: %d c: %d c_invert: %d d: %d d_invert: %d shift: %d invert: %d", tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
@ -2147,25 +2147,25 @@ void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mo
switch (a_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_a = vec4(0.0); \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_a = vec4(0.0); \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_a = ctex0s_a; \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_a = ctex1s_a; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_a = vec4(1.0) - ctex0s_a; \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_a = vec4(1.0) - ctex1s_a; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_a = -ctex0s_a; \n");
else
@ -2245,25 +2245,25 @@ void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mo
switch (b_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_b = vec4(0.0); \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_b = vec4(0.0); \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_b = ctex0s_b; \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_b = ctex1s_b; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_b = vec4(1.0) - ctex0s_b; \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_b = vec4(1.0) - ctex1s_b; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_b = -ctex0s_b; \n");
else
@ -2410,7 +2410,7 @@ void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mo
need_to_compile = 1;
}
void gfxTexAlphaCombineExt(GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mode, GrTACUColor_t b, GrCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
void gfxTexAlphaCombineExt(GrChipID_t tmu, GrTACUColor_t a, gfxCombineMode_t a_mode, GrTACUColor_t b, gfxCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
{
int num_tex;
WriteTrace(TraceGlitch, TraceDebug, "tmu: %d a: %d a_mode: %d b: %d b_mode: %d c: %d c_invert: %d d: %d d_invert: %d shift, invert: %d", tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
@ -2472,25 +2472,25 @@ void gfxTexAlphaCombineExt(GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mo
switch (a_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_a.a = 0.0; \n");
else
strcat(fragment_shader_texture1, "ctex1_a.a = 0.0; \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_a.a = ctex0s_a.a; \n");
else
strcat(fragment_shader_texture1, "ctex1_a.a = ctex1s_a.a; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_a.a = 1.0 - ctex0s_a.a; \n");
else
strcat(fragment_shader_texture1, "ctex1_a.a = 1.0 - ctex1s_a.a; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_a.a = -ctex0s_a.a; \n");
else
@ -2540,25 +2540,25 @@ void gfxTexAlphaCombineExt(GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mo
switch (b_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_b.a = 0.0; \n");
else
strcat(fragment_shader_texture1, "ctex1_b.a = 0.0; \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_b.a = ctex0s_b.a; \n");
else
strcat(fragment_shader_texture1, "ctex1_b.a = ctex1s_b.a; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_b.a = 1.0 - ctex0s_b.a; \n");
else
strcat(fragment_shader_texture1, "ctex1_b.a = 1.0 - ctex1s_b.a; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_b.a = -ctex0s_b.a; \n");
else

View File

@ -1690,7 +1690,7 @@ void gfxStippleMode(GrStippleMode_t mode)
grDisplayGLError("gfxStippleMode");
}
void gfxColorCombineExt(gfxCCUColor_t a, GrCombineMode_t a_mode, gfxCCUColor_t b, GrCombineMode_t b_mode, gfxCCUColor_t c, FxBool c_invert, gfxCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
void gfxColorCombineExt(gfxCCUColor_t a, gfxCombineMode_t a_mode, gfxCCUColor_t b, gfxCombineMode_t b_mode, gfxCCUColor_t c, FxBool c_invert, gfxCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
{
WriteTrace(TraceGlitch, TraceDebug, "a: %d a_mode: %d b: %d b_mode: %d c: %d c_invert: %d d: %d d_invert: %d shift: %d invert: %d", a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
if (invert) WriteTrace(TraceGlitch, TraceWarning, "gfxColorCombineExt : inverted result");
@ -1733,16 +1733,16 @@ void gfxColorCombineExt(gfxCCUColor_t a, GrCombineMode_t a_mode, gfxCCUColor_t b
switch (a_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
strcat(fragment_shader_color_combiner, "vec4 c_a = vec4(0.0); \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
strcat(fragment_shader_color_combiner, "vec4 c_a = cs_a; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
strcat(fragment_shader_color_combiner, "vec4 c_a = vec4(1.0) - cs_a; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
strcat(fragment_shader_color_combiner, "vec4 c_a = -cs_a; \n");
break;
default:
@ -1780,16 +1780,16 @@ void gfxColorCombineExt(gfxCCUColor_t a, GrCombineMode_t a_mode, gfxCCUColor_t b
switch (b_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
strcat(fragment_shader_color_combiner, "vec4 c_b = vec4(0.0); \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
strcat(fragment_shader_color_combiner, "vec4 c_b = cs_b; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
strcat(fragment_shader_color_combiner, "vec4 c_b = vec4(1.0) - cs_b; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
strcat(fragment_shader_color_combiner, "vec4 c_b = -cs_b; \n");
break;
default:
@ -1867,7 +1867,7 @@ void gfxColorCombineExt(gfxCCUColor_t a, GrCombineMode_t a_mode, gfxCCUColor_t b
need_to_compile = 1;
}
void gfxAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b, GrCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
void gfxAlphaCombineExt(GrACUColor_t a, gfxCombineMode_t a_mode, GrACUColor_t b, gfxCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
{
WriteTrace(TraceGlitch, TraceDebug, "a: %d a_mode: %d b: %d b_mode: %d c: %d c_invert: %d d: %d d_invert: %d shift: %d invert: %d", a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
if (invert) WriteTrace(TraceGlitch, TraceWarning, "gfxAlphaCombineExt : inverted result");
@ -1901,16 +1901,16 @@ void gfxAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b,
switch (a_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
strcat(fragment_shader_alpha_combiner, "float a_a = 0.0; \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
strcat(fragment_shader_alpha_combiner, "float a_a = as_a; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
strcat(fragment_shader_alpha_combiner, "float a_a = 1.0 - as_a; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
strcat(fragment_shader_alpha_combiner, "float a_a = -as_a; \n");
break;
default:
@ -1939,16 +1939,16 @@ void gfxAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b,
switch (b_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
strcat(fragment_shader_alpha_combiner, "float a_b = 0.0; \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
strcat(fragment_shader_alpha_combiner, "float a_b = as_b; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
strcat(fragment_shader_alpha_combiner, "float a_b = 1.0 - as_b; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
strcat(fragment_shader_alpha_combiner, "float a_b = -as_b; \n");
break;
default:
@ -2014,7 +2014,7 @@ void gfxAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b,
need_to_compile = 1;
}
void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mode, GrTCCUColor_t b, GrCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, gfxCombineMode_t a_mode, GrTCCUColor_t b, gfxCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
{
int num_tex;
WriteTrace(TraceGlitch, TraceDebug, "tmu: %d a: %d a_mode: %d b: %d b_mode: %d c: %d c_invert: %d d: %d d_invert: %d shift: %d invert: %d", tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
@ -2110,25 +2110,25 @@ void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mo
switch (a_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_a = vec4(0.0); \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_a = vec4(0.0); \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_a = ctex0s_a; \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_a = ctex1s_a; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_a = vec4(1.0) - ctex0s_a; \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_a = vec4(1.0) - ctex1s_a; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_a = -ctex0s_a; \n");
else
@ -2208,25 +2208,25 @@ void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mo
switch (b_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_b = vec4(0.0); \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_b = vec4(0.0); \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_b = ctex0s_b; \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_b = ctex1s_b; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_b = vec4(1.0) - ctex0s_b; \n");
else
strcat(fragment_shader_texture1, "vec4 ctex1_b = vec4(1.0) - ctex1s_b; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_b = -ctex0s_b; \n");
else
@ -2373,7 +2373,7 @@ void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mo
need_to_compile = 1;
}
void gfxTexAlphaCombineExt(GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mode, GrTACUColor_t b, GrCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
void gfxTexAlphaCombineExt(GrChipID_t tmu, GrTACUColor_t a, gfxCombineMode_t a_mode, GrTACUColor_t b, gfxCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert)
{
int num_tex;
WriteTrace(TraceGlitch, TraceDebug, "tmu: %d a: %d a_mode: %d b: %d b_mode: %d c: %d c_invert: %d d: %d d_invert: %d shift, invert: %d", tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
@ -2435,25 +2435,25 @@ void gfxTexAlphaCombineExt(GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mo
switch (a_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_a.a = 0.0; \n");
else
strcat(fragment_shader_texture1, "ctex1_a.a = 0.0; \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_a.a = ctex0s_a.a; \n");
else
strcat(fragment_shader_texture1, "ctex1_a.a = ctex1s_a.a; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_a.a = 1.0 - ctex0s_a.a; \n");
else
strcat(fragment_shader_texture1, "ctex1_a.a = 1.0 - ctex1s_a.a; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_a.a = -ctex0s_a.a; \n");
else
@ -2503,25 +2503,25 @@ void gfxTexAlphaCombineExt(GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mo
switch (b_mode)
{
case GR_FUNC_MODE_ZERO:
case GFX_FUNC_MODE_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_b.a = 0.0; \n");
else
strcat(fragment_shader_texture1, "ctex1_b.a = 0.0; \n");
break;
case GR_FUNC_MODE_X:
case GFX_FUNC_MODE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_b.a = ctex0s_b.a; \n");
else
strcat(fragment_shader_texture1, "ctex1_b.a = ctex1s_b.a; \n");
break;
case GR_FUNC_MODE_ONE_MINUS_X:
case GFX_FUNC_MODE_ONE_MINUS_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_b.a = 1.0 - ctex0s_b.a; \n");
else
strcat(fragment_shader_texture1, "ctex1_b.a = 1.0 - ctex1s_b.a; \n");
break;
case GR_FUNC_MODE_NEGATIVE_X:
case GFX_FUNC_MODE_NEGATIVE_X:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_b.a = -ctex0s_b.a; \n");
else

View File

@ -36,10 +36,10 @@ void gfxFogColorValue(GrColor_t fogcolor);
void gfxChromakeyMode(GrChromakeyMode_t mode);
void gfxChromakeyValue(GrColor_t value);
void gfxStippleMode(GrStippleMode_t mode);
void gfxColorCombineExt(gfxCCUColor_t a, GrCombineMode_t a_mode, gfxCCUColor_t b, GrCombineMode_t b_mode, gfxCCUColor_t c, FxBool c_invert, gfxCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
void gfxAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b, GrCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mode, GrTCCUColor_t b, GrCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
void gfxTexAlphaCombineExt(GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mode, GrTACUColor_t b, GrCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
void gfxColorCombineExt(gfxCCUColor_t a, gfxCombineMode_t a_mode, gfxCCUColor_t b, gfxCombineMode_t b_mode, gfxCCUColor_t c, FxBool c_invert, gfxCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
void gfxAlphaCombineExt(GrACUColor_t a, gfxCombineMode_t a_mode, GrACUColor_t b, gfxCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
void gfxTexColorCombineExt(GrChipID_t tmu, GrTCCUColor_t a, gfxCombineMode_t a_mode, GrTCCUColor_t b, gfxCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
void gfxTexAlphaCombineExt(GrChipID_t tmu, GrTACUColor_t a, gfxCombineMode_t a_mode, GrTACUColor_t b, gfxCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
void gfxConstantColorValueExt(GrChipID_t tmu, GrColor_t value);
void gfxVertexLayout(FxU32 param, FxI32 offset, FxU32 mode);
void gfxCullMode(GrCullMode_t mode);

View File

@ -17,6 +17,16 @@
typedef uint8_t gfxAlpha_t;
typedef uint32_t gfxCCUColor_t;
enum gfxCombineMode_t
{
GFX_FUNC_MODE_ZERO = 0x00,
GFX_FUNC_MODE_X = 0x01,
GFX_FUNC_MODE_ONE_MINUS_X = 0x02,
GFX_FUNC_MODE_NEGATIVE_X = 0x03,
GFX_FUNC_MODE_X_MINUS_HALF = 0x04,
};
enum gfxLOD_t
{
GFX_LOD_LOG2_1 = 0x0,
@ -69,4 +79,3 @@ enum gfxTextureFormat_t
GFX_TEXFMT_RGB_888 = 0xFF,
GFX_TEXFMT_GZ = 0x8000,
};

View File

@ -554,17 +554,17 @@ void TexCache()
if (cmb.tex_cmb_ext_use)
{
cmb.t0c_ext_a = GR_CMBX_OTHER_TEXTURE_RGB;
cmb.t0c_ext_a_mode = GR_FUNC_MODE_X;
cmb.t0c_ext_a_mode = GFX_FUNC_MODE_X;
cmb.t0c_ext_b = GR_CMBX_LOCAL_TEXTURE_RGB;
cmb.t0c_ext_b_mode = GR_FUNC_MODE_ZERO;
cmb.t0c_ext_b_mode = GFX_FUNC_MODE_ZERO;
cmb.t0c_ext_c = GR_CMBX_ZERO;
cmb.t0c_ext_c_invert = 1;
cmb.t0c_ext_d = GR_CMBX_ZERO;
cmb.t0c_ext_d_invert = 0;
cmb.t0a_ext_a = GR_CMBX_OTHER_TEXTURE_ALPHA;
cmb.t0a_ext_a_mode = GR_FUNC_MODE_X;
cmb.t0a_ext_a_mode = GFX_FUNC_MODE_X;
cmb.t0a_ext_b = GR_CMBX_LOCAL_TEXTURE_ALPHA;
cmb.t0a_ext_b_mode = GR_FUNC_MODE_ZERO;
cmb.t0a_ext_b_mode = GFX_FUNC_MODE_ZERO;
cmb.t0a_ext_c = GR_CMBX_ZERO;
cmb.t0a_ext_c_invert = 1;
cmb.t0a_ext_d = GR_CMBX_ZERO;
@ -577,17 +577,17 @@ void TexCache()
if (cmb.tex_cmb_ext_use)
{
cmb.t0c_ext_a = GR_CMBX_LOCAL_TEXTURE_RGB;
cmb.t0c_ext_a_mode = GR_FUNC_MODE_ZERO;
cmb.t0c_ext_a_mode = GFX_FUNC_MODE_ZERO;
cmb.t0c_ext_b = GR_CMBX_LOCAL_TEXTURE_RGB;
cmb.t0c_ext_b_mode = GR_FUNC_MODE_ZERO;
cmb.t0c_ext_b_mode = GFX_FUNC_MODE_ZERO;
cmb.t0c_ext_c = GR_CMBX_ZERO;
cmb.t0c_ext_c_invert = 0;
cmb.t0c_ext_d = GR_CMBX_ZERO;
cmb.t0c_ext_d_invert = 0;
cmb.t0a_ext_a = GR_CMBX_LOCAL_TEXTURE_ALPHA;
cmb.t0a_ext_a_mode = GR_FUNC_MODE_ZERO;
cmb.t0a_ext_a_mode = GFX_FUNC_MODE_ZERO;
cmb.t0a_ext_b = GR_CMBX_LOCAL_TEXTURE_ALPHA;
cmb.t0a_ext_b_mode = GR_FUNC_MODE_ZERO;
cmb.t0a_ext_b_mode = GFX_FUNC_MODE_ZERO;
cmb.t0a_ext_c = GR_CMBX_ZERO;
cmb.t0a_ext_c_invert = 0;
cmb.t0a_ext_d = GR_CMBX_ZERO;
@ -600,17 +600,17 @@ void TexCache()
if (cmb.tex_cmb_ext_use)
{
cmb.t1c_ext_a = GR_CMBX_OTHER_TEXTURE_RGB;
cmb.t1c_ext_a_mode = GR_FUNC_MODE_X;
cmb.t1c_ext_a_mode = GFX_FUNC_MODE_X;
cmb.t1c_ext_b = GR_CMBX_LOCAL_TEXTURE_RGB;
cmb.t1c_ext_b_mode = GR_FUNC_MODE_ZERO;
cmb.t1c_ext_b_mode = GFX_FUNC_MODE_ZERO;
cmb.t1c_ext_c = GR_CMBX_ZERO;
cmb.t1c_ext_c_invert = 1;
cmb.t1c_ext_d = GR_CMBX_ZERO;
cmb.t1c_ext_d_invert = 0;
cmb.t1a_ext_a = GR_CMBX_OTHER_TEXTURE_ALPHA;
cmb.t1a_ext_a_mode = GR_FUNC_MODE_X;
cmb.t1a_ext_a_mode = GFX_FUNC_MODE_X;
cmb.t1a_ext_b = GR_CMBX_LOCAL_TEXTURE_ALPHA;
cmb.t1a_ext_b_mode = GR_FUNC_MODE_ZERO;
cmb.t1a_ext_b_mode = GFX_FUNC_MODE_ZERO;
cmb.t1a_ext_c = GR_CMBX_ZERO;
cmb.t1a_ext_c_invert = 1;
cmb.t1a_ext_d = GR_CMBX_ZERO;
@ -623,17 +623,17 @@ void TexCache()
if (cmb.tex_cmb_ext_use)
{
cmb.t1c_ext_a = GR_CMBX_LOCAL_TEXTURE_RGB;
cmb.t1c_ext_a_mode = GR_FUNC_MODE_ZERO;
cmb.t1c_ext_a_mode = GFX_FUNC_MODE_ZERO;
cmb.t1c_ext_b = GR_CMBX_LOCAL_TEXTURE_RGB;
cmb.t1c_ext_b_mode = GR_FUNC_MODE_ZERO;
cmb.t1c_ext_b_mode = GFX_FUNC_MODE_ZERO;
cmb.t1c_ext_c = GR_CMBX_ZERO;
cmb.t1c_ext_c_invert = 0;
cmb.t1c_ext_d = GR_CMBX_ZERO;
cmb.t1c_ext_d_invert = 0;
cmb.t1a_ext_a = GR_CMBX_LOCAL_TEXTURE_ALPHA;
cmb.t1a_ext_a_mode = GR_FUNC_MODE_ZERO;
cmb.t1a_ext_a_mode = GFX_FUNC_MODE_ZERO;
cmb.t1a_ext_b = GR_CMBX_LOCAL_TEXTURE_ALPHA;
cmb.t1a_ext_b_mode = GR_FUNC_MODE_ZERO;
cmb.t1a_ext_b_mode = GFX_FUNC_MODE_ZERO;
cmb.t1a_ext_c = GR_CMBX_ZERO;
cmb.t1a_ext_c_invert = 0;
cmb.t1a_ext_d = GR_CMBX_ZERO;