[Video] Change gfxCombineFactor_t to GrCombineFactor_t

This commit is contained in:
zilmar 2017-07-26 21:46:02 +10:00
parent 372a7ec1f5
commit 351e4a74b2
12 changed files with 942 additions and 916 deletions

File diff suppressed because one or more lines are too long

View File

@ -46,15 +46,21 @@ typedef struct
{
uint32_t ccolor; // constant color to set at the end, color and alpha
gfxCombineFunction_t c_fnc;
uint32_t c_fac, c_loc, c_oth; // gfxColorCombine flags
gfxCombineFactor_t c_fac;
uint32_t c_loc, c_oth; // gfxColorCombine flags
gfxCombineFunction_t a_fnc;
gfxCombineFactor_t a_fac;
gfxCombineFunction_t tmu0_func;
gfxCombineFactor_t tmu0_fac;
gfxCombineFunction_t tmu1_func;
gfxCombineFactor_t tmu1_fac;
gfxCombineFunction_t tmu0_a_func;
gfxCombineFactor_t tmu0_a_fac;
gfxCombineFunction_t tmu1_a_func;
uint32_t a_fac, a_loc, a_oth; // gfxAlphaCombine flags
uint32_t tex, tmu0_fac, tmu0_invert, tmu1_fac, tmu1_invert;
uint32_t tmu0_a_fac, tmu0_a_invert, tmu1_a_fac, tmu1_a_invert;
gfxCombineFactor_t tmu1_a_fac;
uint32_t a_loc, a_oth; // gfxAlphaCombine flags
uint32_t tex, tmu0_invert, tmu1_invert;
uint32_t tmu0_a_invert, tmu1_a_invert;
int dc0_lodbias, dc1_lodbias;
uint8_t dc0_detailscale, dc1_detailscale;
float dc0_detailmax, dc1_detailmax;

View File

@ -23,8 +23,8 @@ static gfxChipID_t SetupFBtoScreenCombiner(uint32_t texture_size, uint32_t opaqu
if (voodoo.tmem_ptr[GFX_TMU0] + texture_size < voodoo.tex_max_addr[0])
{
tmu = GFX_TMU0;
gfxTexCombine(GFX_TMU1, GFX_COMBINE_FUNCTION_NONE, GR_COMBINE_FACTOR_NONE, GFX_COMBINE_FUNCTION_NONE, GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
gfxTexCombine(GFX_TMU0, GFX_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GFX_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
gfxTexCombine(GFX_TMU1, GFX_COMBINE_FUNCTION_NONE, GFX_COMBINE_FACTOR_NONE, GFX_COMBINE_FUNCTION_NONE, GFX_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
gfxTexCombine(GFX_TMU0, GFX_COMBINE_FUNCTION_LOCAL, GFX_COMBINE_FACTOR_NONE, GFX_COMBINE_FUNCTION_LOCAL, GFX_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
}
else
{
@ -33,16 +33,16 @@ static gfxChipID_t SetupFBtoScreenCombiner(uint32_t texture_size, uint32_t opaqu
tmu = GFX_TMU1;
gfxTexCombine(GFX_TMU1,
GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE,
FXFALSE);
gfxTexCombine(GFX_TMU0,
GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
FXFALSE,
FXFALSE);
}
@ -53,13 +53,13 @@ static gfxChipID_t SetupFBtoScreenCombiner(uint32_t texture_size, uint32_t opaqu
GR_TEXTURECLAMP_CLAMP);
// gfxConstantColorValue (0xFFFFFFFF);
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
// GR_COMBINE_OTHER_CONSTANT,
FXFALSE);
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
FXFALSE);
@ -398,7 +398,7 @@ static void DrawDepthBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
gfxChipID_t tmu = SetupFBtoScreenCombiner(tex_size*width256*height256, fb_info.opaque);
gfxConstantColorValue(rdp.fog_color);
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_CONSTANT,
FXFALSE);
@ -468,12 +468,12 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
t_info.aspectRatioLog2 = GFX_ASPECT_LOG2_1x1;
gfxConstantColorValue(rdp.fog_color);
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GR_COMBINE_LOCAL_CONSTANT,
GR_COMBINE_OTHER_NONE,
FXFALSE);
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
FXFALSE);
@ -486,16 +486,16 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
gfxCullMode(GR_CULL_DISABLE);
gfxTexCombine(GFX_TMU1,
GFX_COMBINE_FUNCTION_NONE,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_NONE,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE,
FXFALSE);
gfxTexCombine(GFX_TMU0,
GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE,
FXFALSE);
// gfxAuxBufferExt( GFX_BUFFER_AUXBUFFER );
@ -580,7 +580,7 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
gfxChipID_t tmu = SetupFBtoScreenCombiner(gfxTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info), fb_info.opaque);
gfxConstantColorValue(rdp.fog_color);
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_CONSTANT,
FXFALSE);

View File

@ -740,43 +740,43 @@ void writeGLSLColorFactor(int factor, int local, int need_local, int other, int
{
switch (factor)
{
case GR_COMBINE_FACTOR_ZERO:
case GFX_COMBINE_FACTOR_ZERO:
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(0.0); \n");
break;
case GR_COMBINE_FACTOR_LOCAL:
case GFX_COMBINE_FACTOR_LOCAL:
if (need_local) writeGLSLColorLocal(local);
strcat(fragment_shader_color_combiner, "vec4 color_factor = color_local; \n");
break;
case GR_COMBINE_FACTOR_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_OTHER_ALPHA:
if (need_other) writeGLSLColorOther(other);
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(color_other.a); \n");
break;
case GR_COMBINE_FACTOR_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_LOCAL_ALPHA:
if (need_local) writeGLSLColorLocal(local);
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(color_local.a); \n");
break;
case GR_COMBINE_FACTOR_TEXTURE_ALPHA:
case GFX_COMBINE_FACTOR_TEXTURE_ALPHA:
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(ctexture1.a); \n");
break;
case GR_COMBINE_FACTOR_TEXTURE_RGB:
case GFX_COMBINE_FACTOR_TEXTURE_RGB:
strcat(fragment_shader_color_combiner, "vec4 color_factor = ctexture1; \n");
break;
case GR_COMBINE_FACTOR_ONE:
case GFX_COMBINE_FACTOR_ONE:
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL:
if (need_local) writeGLSLColorLocal(local);
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - color_local; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
if (need_other) writeGLSLColorOther(other);
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - vec4(color_other.a); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
if (need_local) writeGLSLColorLocal(local);
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - vec4(color_local.a); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA:
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - vec4(ctexture1.a); \n");
break;
default:
@ -784,7 +784,7 @@ void writeGLSLColorFactor(int factor, int local, int need_local, int other, int
}
}
void gfxColorCombine(gfxCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert)
void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert)
{
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
static int last_function = 0;
@ -948,40 +948,40 @@ void writeGLSLAlphaFactor(int factor, int local, int need_local, int other, int
{
switch (factor)
{
case GR_COMBINE_FACTOR_ZERO:
case GFX_COMBINE_FACTOR_ZERO:
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 0.0; \n");
break;
case GR_COMBINE_FACTOR_LOCAL:
case GFX_COMBINE_FACTOR_LOCAL:
if (need_local) writeGLSLAlphaLocal(local);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = alpha_local; \n");
break;
case GR_COMBINE_FACTOR_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_OTHER_ALPHA:
if (need_other) writeGLSLAlphaOther(other);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = alpha_other; \n");
break;
case GR_COMBINE_FACTOR_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_LOCAL_ALPHA:
if (need_local) writeGLSLAlphaLocal(local);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = alpha_local; \n");
break;
case GR_COMBINE_FACTOR_TEXTURE_ALPHA:
case GFX_COMBINE_FACTOR_TEXTURE_ALPHA:
strcat(fragment_shader_alpha_combiner, "float alpha_factor = ctexture1.a; \n");
break;
case GR_COMBINE_FACTOR_ONE:
case GFX_COMBINE_FACTOR_ONE:
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL:
if (need_local) writeGLSLAlphaLocal(local);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - alpha_local; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
if (need_other) writeGLSLAlphaOther(other);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - alpha_other; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
if (need_local) writeGLSLAlphaLocal(local);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - alpha_local; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA:
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - ctexture1.a; \n");
break;
default:
@ -989,7 +989,7 @@ void writeGLSLAlphaFactor(int factor, int local, int need_local, int other, int
}
}
void gfxAlphaCombine(gfxCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert)
void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert)
{
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
static int last_function = 0;
@ -1084,61 +1084,61 @@ void writeGLSLTextureColorFactor(int num_tex, int factor)
{
switch (factor)
{
case GR_COMBINE_FACTOR_ZERO:
case GFX_COMBINE_FACTOR_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(0.0); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(0.0); \n");
break;
case GR_COMBINE_FACTOR_LOCAL:
case GFX_COMBINE_FACTOR_LOCAL:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = readtex0; \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = readtex1; \n");
break;
case GR_COMBINE_FACTOR_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_OTHER_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(0.0); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(ctexture0.a); \n");
break;
case GR_COMBINE_FACTOR_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_LOCAL_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(readtex0.a); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(readtex1.a); \n");
break;
case GR_COMBINE_FACTOR_DETAIL_FACTOR:
case GFX_COMBINE_FACTOR_DETAIL_FACTOR:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(lambda); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(lambda); \n");
break;
case GR_COMBINE_FACTOR_ONE:
case GFX_COMBINE_FACTOR_ONE:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(1.0); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(1.0) - readtex0; \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0) - readtex1; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(1.0) - vec4(0.0); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0) - vec4(ctexture0.a); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(1.0) - vec4(readtex0.a); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0) - vec4(readtex1.a); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR:
case GFX_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(1.0) - vec4(lambda); \n");
else
@ -1153,61 +1153,61 @@ void writeGLSLTextureAlphaFactor(int num_tex, int factor)
{
switch (factor)
{
case GR_COMBINE_FACTOR_ZERO:
case GFX_COMBINE_FACTOR_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 0.0; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 0.0; \n");
break;
case GR_COMBINE_FACTOR_LOCAL:
case GFX_COMBINE_FACTOR_LOCAL:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = readtex0.a; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = readtex1.a; \n");
break;
case GR_COMBINE_FACTOR_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_OTHER_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 0.0; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = ctexture0.a; \n");
break;
case GR_COMBINE_FACTOR_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_LOCAL_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = readtex0.a; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = readtex1.a; \n");
break;
case GR_COMBINE_FACTOR_DETAIL_FACTOR:
case GFX_COMBINE_FACTOR_DETAIL_FACTOR:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = lambda; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = lambda; \n");
break;
case GR_COMBINE_FACTOR_ONE:
case GFX_COMBINE_FACTOR_ONE:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 1.0; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 1.0 - readtex0.a; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0 - readtex1.a; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 1.0 - 0.0; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0 - ctexture0.a; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 1.0 - readtex0.a; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0 - readtex1.a; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR:
case GFX_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 1.0 - lambda; \n");
else
@ -1218,7 +1218,7 @@ void writeGLSLTextureAlphaFactor(int num_tex, int factor)
}
}
void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, GrCombineFactor_t rgb_factor, gfxCombineFunction_t alpha_function, GrCombineFactor_t alpha_factor, bool rgb_invert, bool alpha_invert)
void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, gfxCombineFactor_t rgb_factor, gfxCombineFunction_t alpha_function, gfxCombineFactor_t alpha_factor, bool rgb_invert, bool alpha_invert)
{
WriteTrace(TraceGlitch, TraceDebug, "tmu: %d rgb_function: %d rgb_factor: %d alpha_function: %d alpha_factor: %d rgb_invert: %d alpha_invert: %d", tmu, rgb_function, rgb_factor, alpha_function, alpha_factor, rgb_invert, alpha_invert);
int num_tex;
@ -1372,7 +1372,7 @@ void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, GrCombine
switch (alpha_function)
{
case GR_COMBINE_FACTOR_ZERO:
case GFX_COMBINE_FACTOR_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctexture0.a = 0.0; \n");
else

View File

@ -678,43 +678,43 @@ void writeGLSLColorFactor(int factor, int local, int need_local, int other, int
{
switch (factor)
{
case GR_COMBINE_FACTOR_ZERO:
case GFX_COMBINE_FACTOR_ZERO:
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(0.0); \n");
break;
case GR_COMBINE_FACTOR_LOCAL:
case GFX_COMBINE_FACTOR_LOCAL:
if (need_local) writeGLSLColorLocal(local);
strcat(fragment_shader_color_combiner, "vec4 color_factor = color_local; \n");
break;
case GR_COMBINE_FACTOR_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_OTHER_ALPHA:
if (need_other) writeGLSLColorOther(other);
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(color_other.a); \n");
break;
case GR_COMBINE_FACTOR_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_LOCAL_ALPHA:
if (need_local) writeGLSLColorLocal(local);
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(color_local.a); \n");
break;
case GR_COMBINE_FACTOR_TEXTURE_ALPHA:
case GFX_COMBINE_FACTOR_TEXTURE_ALPHA:
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(ctexture1.a); \n");
break;
case GR_COMBINE_FACTOR_TEXTURE_RGB:
case GFX_COMBINE_FACTOR_TEXTURE_RGB:
strcat(fragment_shader_color_combiner, "vec4 color_factor = ctexture1; \n");
break;
case GR_COMBINE_FACTOR_ONE:
case GFX_COMBINE_FACTOR_ONE:
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL:
if (need_local) writeGLSLColorLocal(local);
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - color_local; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
if (need_other) writeGLSLColorOther(other);
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - vec4(color_other.a); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
if (need_local) writeGLSLColorLocal(local);
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - vec4(color_local.a); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA:
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - vec4(ctexture1.a); \n");
break;
default:
@ -722,7 +722,7 @@ void writeGLSLColorFactor(int factor, int local, int need_local, int other, int
}
}
void gfxColorCombine(gfxCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert)
void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert)
{
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
@ -885,40 +885,40 @@ void writeGLSLAlphaFactor(int factor, int local, int need_local, int other, int
{
switch (factor)
{
case GR_COMBINE_FACTOR_ZERO:
case GFX_COMBINE_FACTOR_ZERO:
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 0.0; \n");
break;
case GR_COMBINE_FACTOR_LOCAL:
case GFX_COMBINE_FACTOR_LOCAL:
if (need_local) writeGLSLAlphaLocal(local);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = alpha_local; \n");
break;
case GR_COMBINE_FACTOR_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_OTHER_ALPHA:
if (need_other) writeGLSLAlphaOther(other);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = alpha_other; \n");
break;
case GR_COMBINE_FACTOR_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_LOCAL_ALPHA:
if (need_local) writeGLSLAlphaLocal(local);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = alpha_local; \n");
break;
case GR_COMBINE_FACTOR_TEXTURE_ALPHA:
case GFX_COMBINE_FACTOR_TEXTURE_ALPHA:
strcat(fragment_shader_alpha_combiner, "float alpha_factor = ctexture1.a; \n");
break;
case GR_COMBINE_FACTOR_ONE:
case GFX_COMBINE_FACTOR_ONE:
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL:
if (need_local) writeGLSLAlphaLocal(local);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - alpha_local; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
if (need_other) writeGLSLAlphaOther(other);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - alpha_other; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
if (need_local) writeGLSLAlphaLocal(local);
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - alpha_local; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA:
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - ctexture1.a; \n");
break;
default:
@ -926,7 +926,7 @@ void writeGLSLAlphaFactor(int factor, int local, int need_local, int other, int
}
}
void gfxAlphaCombine(gfxCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert)
void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert)
{
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
static int last_function = 0;
@ -1021,61 +1021,61 @@ void writeGLSLTextureColorFactor(int num_tex, int factor)
{
switch (factor)
{
case GR_COMBINE_FACTOR_ZERO:
case GFX_COMBINE_FACTOR_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(0.0); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(0.0); \n");
break;
case GR_COMBINE_FACTOR_LOCAL:
case GFX_COMBINE_FACTOR_LOCAL:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = readtex0; \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = readtex1; \n");
break;
case GR_COMBINE_FACTOR_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_OTHER_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(0.0); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(ctexture0.a); \n");
break;
case GR_COMBINE_FACTOR_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_LOCAL_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(readtex0.a); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(readtex1.a); \n");
break;
case GR_COMBINE_FACTOR_DETAIL_FACTOR:
case GFX_COMBINE_FACTOR_DETAIL_FACTOR:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(lambda); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(lambda); \n");
break;
case GR_COMBINE_FACTOR_ONE:
case GFX_COMBINE_FACTOR_ONE:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(1.0); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(1.0) - readtex0; \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0) - readtex1; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(1.0) - vec4(0.0); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0) - vec4(ctexture0.a); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(1.0) - vec4(readtex0.a); \n");
else
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0) - vec4(readtex1.a); \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR:
case GFX_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR:
if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 texture0_color_factor = vec4(1.0) - vec4(lambda); \n");
else
@ -1090,61 +1090,61 @@ void writeGLSLTextureAlphaFactor(int num_tex, int factor)
{
switch (factor)
{
case GR_COMBINE_FACTOR_ZERO:
case GFX_COMBINE_FACTOR_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 0.0; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 0.0; \n");
break;
case GR_COMBINE_FACTOR_LOCAL:
case GFX_COMBINE_FACTOR_LOCAL:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = readtex0.a; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = readtex1.a; \n");
break;
case GR_COMBINE_FACTOR_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_OTHER_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 0.0; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = ctexture0.a; \n");
break;
case GR_COMBINE_FACTOR_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_LOCAL_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = readtex0.a; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = readtex1.a; \n");
break;
case GR_COMBINE_FACTOR_DETAIL_FACTOR:
case GFX_COMBINE_FACTOR_DETAIL_FACTOR:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = lambda; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = lambda; \n");
break;
case GR_COMBINE_FACTOR_ONE:
case GFX_COMBINE_FACTOR_ONE:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 1.0; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 1.0 - readtex0.a; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0 - readtex1.a; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 1.0 - 0.0; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0 - ctexture0.a; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
case GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 1.0 - readtex0.a; \n");
else
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0 - readtex1.a; \n");
break;
case GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR:
case GFX_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR:
if (num_tex == 0)
strcat(fragment_shader_texture0, "float texture0_alpha_factor = 1.0 - lambda; \n");
else
@ -1155,7 +1155,7 @@ void writeGLSLTextureAlphaFactor(int num_tex, int factor)
}
}
void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, GrCombineFactor_t rgb_factor, gfxCombineFunction_t alpha_function, GrCombineFactor_t alpha_factor, bool rgb_invert, bool alpha_invert)
void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, gfxCombineFactor_t rgb_factor, gfxCombineFunction_t alpha_function, gfxCombineFactor_t alpha_factor, bool rgb_invert, bool alpha_invert)
{
WriteTrace(TraceGlitch, TraceDebug, "tmu: %d rgb_function: %d rgb_factor: %d alpha_function: %d alpha_factor: %d rgb_invert: %d alpha_invert: %d", tmu, rgb_function, rgb_factor, alpha_function, alpha_factor, rgb_invert, alpha_invert);
int num_tex;
@ -1309,7 +1309,7 @@ void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, GrCombine
switch (alpha_function)
{
case GR_COMBINE_FACTOR_ZERO:
case GFX_COMBINE_FACTOR_ZERO:
if (num_tex == 0)
strcat(fragment_shader_texture0, "ctexture0.a = 0.0; \n");
else

View File

@ -23,9 +23,9 @@ void gfxTextureBufferExt(gfxChipID_t tmu, uint32_t startAddress, gfxLOD_t lodmin
uint32_t gfxTexMaxAddress(gfxChipID_t tmu);
uint32_t gfxTexTextureMemRequired(uint32_t evenOdd, gfxTexInfo *info);
void gfxConstantColorValue(gfxColor_t value);
void gfxColorCombine(gfxCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert);
void gfxAlphaCombine(gfxCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert);
void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, GrCombineFactor_t rgb_factor, gfxCombineFunction_t alpha_function, GrCombineFactor_t alpha_factor, bool rgb_invert, bool alpha_invert);
void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert);
void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, bool invert);
void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, gfxCombineFactor_t rgb_factor, gfxCombineFunction_t alpha_function, gfxCombineFactor_t alpha_factor, bool rgb_invert, bool alpha_invert);
void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df);
void gfxAlphaTestReferenceValue(gfxAlpha_t value);
void gfxAlphaTestFunction(GrCmpFnc_t function);

View File

@ -126,6 +126,26 @@ enum gfxCombineFunction_t
GFX_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA = 0x10,
};
enum gfxCombineFactor_t
{
GFX_COMBINE_FACTOR_ZERO = 0x0,
GFX_COMBINE_FACTOR_NONE = GFX_COMBINE_FACTOR_ZERO,
GFX_COMBINE_FACTOR_LOCAL = 0x1,
GFX_COMBINE_FACTOR_OTHER_ALPHA = 0x2,
GFX_COMBINE_FACTOR_LOCAL_ALPHA = 0x3,
GFX_COMBINE_FACTOR_TEXTURE_ALPHA = 0x4,
GFX_COMBINE_FACTOR_TEXTURE_RGB = 0x5,
GFX_COMBINE_FACTOR_DETAIL_FACTOR = GFX_COMBINE_FACTOR_TEXTURE_ALPHA,
GFX_COMBINE_FACTOR_LOD_FRACTION = 0x5,
GFX_COMBINE_FACTOR_ONE = 0x8,
GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL = 0x9,
GFX_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA = 0xa,
GFX_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA = 0xb,
GFX_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA = 0xc,
GFX_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR = GFX_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA,
GFX_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION = 0xd,
};
enum GFX_CMBX
{
GFX_CMBX_ZERO = 0x00,

View File

@ -324,13 +324,13 @@ int OpenTextureBuffer(COLOR_IMAGE & cimage)
static gfxTextureFormat_t TexBufSetupCombiner(int force_rgb = FALSE)
{
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
// GR_COMBINE_OTHER_CONSTANT,
FXFALSE);
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
FXFALSE);
@ -355,16 +355,16 @@ static gfxTextureFormat_t TexBufSetupCombiner(int force_rgb = FALSE)
{
gfxTexCombine(GFX_TMU1,
GFX_COMBINE_FUNCTION_NONE,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_NONE,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE,
FXFALSE);
gfxTexCombine(GFX_TMU0,
color_source,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE,
FXTRUE);
}
@ -372,16 +372,16 @@ static gfxTextureFormat_t TexBufSetupCombiner(int force_rgb = FALSE)
{
gfxTexCombine(GFX_TMU1,
color_source,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE,
FXTRUE);
gfxTexCombine(GFX_TMU0,
GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
FXFALSE,
FXFALSE);
}

View File

@ -540,7 +540,7 @@ void TexCache()
if (tmu_0_mode == TMUMODE_PASSTHRU)
{
cmb.tmu0_func = cmb.tmu0_a_func = GFX_COMBINE_FUNCTION_SCALE_OTHER;
cmb.tmu0_fac = cmb.tmu0_a_fac = GR_COMBINE_FACTOR_ONE;
cmb.tmu0_fac = cmb.tmu0_a_fac = GFX_COMBINE_FACTOR_ONE;
if (cmb.tex_cmb_ext_use)
{
cmb.t0c_ext_a = GFX_CMBX_OTHER_TEXTURE_RGB;
@ -564,7 +564,7 @@ void TexCache()
else if (tmu_0_mode == TMUMODE_NONE)
{
cmb.tmu0_func = cmb.tmu0_a_func = GFX_COMBINE_FUNCTION_NONE;
cmb.tmu0_fac = cmb.tmu0_a_fac = GR_COMBINE_FACTOR_NONE;
cmb.tmu0_fac = cmb.tmu0_a_fac = GFX_COMBINE_FACTOR_NONE;
if (cmb.tex_cmb_ext_use)
{
cmb.t0c_ext_a = GFX_CMBX_LOCAL_TEXTURE_RGB;
@ -588,7 +588,7 @@ void TexCache()
if (tmu_1_mode == TMUMODE_PASSTHRU)
{
cmb.tmu1_func = cmb.tmu1_a_func = GFX_COMBINE_FUNCTION_SCALE_OTHER;
cmb.tmu1_fac = cmb.tmu1_a_fac = GR_COMBINE_FACTOR_ONE;
cmb.tmu1_fac = cmb.tmu1_a_fac = GFX_COMBINE_FACTOR_ONE;
if (cmb.tex_cmb_ext_use)
{
cmb.t1c_ext_a = GFX_CMBX_OTHER_TEXTURE_RGB;
@ -612,7 +612,7 @@ void TexCache()
else if (tmu_1_mode == TMUMODE_NONE)
{
cmb.tmu1_func = cmb.tmu1_a_func = GFX_COMBINE_FUNCTION_NONE;
cmb.tmu1_fac = cmb.tmu1_a_fac = GR_COMBINE_FACTOR_NONE;
cmb.tmu1_fac = cmb.tmu1_a_fac = GFX_COMBINE_FACTOR_NONE;
if (cmb.tex_cmb_ext_use)
{
cmb.t1c_ext_a = GFX_CMBX_LOCAL_TEXTURE_RGB;
@ -641,14 +641,14 @@ void TexCache()
if (rdp.best_tex == 0)
{
cmb.tmu0_func = cmb.tmu0_a_func = GFX_COMBINE_FUNCTION_LOCAL;
cmb.tmu0_fac = cmb.tmu0_a_fac = GR_COMBINE_FACTOR_NONE;
cmb.tmu0_fac = cmb.tmu0_a_fac = GFX_COMBINE_FACTOR_NONE;
tmu_0 = GFX_TMU0;
tmu_1 = GFX_TMU1;
}
else
{
cmb.tmu1_func = cmb.tmu1_a_func = GFX_COMBINE_FUNCTION_LOCAL;
cmb.tmu1_fac = cmb.tmu1_a_fac = GR_COMBINE_FACTOR_NONE;
cmb.tmu1_fac = cmb.tmu1_a_fac = GFX_COMBINE_FACTOR_NONE;
tmu_1 = GFX_TMU0;
tmu_0 = GFX_TMU1;
}

View File

@ -1953,12 +1953,12 @@ void update()
void set_message_combiner()
{
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
FXFALSE);
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
FXFALSE);
@ -1971,15 +1971,15 @@ void set_message_combiner()
gfxTexFilterMode(GFX_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR);
gfxTexCombine(GFX_TMU1,
GFX_COMBINE_FUNCTION_NONE,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_NONE,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE, FXFALSE);
gfxTexCombine(GFX_TMU0,
GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE, FXFALSE);
gfxTexSource(GFX_TMU0,
voodoo.tex_min_addr[GFX_TMU0] + offset_font,

View File

@ -2503,13 +2503,13 @@ void rdp_fillrect()
gfxConstantColorValue(color);
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GR_COMBINE_LOCAL_CONSTANT,
GR_COMBINE_OTHER_NONE,
FXFALSE);
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GR_COMBINE_LOCAL_CONSTANT,
GR_COMBINE_OTHER_NONE,
FXFALSE);
@ -2541,7 +2541,7 @@ void rdp_fillrect()
if ((rdp.othermode_l & 0x4000) && ((rdp.othermode_l >> 16) == 0x0550)) //special blender mode for Bomberman64
{
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GR_COMBINE_LOCAL_CONSTANT,
GR_COMBINE_OTHER_NONE,
FXFALSE);
@ -3119,12 +3119,12 @@ void SetWireframeCol()
//case CSettings::wfmode_NormalColors: // normal colors, don't do anything
case CSettings::wfmode_VertexColors:
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GR_COMBINE_LOCAL_ITERATED,
GR_COMBINE_OTHER_NONE,
FXFALSE);
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GR_COMBINE_LOCAL_ITERATED,
GR_COMBINE_OTHER_NONE,
FXFALSE);
@ -3134,25 +3134,25 @@ void SetWireframeCol()
GR_BLEND_ZERO);
gfxTexCombine(GFX_TMU0,
GFX_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE, FXFALSE);
gfxTexCombine(GFX_TMU1,
GFX_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE, FXFALSE);
break;
case CSettings::wfmode_RedOnly:
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GR_COMBINE_LOCAL_CONSTANT,
GR_COMBINE_OTHER_NONE,
FXFALSE);
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GR_COMBINE_LOCAL_CONSTANT,
GR_COMBINE_OTHER_NONE,
FXFALSE);
@ -3163,15 +3163,15 @@ void SetWireframeCol()
GR_BLEND_ZERO);
gfxTexCombine(GFX_TMU0,
GFX_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE, FXFALSE);
gfxTexCombine(GFX_TMU1,
GFX_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE, FXFALSE);
break;
}

