[Glide64] Make stipple_pattern private
This commit is contained in:
parent
09504e2244
commit
c2bb2c5dac
|
@ -277,8 +277,6 @@ extern "C" {
|
||||||
|
|
||||||
typedef int(*GETTEXADDR)(int tmu, int texsize);
|
typedef int(*GETTEXADDR)(int tmu, int texsize);
|
||||||
|
|
||||||
extern GRSTIPPLE grStippleModeExt;
|
|
||||||
extern GRSTIPPLE grStipplePatternExt;
|
|
||||||
extern GETTEXADDR GetTexAddr;
|
extern GETTEXADDR GetTexAddr;
|
||||||
|
|
||||||
#ifndef GR_STIPPLE_DISABLE
|
#ifndef GR_STIPPLE_DISABLE
|
||||||
|
|
|
@ -216,9 +216,6 @@ void UseUnregisteredSetting(int /*SettingID*/)
|
||||||
}
|
}
|
||||||
extern int g_width, g_height;
|
extern int g_width, g_height;
|
||||||
|
|
||||||
GRSTIPPLE grStippleModeExt = NULL;
|
|
||||||
GRSTIPPLE grStipplePatternExt = NULL;
|
|
||||||
|
|
||||||
int GetTexAddrUMA(int /*tmu*/, int texsize)
|
int GetTexAddrUMA(int /*tmu*/, int texsize)
|
||||||
{
|
{
|
||||||
int addr = voodoo.tex_min_addr[0] + voodoo.tmem_ptr[0];
|
int addr = voodoo.tex_min_addr[0] + voodoo.tmem_ptr[0];
|
||||||
|
@ -456,6 +453,9 @@ void ExitFullScreen(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void setPattern();
|
||||||
|
|
||||||
int InitGfx()
|
int InitGfx()
|
||||||
{
|
{
|
||||||
if (GfxInitDone)
|
if (GfxInitDone)
|
||||||
|
@ -572,11 +572,8 @@ int InitGfx()
|
||||||
if (strstr(extensions, "GETGAMMA"))
|
if (strstr(extensions, "GETGAMMA"))
|
||||||
grGet(GR_GAMMA_TABLE_ENTRIES, sizeof(voodoo.gamma_table_size), &voodoo.gamma_table_size);
|
grGet(GR_GAMMA_TABLE_ENTRIES, sizeof(voodoo.gamma_table_size), &voodoo.gamma_table_size);
|
||||||
|
|
||||||
grStippleModeExt = (GRSTIPPLE)grStippleMode;
|
srand(g_settings->stipple_pattern());
|
||||||
grStipplePatternExt = (GRSTIPPLE)grStipplePattern;
|
setPattern();
|
||||||
|
|
||||||
if (grStipplePatternExt)
|
|
||||||
grStipplePatternExt(g_settings->stipple_pattern);
|
|
||||||
|
|
||||||
InitCombine();
|
InitCombine();
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ CSettings::CSettings() :
|
||||||
m_decrease_fillrect_edge(false), // sub 1 from lower right corner coordinates of fillrect
|
m_decrease_fillrect_edge(false), // sub 1 from lower right corner coordinates of fillrect
|
||||||
m_texture_correction(false), // enable perspective texture correction emulation. is on by default
|
m_texture_correction(false), // enable perspective texture correction emulation. is on by default
|
||||||
m_stipple_mode(STIPPLE_Disable), //used for dithered alpha emulation
|
m_stipple_mode(STIPPLE_Disable), //used for dithered alpha emulation
|
||||||
stipple_pattern(0), //used for dithered alpha emulation
|
m_stipple_pattern(0), //used for dithered alpha emulation
|
||||||
force_microcheck(0), //check microcode each frame, for mixed F3DEX-S2DEX games
|
force_microcheck(0), //check microcode each frame, for mixed F3DEX-S2DEX games
|
||||||
force_quad3d(0), //force 0xb5 command to be quad, not line 3d
|
force_quad3d(0), //force 0xb5 command to be quad, not line 3d
|
||||||
clip_zmin(0), //enable near z clipping
|
clip_zmin(0), //enable near z clipping
|
||||||
|
@ -722,7 +722,7 @@ void CSettings::ReadGameSettings(const char * name)
|
||||||
g_settings->pal230 = GetSetting(Set_pal230) == 1 ? 1 : 0;
|
g_settings->pal230 = GetSetting(Set_pal230) == 1 ? 1 : 0;
|
||||||
m_stipple_mode = (StippleMode_t)GetSetting(Set_stipple_mode);
|
m_stipple_mode = (StippleMode_t)GetSetting(Set_stipple_mode);
|
||||||
int stipple_pattern = GetSetting(Set_stipple_pattern);
|
int stipple_pattern = GetSetting(Set_stipple_pattern);
|
||||||
g_settings->stipple_pattern = stipple_pattern > 0 ? (uint32_t)stipple_pattern : 0x3E0F83E0;
|
m_stipple_pattern = stipple_pattern > 0 ? (uint32_t)stipple_pattern : 0x3E0F83E0;
|
||||||
g_settings->force_microcheck = GetSetting(Set_force_microcheck);
|
g_settings->force_microcheck = GetSetting(Set_force_microcheck);
|
||||||
g_settings->force_quad3d = GetSetting(Set_force_quad3d);
|
g_settings->force_quad3d = GetSetting(Set_force_quad3d);
|
||||||
g_settings->clip_zmin = GetSetting(Set_clip_zmin);
|
g_settings->clip_zmin = GetSetting(Set_clip_zmin);
|
||||||
|
|
|
@ -242,7 +242,7 @@ public:
|
||||||
inline bool decrease_fillrect_edge(void) const { return m_decrease_fillrect_edge; }; // sub 1 from lower right corner coordinates of fillrect
|
inline bool decrease_fillrect_edge(void) const { return m_decrease_fillrect_edge; }; // sub 1 from lower right corner coordinates of fillrect
|
||||||
inline bool texture_correction(void) const { return m_texture_correction; } // enable perspective texture correction emulation. is on by default
|
inline bool texture_correction(void) const { return m_texture_correction; } // enable perspective texture correction emulation. is on by default
|
||||||
inline StippleMode_t stipple_mode(void) const { return m_stipple_mode; } //used for dithered alpha emulation
|
inline StippleMode_t stipple_mode(void) const { return m_stipple_mode; } //used for dithered alpha emulation
|
||||||
uint32_t stipple_pattern; //used for dithered alpha emulation
|
inline uint32_t stipple_pattern(void) const { return m_stipple_pattern; } //used for dithered alpha emulation
|
||||||
int force_microcheck; //check microcode each frame, for mixed F3DEX-S2DEX games
|
int force_microcheck; //check microcode each frame, for mixed F3DEX-S2DEX games
|
||||||
int force_quad3d; //force 0xb5 command to be quad, not line 3d
|
int force_quad3d; //force 0xb5 command to be quad, not line 3d
|
||||||
int clip_zmin; //enable near z clipping
|
int clip_zmin; //enable near z clipping
|
||||||
|
@ -361,6 +361,7 @@ private:
|
||||||
bool m_decrease_fillrect_edge;
|
bool m_decrease_fillrect_edge;
|
||||||
bool m_texture_correction;
|
bool m_texture_correction;
|
||||||
StippleMode_t m_stipple_mode;
|
StippleMode_t m_stipple_mode;
|
||||||
|
uint32_t m_stipple_pattern;
|
||||||
hacks_t m_hacks;
|
hacks_t m_hacks;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1876,23 +1876,17 @@ void update()
|
||||||
}
|
}
|
||||||
if (rdp.acmp == 3 && rdp.cycle_mode < 2)
|
if (rdp.acmp == 3 && rdp.cycle_mode < 2)
|
||||||
{
|
{
|
||||||
if (grStippleModeExt != 0)
|
if (g_settings->old_style_adither || rdp.alpha_dither_mode != 3) {
|
||||||
{
|
WriteTrace(TraceRDP, TraceDebug, " |- alpha compare: dither");
|
||||||
if (g_settings->old_style_adither || rdp.alpha_dither_mode != 3) {
|
grStippleMode(g_settings->stipple_mode());
|
||||||
WriteTrace(TraceRDP, TraceDebug, " |- alpha compare: dither");
|
|
||||||
grStippleModeExt(g_settings->stipple_mode());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
grStippleModeExt(GR_STIPPLE_DISABLE);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
grStippleMode(GR_STIPPLE_DISABLE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (grStippleModeExt)
|
//WriteTrace(TraceRDP, TraceDebug, " |- alpha compare: dither disabled");
|
||||||
{
|
grStippleMode(GR_STIPPLE_DISABLE);
|
||||||
//WriteTrace(TraceRDP, TraceDebug, " |- alpha compare: dither disabled");
|
|
||||||
grStippleModeExt(GR_STIPPLE_DISABLE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Cull mode (leave this in for z-clipped triangles)
|
// Cull mode (leave this in for z-clipped triangles)
|
||||||
|
@ -2010,10 +2004,7 @@ void set_message_combiner()
|
||||||
GR_BLEND_ZERO,
|
GR_BLEND_ZERO,
|
||||||
GR_BLEND_ZERO);
|
GR_BLEND_ZERO);
|
||||||
grAlphaTestFunction(GR_CMP_ALWAYS);
|
grAlphaTestFunction(GR_CMP_ALWAYS);
|
||||||
if (grStippleModeExt)
|
grStippleMode(GR_STIPPLE_DISABLE);
|
||||||
{
|
|
||||||
grStippleModeExt(GR_STIPPLE_DISABLE);
|
|
||||||
}
|
|
||||||
grTexFilterMode(0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR);
|
grTexFilterMode(0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR);
|
||||||
grTexCombine(GR_TMU1,
|
grTexCombine(GR_TMU1,
|
||||||
GR_COMBINE_FUNCTION_NONE,
|
GR_COMBINE_FUNCTION_NONE,
|
||||||
|
|
|
@ -2353,10 +2353,7 @@ static void rdp_fillrect()
|
||||||
grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO);
|
grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO);
|
||||||
|
|
||||||
grAlphaTestFunction(GR_CMP_ALWAYS);
|
grAlphaTestFunction(GR_CMP_ALWAYS);
|
||||||
if (grStippleModeExt)
|
grStippleMode(GR_STIPPLE_DISABLE);
|
||||||
{
|
|
||||||
grStippleModeExt(GR_STIPPLE_DISABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
grCullMode(GR_CULL_DISABLE);
|
grCullMode(GR_CULL_DISABLE);
|
||||||
grFogMode(GR_FOG_DISABLE);
|
grFogMode(GR_FOG_DISABLE);
|
||||||
|
|
|
@ -1689,7 +1689,7 @@ grChromakeyValue(GrColor_t value)
|
||||||
g_chroma_color[2], g_chroma_color[3]);
|
g_chroma_color[2], g_chroma_color[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setPattern()
|
void setPattern()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
GLubyte stip[32 * 4];
|
GLubyte stip[32 * 4];
|
||||||
|
@ -1724,15 +1724,6 @@ static void setPattern()
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
|
||||||
grStipplePattern(
|
|
||||||
GrStipplePattern_t stipple)
|
|
||||||
{
|
|
||||||
WriteTrace(TraceResolution, TraceDebug, "value: %x", stipple);
|
|
||||||
srand(stipple);
|
|
||||||
setPattern();
|
|
||||||
}
|
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grStippleMode(GrStippleMode_t mode)
|
grStippleMode(GrStippleMode_t mode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1651,7 +1651,7 @@ grChromakeyValue(GrColor_t value)
|
||||||
grDisplayGLError("grChromakeyValue");
|
grDisplayGLError("grChromakeyValue");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setPattern()
|
void setPattern()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
GLubyte stip[32 * 4];
|
GLubyte stip[32 * 4];
|
||||||
|
@ -1690,15 +1690,6 @@ static void setPattern()
|
||||||
grDisplayGLError("setPattern");
|
grDisplayGLError("setPattern");
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
|
||||||
grStipplePattern(
|
|
||||||
GrStipplePattern_t stipple)
|
|
||||||
{
|
|
||||||
WriteTrace(TraceResolution, TraceDebug, "value: %x", stipple);
|
|
||||||
srand(stipple);
|
|
||||||
setPattern();
|
|
||||||
}
|
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grStippleMode(GrStippleMode_t mode)
|
grStippleMode(GrStippleMode_t mode)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue