[Video] Change GrAlphaBlendFnc_t to gfxAlphaBlendFnc_t

This commit is contained in:
zilmar 2017-07-31 17:46:36 +10:00
parent b319feb9be
commit 0228bc744c
12 changed files with 115 additions and 92 deletions

View File

@ -15518,8 +15518,8 @@ void Combine()
uint32_t cmb_mode_c = (rdp.cycle1 << 16) | (rdp.cycle2 & 0xFFFF); uint32_t cmb_mode_c = (rdp.cycle1 << 16) | (rdp.cycle2 & 0xFFFF);
uint32_t cmb_mode_a = (rdp.cycle1 & 0x0FFF0000) | ((rdp.cycle2 >> 16) & 0x00000FFF); uint32_t cmb_mode_a = (rdp.cycle1 & 0x0FFF0000) | ((rdp.cycle2 >> 16) & 0x00000FFF);
cmb.abf1 = GR_BLEND_SRC_ALPHA; cmb.abf1 = GFX_BLEND_SRC_ALPHA;
cmb.abf2 = GR_BLEND_ONE_MINUS_SRC_ALPHA; cmb.abf2 = GFX_BLEND_ONE_MINUS_SRC_ALPHA;
#ifdef FASTSEARCH #ifdef FASTSEARCH
// Fast, ordered search // Fast, ordered search
@ -15732,13 +15732,13 @@ void CombineBlender()
case 0x00c0: case 0x00c0:
//ISS64 //ISS64
case 0xc302: case 0xc302:
A_BLEND(GR_BLEND_ONE, GR_BLEND_ZERO); A_BLEND(GFX_BLEND_ONE, GFX_BLEND_ZERO);
break; break;
//Space Invaders //Space Invaders
case 0x0448: case 0x0448:
case 0x055a: case 0x055a:
A_BLEND(GR_BLEND_ONE, GR_BLEND_ONE); A_BLEND(GFX_BLEND_ONE, GFX_BLEND_ONE);
break; break;
//Pokemon Stadium //Pokemon Stadium
@ -15746,11 +15746,11 @@ void CombineBlender()
// LOT in Zelda: MM // LOT in Zelda: MM
case 0xaf50: case 0xaf50:
case 0x0f5a: //clr_in * 0 + clr_mem * 1 case 0x0f5a: //clr_in * 0 + clr_mem * 1
A_BLEND(GR_BLEND_ZERO, GR_BLEND_ONE); A_BLEND(GFX_BLEND_ZERO, GFX_BLEND_ONE);
break; break;
case 0x5f50: //clr_mem * 0 + clr_mem * (1-a) case 0x5f50: //clr_mem * 0 + clr_mem * (1-a)
A_BLEND(GR_BLEND_ZERO, GR_BLEND_ONE_MINUS_SRC_ALPHA); A_BLEND(GFX_BLEND_ZERO, GFX_BLEND_ONE_MINUS_SRC_ALPHA);
break; break;
/* /*
@ -15771,12 +15771,12 @@ void CombineBlender()
rdp.col[0] = rdp.col[0] * (1.0f-percent) + ((rdp.fog_color>>24) & 0xFF) / 255.0f * percent; rdp.col[0] = rdp.col[0] * (1.0f-percent) + ((rdp.fog_color>>24) & 0xFF) / 255.0f * percent;
rdp.col[1] = rdp.col[1] * (1.0f-percent) + ((rdp.fog_color>>16) & 0xFF) / 255.0f * percent; rdp.col[1] = rdp.col[1] * (1.0f-percent) + ((rdp.fog_color>>16) & 0xFF) / 255.0f * percent;
rdp.col[2] = rdp.col[2] * (1.0f-percent) + ((rdp.fog_color>>8) & 0xFF) / 255.0f * percent; rdp.col[2] = rdp.col[2] * (1.0f-percent) + ((rdp.fog_color>>8) & 0xFF) / 255.0f * percent;
A_BLEND (GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA); A_BLEND (GFX_BLEND_SRC_ALPHA, GFX_BLEND_ONE_MINUS_SRC_ALPHA);
} }
break; break;
*/ */
case 0xf550: //clr_fog * a_fog + clr_mem * (1-a) case 0xf550: //clr_fog * a_fog + clr_mem * (1-a)
A_BLEND(GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA); A_BLEND(GFX_BLEND_SRC_ALPHA, GFX_BLEND_ONE_MINUS_SRC_ALPHA);
{ {
uint32_t prim = rdp.prim_color; uint32_t prim = rdp.prim_color;
rdp.prim_color = rdp.fog_color; rdp.prim_color = rdp.fog_color;
@ -15788,7 +15788,7 @@ void CombineBlender()
case 0x0150: //spiderman case 0x0150: //spiderman
case 0x0d18: //clr_in * a_fog + clr_mem * (1-a) case 0x0d18: //clr_in * a_fog + clr_mem * (1-a)
A_BLEND(GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA); A_BLEND(GFX_BLEND_SRC_ALPHA, GFX_BLEND_ONE_MINUS_SRC_ALPHA);
if (rdp.cycle_mode == 1 && rdp.cycle2 != 0x01ff1fff) if (rdp.cycle_mode == 1 && rdp.cycle2 != 0x01ff1fff)
{ {
uint32_t prim = rdp.prim_color; uint32_t prim = rdp.prim_color;
@ -15805,27 +15805,27 @@ void CombineBlender()
ac_prim(); ac_prim();
rdp.prim_color = prim; rdp.prim_color = prim;
} }
A_BLEND(GR_BLEND_SRC_ALPHA, GR_BLEND_ONE); A_BLEND(GFX_BLEND_SRC_ALPHA, GFX_BLEND_ONE);
break; break;
case 0x5000: /* Vigilante 8 explosions */ case 0x5000: /* Vigilante 8 explosions */
A_BLEND(GR_BLEND_ONE_MINUS_SRC_ALPHA, GR_BLEND_SRC_ALPHA); A_BLEND(GFX_BLEND_ONE_MINUS_SRC_ALPHA, GFX_BLEND_SRC_ALPHA);
break; break;
case 0xFA00: // Bomberman second attack case 0xFA00: // Bomberman second attack
A_BLEND(GR_BLEND_ONE, GR_BLEND_ZERO); A_BLEND(GFX_BLEND_ONE, GFX_BLEND_ZERO);
break; break;
//Pokemon Stadium //Pokemon Stadium
case 0x0F1A: case 0x0F1A:
if (rdp.cycle_mode == 0) if (rdp.cycle_mode == 0)
A_BLEND(GR_BLEND_ONE, GR_BLEND_ZERO); A_BLEND(GFX_BLEND_ONE, GFX_BLEND_ZERO);
else else
A_BLEND(GR_BLEND_ZERO, GR_BLEND_ONE); A_BLEND(GFX_BLEND_ZERO, GFX_BLEND_ONE);
break; break;
default: default:
A_BLEND(GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA); A_BLEND(GFX_BLEND_SRC_ALPHA, GFX_BLEND_ONE_MINUS_SRC_ALPHA);
} }
} }
/* /*
@ -15846,15 +15846,15 @@ void CombineBlender()
rdp.col[0] = rdp.col[0] * (1.0f-percent) + ((rdp.fog_color>>24) & 0xFF) / 255.0f * percent; rdp.col[0] = rdp.col[0] * (1.0f-percent) + ((rdp.fog_color>>24) & 0xFF) / 255.0f * percent;
rdp.col[1] = rdp.col[1] * (1.0f-percent) + ((rdp.fog_color>>16) & 0xFF) / 255.0f * percent; rdp.col[1] = rdp.col[1] * (1.0f-percent) + ((rdp.fog_color>>16) & 0xFF) / 255.0f * percent;
rdp.col[2] = rdp.col[2] * (1.0f-percent) + ((rdp.fog_color>>8) & 0xFF) / 255.0f * percent; rdp.col[2] = rdp.col[2] * (1.0f-percent) + ((rdp.fog_color>>8) & 0xFF) / 255.0f * percent;
A_BLEND (GR_BLEND_ONE, GR_BLEND_ZERO); A_BLEND (GFX_BLEND_ONE, GFX_BLEND_ZERO);
} }
*/ */
else if (blendmode == 0x0040) // Mia Soccer Lights else if (blendmode == 0x0040) // Mia Soccer Lights
A_BLEND(GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA); A_BLEND(GFX_BLEND_SRC_ALPHA, GFX_BLEND_ONE_MINUS_SRC_ALPHA);
else if (g_settings->hacks(CSettings::hack_Pilotwings) && (rdp.othermode_l & 0x80)) //CLR_ON_CVG without FORCE_BL else if (g_settings->hacks(CSettings::hack_Pilotwings) && (rdp.othermode_l & 0x80)) //CLR_ON_CVG without FORCE_BL
A_BLEND(GR_BLEND_ZERO, GR_BLEND_ONE); A_BLEND(GFX_BLEND_ZERO, GFX_BLEND_ONE);
else else
A_BLEND(GR_BLEND_ONE, GR_BLEND_ZERO); A_BLEND(GFX_BLEND_ONE, GFX_BLEND_ZERO);
// ALPHA_CVG_SEL means full alpha // ALPHA_CVG_SEL means full alpha
// The reason it wasn't working before was because I wasn't handling rdp:setothermode // The reason it wasn't working before was because I wasn't handling rdp:setothermode
@ -15863,15 +15863,15 @@ void CombineBlender()
{ {
if (g_settings->hacks(CSettings::hack_PMario) && (blendmode == 0x5055)) if (g_settings->hacks(CSettings::hack_PMario) && (blendmode == 0x5055))
{ {
A_BLEND(GR_BLEND_ZERO, GR_BLEND_ONE); A_BLEND(GFX_BLEND_ZERO, GFX_BLEND_ONE);
} }
else if (blendmode == 0x4055) // Mario Golf else if (blendmode == 0x4055) // Mario Golf
{ {
A_BLEND(GR_BLEND_ZERO, GR_BLEND_ONE); A_BLEND(GFX_BLEND_ZERO, GFX_BLEND_ONE);
} }
else else
{ {
A_BLEND(GR_BLEND_ONE, GR_BLEND_ZERO); A_BLEND(GFX_BLEND_ONE, GFX_BLEND_ZERO);
} }
} }
@ -15881,18 +15881,18 @@ void CombineBlender()
{ {
if (rdp.othermode_l == 0xff5a6379) if (rdp.othermode_l == 0xff5a6379)
{ {
A_BLEND(GR_BLEND_ZERO, GR_BLEND_SRC_ALPHA); A_BLEND(GFX_BLEND_ZERO, GFX_BLEND_SRC_ALPHA);
} }
else if (rdp.othermode_l == 0x00504dd9) //players shadows. CVG_DST_WRAP else if (rdp.othermode_l == 0x00504dd9) //players shadows. CVG_DST_WRAP
{ {
A_BLEND(GR_BLEND_ZERO, GR_BLEND_ONE); A_BLEND(GFX_BLEND_ZERO, GFX_BLEND_ONE);
} }
} }
else if (g_settings->hacks(CSettings::hack_TGR)) else if (g_settings->hacks(CSettings::hack_TGR))
{ {
if (rdp.othermode_l == 0x0f0a0235) if (rdp.othermode_l == 0x0f0a0235)
{ {
A_BLEND(GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA); A_BLEND(GFX_BLEND_SRC_ALPHA, GFX_BLEND_ONE_MINUS_SRC_ALPHA);
} }
} }
//*/ //*/