View File

@ -35,9 +35,9 @@ float set_sprite_combine_mode()
if (rdp.tbuff_tex && rdp.tbuff_tex->info.format == GFX_TEXFMT_ALPHA_INTENSITY_88)
color_source = GFX_COMBINE_FUNCTION_LOCAL_ALPHA;
cmb.tmu1_func = cmb.tmu0_func = color_source;
cmb.tmu1_fac = cmb.tmu0_fac = GR_COMBINE_FACTOR_NONE;
cmb.tmu1_fac = cmb.tmu0_fac = GFX_COMBINE_FACTOR_NONE;
cmb.tmu1_a_func = cmb.tmu0_a_func = GFX_COMBINE_FUNCTION_LOCAL;
cmb.tmu1_a_fac = cmb.tmu0_a_fac = GR_COMBINE_FACTOR_NONE;
cmb.tmu1_a_fac = cmb.tmu0_a_fac = GFX_COMBINE_FACTOR_NONE;
cmb.tmu1_invert = cmb.tmu0_invert = FXFALSE;
cmb.tmu1_a_invert = cmb.tmu0_a_invert = FXFALSE;
}
@ -73,12 +73,12 @@ float set_sprite_combine_mode()
if (rdp.cycle_mode == 2)
{
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
FXFALSE);
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
FXFALSE);
@ -146,25 +146,25 @@ void DrawHiresDepthImage(const DRAWIMAGE & d)
&t_info);
gfxTexCombine(GFX_TMU1,
GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
GFX_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GFX_COMBINE_FACTOR_NONE,
FXFALSE,
FXFALSE);
gfxTexCombine(GFX_TMU0,
GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
FXFALSE,
FXFALSE);
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
FXFALSE);
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GFX_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE,
FXFALSE);