View File

@ -67,7 +67,7 @@ typedef struct
uint8_t dc0_detailscale, dc1_detailscale; uint8_t dc0_detailscale, dc1_detailscale;
float dc0_detailmax, dc1_detailmax; float dc0_detailmax, dc1_detailmax;
float lodbias0, lodbias1; float lodbias0, lodbias1;
uint32_t abf1, abf2; gfxAlphaBlendFnc_t abf1, abf2;
uint32_t mod_0, modcolor_0, modcolor1_0, modcolor2_0, modfactor_0; uint32_t mod_0, modcolor_0, modcolor1_0, modcolor2_0, modfactor_0;
uint32_t mod_1, modcolor_1, modcolor1_1, modcolor2_1, modfactor_1; uint32_t mod_1, modcolor_1, modcolor1_1, modcolor2_1, modfactor_1;
//combine extensions //combine extensions

View File

@ -66,17 +66,17 @@ static gfxChipID_t SetupFBtoScreenCombiner(uint32_t texture_size, uint32_t opaqu
if (opaque) if (opaque)
{ {
gfxAlphaTestFunction(GR_CMP_ALWAYS); gfxAlphaTestFunction(GR_CMP_ALWAYS);
gfxAlphaBlendFunction(GR_BLEND_ONE, gfxAlphaBlendFunction(GFX_BLEND_ONE,
GR_BLEND_ZERO, GFX_BLEND_ZERO,
GR_BLEND_ONE, GFX_BLEND_ONE,
GR_BLEND_ZERO); GFX_BLEND_ZERO);
} }
else else
{ {
gfxAlphaBlendFunction(GR_BLEND_SRC_ALPHA, gfxAlphaBlendFunction(GFX_BLEND_SRC_ALPHA,
GR_BLEND_ONE_MINUS_SRC_ALPHA, GFX_BLEND_ONE_MINUS_SRC_ALPHA,
GR_BLEND_ONE, GFX_BLEND_ONE,
GR_BLEND_ZERO); GFX_BLEND_ZERO);
} }
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
gfxCullMode(GR_CULL_DISABLE); gfxCullMode(GR_CULL_DISABLE);
@ -477,10 +477,10 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
GFX_COMBINE_LOCAL_NONE, GFX_COMBINE_LOCAL_NONE,
GFX_COMBINE_OTHER_TEXTURE, GFX_COMBINE_OTHER_TEXTURE,
FXFALSE); FXFALSE);
gfxAlphaBlendFunction(GR_BLEND_SRC_ALPHA, gfxAlphaBlendFunction(GFX_BLEND_SRC_ALPHA,
GR_BLEND_ONE_MINUS_SRC_ALPHA, GFX_BLEND_ONE_MINUS_SRC_ALPHA,
GR_BLEND_ONE, GFX_BLEND_ONE,
GR_BLEND_ZERO); GFX_BLEND_ZERO);
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
gfxDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
gfxCullMode(GR_CULL_DISABLE); gfxCullMode(GR_CULL_DISABLE);

View File

@ -1464,23 +1464,23 @@ void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, gfxCombin
need_to_compile = 1; need_to_compile = 1;
} }
void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df) void gfxAlphaBlendFunction(gfxAlphaBlendFnc_t rgb_sf, gfxAlphaBlendFnc_t rgb_df, gfxAlphaBlendFnc_t alpha_sf, gfxAlphaBlendFnc_t alpha_df)
{ {
int sfactorRGB = 0, dfactorRGB = 0, sfactorAlpha = 0, dfactorAlpha = 0; int sfactorRGB = 0, dfactorRGB = 0, sfactorAlpha = 0, dfactorAlpha = 0;
WriteTrace(TraceGlitch, TraceDebug, "rgb_sf: %d rgb_df: %d alpha_sf: %d alpha_df: %d", rgb_sf, rgb_df, alpha_sf, alpha_df); WriteTrace(TraceGlitch, TraceDebug, "rgb_sf: %d rgb_df: %d alpha_sf: %d alpha_df: %d", rgb_sf, rgb_df, alpha_sf, alpha_df);
switch (rgb_sf) switch (rgb_sf)
{ {
case GR_BLEND_ZERO: case GFX_BLEND_ZERO:
sfactorRGB = GL_ZERO; sfactorRGB = GL_ZERO;
break; break;
case GR_BLEND_SRC_ALPHA: case GFX_BLEND_SRC_ALPHA:
sfactorRGB = GL_SRC_ALPHA; sfactorRGB = GL_SRC_ALPHA;
break; break;
case GR_BLEND_ONE: case GFX_BLEND_ONE:
sfactorRGB = GL_ONE; sfactorRGB = GL_ONE;
break; break;
case GR_BLEND_ONE_MINUS_SRC_ALPHA: case GFX_BLEND_ONE_MINUS_SRC_ALPHA:
sfactorRGB = GL_ONE_MINUS_SRC_ALPHA; sfactorRGB = GL_ONE_MINUS_SRC_ALPHA;
break; break;
default: default:
@ -1489,16 +1489,16 @@ void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, G
switch (rgb_df) switch (rgb_df)
{ {
case GR_BLEND_ZERO: case GFX_BLEND_ZERO:
dfactorRGB = GL_ZERO; dfactorRGB = GL_ZERO;
break; break;
case GR_BLEND_SRC_ALPHA: case GFX_BLEND_SRC_ALPHA:
dfactorRGB = GL_SRC_ALPHA; dfactorRGB = GL_SRC_ALPHA;
break; break;
case GR_BLEND_ONE: case GFX_BLEND_ONE:
dfactorRGB = GL_ONE; dfactorRGB = GL_ONE;
break; break;
case GR_BLEND_ONE_MINUS_SRC_ALPHA: case GFX_BLEND_ONE_MINUS_SRC_ALPHA:
dfactorRGB = GL_ONE_MINUS_SRC_ALPHA; dfactorRGB = GL_ONE_MINUS_SRC_ALPHA;
break; break;
default: default:
@ -1507,10 +1507,10 @@ void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, G
switch (alpha_sf) switch (alpha_sf)
{ {
case GR_BLEND_ZERO: case GFX_BLEND_ZERO:
sfactorAlpha = GL_ZERO; sfactorAlpha = GL_ZERO;
break; break;
case GR_BLEND_ONE: case GFX_BLEND_ONE:
sfactorAlpha = GL_ONE; sfactorAlpha = GL_ONE;
break; break;
default: default:
@ -1519,10 +1519,10 @@ void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, G
switch (alpha_df) switch (alpha_df)
{ {
case GR_BLEND_ZERO: case GFX_BLEND_ZERO:
dfactorAlpha = GL_ZERO; dfactorAlpha = GL_ZERO;
break; break;
case GR_BLEND_ONE: case GFX_BLEND_ONE:
dfactorAlpha = GL_ONE; dfactorAlpha = GL_ONE;
break; break;
default: default:

View File

@ -1401,23 +1401,23 @@ void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, gfxCombin
need_to_compile = 1; need_to_compile = 1;
} }
void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df) void gfxAlphaBlendFunction(gfxAlphaBlendFnc_t rgb_sf, gfxAlphaBlendFnc_t rgb_df, gfxAlphaBlendFnc_t alpha_sf, gfxAlphaBlendFnc_t alpha_df)
{ {
int sfactorRGB = 0, dfactorRGB = 0, sfactorAlpha = 0, dfactorAlpha = 0; int sfactorRGB = 0, dfactorRGB = 0, sfactorAlpha = 0, dfactorAlpha = 0;
WriteTrace(TraceGlitch, TraceDebug, "rgb_sf: %d rgb_df: %d alpha_sf: %d alpha_df: %d", rgb_sf, rgb_df, alpha_sf, alpha_df); WriteTrace(TraceGlitch, TraceDebug, "rgb_sf: %d rgb_df: %d alpha_sf: %d alpha_df: %d", rgb_sf, rgb_df, alpha_sf, alpha_df);
switch (rgb_sf) switch (rgb_sf)
{ {
case GR_BLEND_ZERO: case GFX_BLEND_ZERO:
sfactorRGB = GL_ZERO; sfactorRGB = GL_ZERO;
break; break;
case GR_BLEND_SRC_ALPHA: case GFX_BLEND_SRC_ALPHA:
sfactorRGB = GL_SRC_ALPHA; sfactorRGB = GL_SRC_ALPHA;
break; break;
case GR_BLEND_ONE: case GFX_BLEND_ONE:
sfactorRGB = GL_ONE; sfactorRGB = GL_ONE;
break; break;
case GR_BLEND_ONE_MINUS_SRC_ALPHA: case GFX_BLEND_ONE_MINUS_SRC_ALPHA:
sfactorRGB = GL_ONE_MINUS_SRC_ALPHA; sfactorRGB = GL_ONE_MINUS_SRC_ALPHA;
break; break;
default: default:
@ -1426,16 +1426,16 @@ void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, G
switch (rgb_df) switch (rgb_df)
{ {
case GR_BLEND_ZERO: case GFX_BLEND_ZERO:
dfactorRGB = GL_ZERO; dfactorRGB = GL_ZERO;
break; break;
case GR_BLEND_SRC_ALPHA: case GFX_BLEND_SRC_ALPHA:
dfactorRGB = GL_SRC_ALPHA; dfactorRGB = GL_SRC_ALPHA;
break; break;
case GR_BLEND_ONE: case GFX_BLEND_ONE:
dfactorRGB = GL_ONE; dfactorRGB = GL_ONE;
break; break;
case GR_BLEND_ONE_MINUS_SRC_ALPHA: case GFX_BLEND_ONE_MINUS_SRC_ALPHA:
dfactorRGB = GL_ONE_MINUS_SRC_ALPHA; dfactorRGB = GL_ONE_MINUS_SRC_ALPHA;
break; break;
default: default:
@ -1444,10 +1444,10 @@ void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, G
switch (alpha_sf) switch (alpha_sf)
{ {
case GR_BLEND_ZERO: case GFX_BLEND_ZERO:
sfactorAlpha = GL_ZERO; sfactorAlpha = GL_ZERO;
break; break;
case GR_BLEND_ONE: case GFX_BLEND_ONE:
sfactorAlpha = GL_ONE; sfactorAlpha = GL_ONE;
break; break;
default: default:
@ -1456,10 +1456,10 @@ void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, G
switch (alpha_df) switch (alpha_df)
{ {
case GR_BLEND_ZERO: case GFX_BLEND_ZERO:
dfactorAlpha = GL_ZERO; dfactorAlpha = GL_ZERO;
break; break;
case GR_BLEND_ONE: case GFX_BLEND_ONE:
dfactorAlpha = GL_ONE; dfactorAlpha = GL_ONE;
break; break;
default: default:

View File

@ -26,7 +26,7 @@ void gfxConstantColorValue(gfxColor_t value);
void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_t other, bool invert); void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_t other, bool invert);
void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_t other, bool invert); void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_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 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 gfxAlphaBlendFunction(gfxAlphaBlendFnc_t rgb_sf, gfxAlphaBlendFnc_t rgb_df, gfxAlphaBlendFnc_t alpha_sf, gfxAlphaBlendFnc_t alpha_df);
void gfxAlphaTestReferenceValue(gfxAlpha_t value); void gfxAlphaTestReferenceValue(gfxAlpha_t value);
void gfxAlphaTestFunction(GrCmpFnc_t function); void gfxAlphaTestFunction(GrCmpFnc_t function);
void gfxFogMode(GrFogMode_t mode); void gfxFogMode(GrFogMode_t mode);

View File

@ -162,6 +162,29 @@ enum gfxCombineOther_t
GFX_COMBINE_OTHER_NONE = GFX_COMBINE_OTHER_CONSTANT, GFX_COMBINE_OTHER_NONE = GFX_COMBINE_OTHER_CONSTANT,
}; };
enum gfxAlphaBlendFnc_t
{
GFX_BLEND_ZERO = 0x0,
GFX_BLEND_SRC_ALPHA = 0x1,
GFX_BLEND_SRC_COLOR = 0x2,
GFX_BLEND_DST_COLOR = GFX_BLEND_SRC_COLOR,
GFX_BLEND_DST_ALPHA = 0x3,
GFX_BLEND_ONE = 0x4,
GFX_BLEND_ONE_MINUS_SRC_ALPHA = 0x5,
GFX_BLEND_ONE_MINUS_SRC_COLOR = 0x6,
GFX_BLEND_ONE_MINUS_DST_COLOR = GFX_BLEND_ONE_MINUS_SRC_COLOR,
GFX_BLEND_ONE_MINUS_DST_ALPHA = 0x7,
GFX_BLEND_RESERVED_8 = 0x8,
GFX_BLEND_RESERVED_9 = 0x9,
GFX_BLEND_RESERVED_A = 0xa,
GFX_BLEND_RESERVED_B = 0xb,
GFX_BLEND_RESERVED_C = 0xc,
GFX_BLEND_RESERVED_D = 0xd,
GFX_BLEND_RESERVED_E = 0xe,
GFX_BLEND_ALPHA_SATURATE = 0xf,
GFX_BLEND_PREFOG_COLOR = GFX_BLEND_ALPHA_SATURATE,
};
enum GFX_CMBX enum GFX_CMBX
{ {
GFX_CMBX_ZERO = 0x00, GFX_CMBX_ZERO = 0x00,

View File

@ -335,10 +335,10 @@ static gfxTextureFormat_t TexBufSetupCombiner(int force_rgb = FALSE)
GFX_COMBINE_OTHER_TEXTURE, GFX_COMBINE_OTHER_TEXTURE,
FXFALSE); FXFALSE);
// gfxConstantColorValue (0xFFFFFFFF); // gfxConstantColorValue (0xFFFFFFFF);
gfxAlphaBlendFunction(GR_BLEND_ONE, // use alpha compare, but not T0 alpha gfxAlphaBlendFunction(GFX_BLEND_ONE, // use alpha compare, but not T0 alpha
GR_BLEND_ZERO, GFX_BLEND_ZERO,
GR_BLEND_ONE, GFX_BLEND_ONE,
GR_BLEND_ZERO); GFX_BLEND_ZERO);
gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y); gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y);
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
gfxDepthMask(FXFALSE); gfxDepthMask(FXFALSE);

View File

@ -679,7 +679,7 @@ void TexCache()
gfxAlphaCombine(cmb.a_fnc, cmb.a_fac, cmb.a_loc, cmb.a_oth, FXFALSE); gfxAlphaCombine(cmb.a_fnc, cmb.a_fac, cmb.a_loc, cmb.a_oth, FXFALSE);
} }
gfxConstantColorValue(cmb.ccolor); gfxConstantColorValue(cmb.ccolor);
gfxAlphaBlendFunction(cmb.abf1, cmb.abf2, GR_BLEND_ZERO, GR_BLEND_ZERO); gfxAlphaBlendFunction(cmb.abf1, cmb.abf2, GFX_BLEND_ZERO, GFX_BLEND_ZERO);
if (!rdp.tex) //nothing more to do if (!rdp.tex) //nothing more to do
return; return;
} }
@ -1677,4 +1677,4 @@ void LoadTex(int id, gfxChipID_t tmu)
gfxTexSource(tmu, tex_addr, GR_MIPMAPLEVELMASK_BOTH, t_info); gfxTexSource(tmu, tex_addr, GR_MIPMAPLEVELMASK_BOTH, t_info);
} }
WriteTrace(TraceRDP, TraceDebug, " | | +- LoadTex end"); WriteTrace(TraceRDP, TraceDebug, " | | +- LoadTex end");
} }

View File

@ -1962,10 +1962,10 @@ void set_message_combiner()
GFX_COMBINE_LOCAL_NONE, GFX_COMBINE_LOCAL_NONE,
GFX_COMBINE_OTHER_TEXTURE, GFX_COMBINE_OTHER_TEXTURE,
FXFALSE); FXFALSE);
gfxAlphaBlendFunction(GR_BLEND_ONE, gfxAlphaBlendFunction(GFX_BLEND_ONE,
GR_BLEND_ZERO, GFX_BLEND_ZERO,
GR_BLEND_ZERO, GFX_BLEND_ZERO,
GR_BLEND_ZERO); GFX_BLEND_ZERO);
gfxAlphaTestFunction(GR_CMP_ALWAYS); gfxAlphaTestFunction(GR_CMP_ALWAYS);
gfxStippleMode(GR_STIPPLE_DISABLE); gfxStippleMode(GR_STIPPLE_DISABLE);
gfxTexFilterMode(GFX_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR); gfxTexFilterMode(GFX_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR);

View File

@ -2514,7 +2514,7 @@ void rdp_fillrect()
GFX_COMBINE_OTHER_NONE, GFX_COMBINE_OTHER_NONE,
FXFALSE); FXFALSE);
gfxAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO); gfxAlphaBlendFunction(GFX_BLEND_ONE, GFX_BLEND_ZERO, GFX_BLEND_ONE, GFX_BLEND_ZERO);
gfxAlphaTestFunction(GR_CMP_ALWAYS); gfxAlphaTestFunction(GR_CMP_ALWAYS);
gfxStippleMode(GR_STIPPLE_DISABLE); gfxStippleMode(GR_STIPPLE_DISABLE);
@ -3128,10 +3128,10 @@ void SetWireframeCol()
GFX_COMBINE_LOCAL_ITERATED, GFX_COMBINE_LOCAL_ITERATED,
GFX_COMBINE_OTHER_NONE, GFX_COMBINE_OTHER_NONE,
FXFALSE); FXFALSE);
gfxAlphaBlendFunction(GR_BLEND_ONE, gfxAlphaBlendFunction(GFX_BLEND_ONE,
GR_BLEND_ZERO, GFX_BLEND_ZERO,
GR_BLEND_ZERO, GFX_BLEND_ZERO,
GR_BLEND_ZERO); GFX_BLEND_ZERO);
gfxTexCombine(GFX_TMU0, gfxTexCombine(GFX_TMU0,
GFX_COMBINE_FUNCTION_ZERO, GFX_COMBINE_FUNCTION_ZERO,
GFX_COMBINE_FACTOR_NONE, GFX_COMBINE_FACTOR_NONE,
@ -3157,10 +3157,10 @@ void SetWireframeCol()
GFX_COMBINE_OTHER_NONE, GFX_COMBINE_OTHER_NONE,
FXFALSE); FXFALSE);
gfxConstantColorValue(0xFF0000FF); gfxConstantColorValue(0xFF0000FF);
gfxAlphaBlendFunction(GR_BLEND_ONE, gfxAlphaBlendFunction(GFX_BLEND_ONE,
GR_BLEND_ZERO, GFX_BLEND_ZERO,
GR_BLEND_ZERO, GFX_BLEND_ZERO,
GR_BLEND_ZERO); GFX_BLEND_ZERO);
gfxTexCombine(GFX_TMU0, gfxTexCombine(GFX_TMU0,
GFX_COMBINE_FUNCTION_ZERO, GFX_COMBINE_FUNCTION_ZERO,
GFX_COMBINE_FACTOR_NONE, GFX_COMBINE_FACTOR_NONE,

View File

@ -82,10 +82,10 @@ float set_sprite_combine_mode()
GFX_COMBINE_LOCAL_NONE, GFX_COMBINE_LOCAL_NONE,
GFX_COMBINE_OTHER_TEXTURE, GFX_COMBINE_OTHER_TEXTURE,
FXFALSE); FXFALSE);
gfxAlphaBlendFunction(GR_BLEND_ONE, gfxAlphaBlendFunction(GFX_BLEND_ONE,
GR_BLEND_ZERO, GFX_BLEND_ZERO,
GR_BLEND_ZERO, GFX_BLEND_ZERO,
GR_BLEND_ZERO); GFX_BLEND_ZERO);
if (rdp.othermode_l & 1) if (rdp.othermode_l & 1)
{ {
gfxAlphaTestFunction(GR_CMP_GEQUAL); gfxAlphaTestFunction(GR_CMP_GEQUAL);
@ -168,10 +168,10 @@ void DrawHiresDepthImage(const DRAWIMAGE & d)
GFX_COMBINE_LOCAL_NONE, GFX_COMBINE_LOCAL_NONE,
GFX_COMBINE_OTHER_TEXTURE, GFX_COMBINE_OTHER_TEXTURE,
FXFALSE); FXFALSE);
gfxAlphaBlendFunction(GR_BLEND_ONE, gfxAlphaBlendFunction(GFX_BLEND_ONE,
GR_BLEND_ZERO, GFX_BLEND_ZERO,
GR_BLEND_ONE, GFX_BLEND_ONE,
GR_BLEND_ZERO); GFX_BLEND_ZERO);
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
gfxDepthMask(FXFALSE); gfxDepthMask(FXFALSE);