[Glide64] Change display_warning to WriteTrace

This commit is contained in:
zilmar 2016-02-14 19:59:33 +11:00
parent 89162c784e
commit 9b39879a32
12 changed files with 4399 additions and 4409 deletions

View File

@ -1407,7 +1407,6 @@ output: none
*******************************************************************/ *******************************************************************/
void CALL GetDllInfo(PLUGIN_INFO * PluginInfo) void CALL GetDllInfo(PLUGIN_INFO * PluginInfo)
{ {
WriteTrace(TraceGlide64, TraceDebug, "-");
PluginInfo->Version = 0x0104; // Set to 0x0104 PluginInfo->Version = 0x0104; // Set to 0x0104
PluginInfo->Type = PLUGIN_TYPE_GFX; // Set to PLUGIN_TYPE_GFX PluginInfo->Type = PLUGIN_TYPE_GFX; // Set to PLUGIN_TYPE_GFX
#ifdef _DEBUG #ifdef _DEBUG

View File

@ -42,6 +42,18 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="OGLcombiner.cpp" /> <ClCompile Include="OGLcombiner.cpp" />
<ClCompile Include="OGLEScombiner.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="OGLESgeometry.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="OGLESglitchmain.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="OGLEStextures.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="OGLgeometry.cpp" /> <ClCompile Include="OGLgeometry.cpp" />
<ClCompile Include="OGLglitchmain.cpp" /> <ClCompile Include="OGLglitchmain.cpp" />
<ClCompile Include="OGLtextures.cpp" /> <ClCompile Include="OGLtextures.cpp" />

View File

@ -23,6 +23,18 @@
<ClCompile Include="OGLtextures.cpp"> <ClCompile Include="OGLtextures.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="OGLEScombiner.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="OGLESgeometry.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="OGLESglitchmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="OGLEStextures.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="glitchmain.h"> <ClInclude Include="glitchmain.h">

View File

@ -373,7 +373,7 @@ void compile_chroma_shader()
strcat(fragment_shader_chroma, "float alpha = constant_color.a; \n"); strcat(fragment_shader_chroma, "float alpha = constant_color.a; \n");
break; break;
default: default:
display_warning("unknown compile_choma_shader_alpha : %x", chroma_other_alpha); WriteTrace(TraceGlitch, TraceWarning, "unknown compile_choma_shader_alpha : %x", chroma_other_alpha);
} }
switch (chroma_other_color) switch (chroma_other_color)
@ -388,7 +388,7 @@ void compile_chroma_shader()
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(constant_color),alpha); \n"); strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(constant_color),alpha); \n");
break; break;
default: default:
display_warning("unknown compile_choma_shader_alpha : %x", chroma_other_color); WriteTrace(TraceGlitch, TraceWarning, "unknown compile_choma_shader_alpha : %x", chroma_other_color);
} }
strcat(fragment_shader_chroma, "if (color.rgb == chroma_color.rgb) discard; \n"); strcat(fragment_shader_chroma, "if (color.rgb == chroma_color.rgb) discard; \n");
@ -582,7 +582,6 @@ void compile_shader()
check_link(program_object); check_link(program_object);
glUseProgram(program_object); glUseProgram(program_object);
shader_programs[number_of_programs].texture0_location = glGetUniformLocation(program_object, "texture0"); shader_programs[number_of_programs].texture0_location = glGetUniformLocation(program_object, "texture0");
shader_programs[number_of_programs].texture1_location = glGetUniformLocation(program_object, "texture1"); shader_programs[number_of_programs].texture1_location = glGetUniformLocation(program_object, "texture1");
shader_programs[number_of_programs].vertexOffset_location = glGetUniformLocation(program_object, "vertexOffset"); shader_programs[number_of_programs].vertexOffset_location = glGetUniformLocation(program_object, "vertexOffset");
@ -656,7 +655,7 @@ grConstantColorValue( GrColor_t value )
texture_env_color[3] = (value & 0xFF) / 255.0f; texture_env_color[3] = (value & 0xFF) / 255.0f;
break; break;
default: default:
display_warning("grConstantColorValue: unknown color format : %x", lfb_color_fmt); WriteTrace(TraceGlitch, TraceWarning, "grConstantColorValue: unknown color format : %x", lfb_color_fmt);
} }
vbo_draw(); vbo_draw();
@ -680,7 +679,7 @@ void writeGLSLColorOther(int other)
strcat(fragment_shader_color_combiner, "vec4 color_other = constant_color; \n"); strcat(fragment_shader_color_combiner, "vec4 color_other = constant_color; \n");
break; break;
default: default:
display_warning("unknown writeGLSLColorOther : %x", other); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLColorOther : %x", other);
} }
} }
@ -695,7 +694,7 @@ void writeGLSLColorLocal(int local)
strcat(fragment_shader_color_combiner, "vec4 color_local = constant_color; \n"); strcat(fragment_shader_color_combiner, "vec4 color_local = constant_color; \n");
break; break;
default: default:
display_warning("unknown writeGLSLColorLocal : %x", local); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLColorLocal : %x", local);
} }
} }
@ -743,7 +742,7 @@ void writeGLSLColorFactor(int factor, int local, int need_local, int other, int
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - vec4(ctexture1.a); \n"); strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - vec4(ctexture1.a); \n");
break; break;
default: default:
display_warning("unknown writeGLSLColorFactor : %x", factor); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLColorFactor : %x", factor);
} }
} }
@ -769,7 +768,7 @@ grColorCombine(
last_local = local; last_local = local;
last_other = other; last_other = other;
if (invert) display_warning("grColorCombine : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "grColorCombine : inverted result");
color_combiner_key = function | (factor << 4) | (local << 8) | (other << 10); color_combiner_key = function | (factor << 4) | (local << 8) | (other << 10);
chroma_other_color = other; chroma_other_color = other;
@ -835,7 +834,7 @@ grColorCombine(
break; break;
default: default:
strcpy(fragment_shader_color_combiner, fragment_shader_default); strcpy(fragment_shader_color_combiner, fragment_shader_default);
display_warning("grColorCombine : unknown function : %x", function); WriteTrace(TraceGlitch, TraceWarning, "grColorCombine : unknown function : %x", function);
} }
//compile_shader(); //compile_shader();
need_to_compile = 1; need_to_compile = 1;
@ -856,7 +855,7 @@ int setOtherAlphaSource(int other)
return GL_CONSTANT_ARB; return GL_CONSTANT_ARB;
break; break;
default: default:
display_warning("unknwown other alpha source : %x", other); WriteTrace(TraceGlitch, TraceWarning, "unknwown other alpha source : %x", other);
} }
return 0; return 0;
} }
@ -872,7 +871,7 @@ int setLocalAlphaSource(int local)
return GL_CONSTANT_ARB; return GL_CONSTANT_ARB;
break; break;
default: default:
display_warning("unknwown local alpha source : %x", local); WriteTrace(TraceGlitch, TraceWarning, "unknwown local alpha source : %x", local);
} }
return 0; return 0;
} }
@ -892,7 +891,7 @@ void writeGLSLAlphaOther(int other)
strcat(fragment_shader_alpha_combiner, "float alpha_other = constant_color.a; \n"); strcat(fragment_shader_alpha_combiner, "float alpha_other = constant_color.a; \n");
break; break;
default: default:
display_warning("unknown writeGLSLAlphaOther : %x", other); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLAlphaOther : %x", other);
} }
} }
@ -907,7 +906,7 @@ void writeGLSLAlphaLocal(int local)
strcat(fragment_shader_alpha_combiner, "float alpha_local = constant_color.a; \n"); strcat(fragment_shader_alpha_combiner, "float alpha_local = constant_color.a; \n");
break; break;
default: default:
display_warning("unknown writeGLSLAlphaLocal : %x", local); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLAlphaLocal : %x", local);
} }
} }
@ -952,7 +951,7 @@ void writeGLSLAlphaFactor(int factor, int local, int need_local, int other, int
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - ctexture1.a; \n"); strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - ctexture1.a; \n");
break; break;
default: default:
display_warning("unknown writeGLSLAlphaFactor : %x", factor); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLAlphaFactor : %x", factor);
} }
} }
@ -979,7 +978,7 @@ grAlphaCombine(
last_local = local; last_local = local;
last_other = other; last_other = other;
if (invert) display_warning("grAlphaCombine : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombine : inverted result");
alpha_combiner_key = function | (factor << 4) | (local << 8) | (other << 10); alpha_combiner_key = function | (factor << 4) | (local << 8) | (other << 10);
chroma_other_alpha = other; chroma_other_alpha = other;
@ -1045,7 +1044,7 @@ grAlphaCombine(
strcat(fragment_shader_alpha_combiner, "gl_FragColor.a = alpha_factor * (-alpha_local) + alpha_local; \n"); strcat(fragment_shader_alpha_combiner, "gl_FragColor.a = alpha_factor * (-alpha_local) + alpha_local; \n");
break; break;
default: default:
display_warning("grAlphaCombine : unknown function : %x", function); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombine : unknown function : %x", function);
} }
//compile_shader(); //compile_shader();
@ -1117,7 +1116,7 @@ void writeGLSLTextureColorFactor(int num_tex, int factor)
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0) - vec4(lambda); \n"); strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0) - vec4(lambda); \n");
break; break;
default: default:
display_warning("unknown writeGLSLTextureColorFactor : %x", factor); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLTextureColorFactor : %x", factor);
} }
} }
@ -1186,7 +1185,7 @@ void writeGLSLTextureAlphaFactor(int num_tex, int factor)
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0 - lambda; \n"); strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0 - lambda; \n");
break; break;
default: default:
display_warning("unknown writeGLSLTextureAlphaFactor : %x", factor); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLTextureAlphaFactor : %x", factor);
} }
} }
@ -1340,7 +1339,7 @@ grTexCombine(
strcat(fragment_shader_texture0, "vec4 ctexture0 = readtex0; \n"); strcat(fragment_shader_texture0, "vec4 ctexture0 = readtex0; \n");
else else
strcat(fragment_shader_texture1, "vec4 ctexture1 = readtex1; \n"); strcat(fragment_shader_texture1, "vec4 ctexture1 = readtex1; \n");
display_warning("grTextCombine : unknown rgb function : %x", rgb_function); WriteTrace(TraceGlitch, TraceWarning, "grTextCombine : unknown rgb function : %x", rgb_function);
} }
if (rgb_invert) if (rgb_invert)
@ -1432,7 +1431,7 @@ grTexCombine(
strcat(fragment_shader_texture0, "ctexture0.a = readtex0.a; \n"); strcat(fragment_shader_texture0, "ctexture0.a = readtex0.a; \n");
else else
strcat(fragment_shader_texture1, "ctexture1.a = ctexture0.a; \n"); strcat(fragment_shader_texture1, "ctexture1.a = ctexture0.a; \n");
display_warning("grTextCombine : unknown alpha function : %x", alpha_function); WriteTrace(TraceGlitch, TraceWarning, "grTextCombine : unknown alpha function : %x", alpha_function);
} }
if (alpha_invert) if (alpha_invert)
@ -1469,7 +1468,7 @@ grAlphaBlendFunction(
sfactorRGB = GL_ONE_MINUS_SRC_ALPHA; sfactorRGB = GL_ONE_MINUS_SRC_ALPHA;
break; break;
default: default:
display_warning("grAlphaBlendFunction : rgb_sf = %x", rgb_sf); WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : rgb_sf = %x", rgb_sf);
} }
switch (rgb_df) switch (rgb_df)
@ -1487,7 +1486,7 @@ grAlphaBlendFunction(
dfactorRGB = GL_ONE_MINUS_SRC_ALPHA; dfactorRGB = GL_ONE_MINUS_SRC_ALPHA;
break; break;
default: default:
display_warning("grAlphaBlendFunction : rgb_df = %x", rgb_df); WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : rgb_df = %x", rgb_df);
} }
switch (alpha_sf) switch (alpha_sf)
@ -1499,7 +1498,7 @@ grAlphaBlendFunction(
sfactorAlpha = GL_ONE; sfactorAlpha = GL_ONE;
break; break;
default: default:
display_warning("grAlphaBlendFunction : alpha_sf = %x", alpha_sf); WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : alpha_sf = %x", alpha_sf);
} }
switch (alpha_df) switch (alpha_df)
@ -1511,7 +1510,7 @@ grAlphaBlendFunction(
dfactorAlpha = GL_ONE; dfactorAlpha = GL_ONE;
break; break;
default: default:
display_warning("grAlphaBlendFunction : alpha_df = %x", alpha_df); WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : alpha_df = %x", alpha_df);
} }
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
@ -1551,7 +1550,7 @@ grAlphaTestFunction( GrCmpFnc_t function )
return; return;
break; break;
default: default:
display_warning("grAlphaTestFunction : unknown function : %x", function); WriteTrace(TraceGlitch, TraceWarning, "grAlphaTestFunction : unknown function : %x", function);
} }
//glEnable(GL_ALPHA_TEST); //glEnable(GL_ALPHA_TEST);
alpha_test = true; alpha_test = true;
@ -1580,7 +1579,7 @@ grFogMode( GrFogMode_t mode )
fog_enabled = 2; fog_enabled = 2;
break; break;
default: default:
display_warning("grFogMode : unknown mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "grFogMode : unknown mode : %x", mode);
} }
need_to_compile = 1; need_to_compile = 1;
} }
@ -1633,7 +1632,7 @@ grFogColorValue( GrColor_t fogcolor )
fogColor[3] = (fogcolor & 0xFF) / 255.0f; fogColor[3] = (fogcolor & 0xFF) / 255.0f;
break; break;
default: default:
display_warning("grFogColorValue: unknown color format : %x", lfb_color_fmt); WriteTrace(TraceGlitch, TraceWarning, "grFogColorValue: unknown color format : %x", lfb_color_fmt);
} }
//glFogfv(GL_FOG_COLOR, color); //glFogfv(GL_FOG_COLOR, color);
@ -1654,7 +1653,7 @@ grChromakeyMode( GrChromakeyMode_t mode )
chroma_enabled = 1; chroma_enabled = 1;
break; break;
default: default:
display_warning("grChromakeyMode : unknown mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "grChromakeyMode : unknown mode : %x", mode);
} }
need_to_compile = 1; need_to_compile = 1;
} }
@ -1680,7 +1679,7 @@ grChromakeyValue( GrColor_t value )
chroma_color[3] = 1.0;//(value & 0xFF) / 255.0f; chroma_color[3] = 1.0;//(value & 0xFF) / 255.0f;
break; break;
default: default:
display_warning("grChromakeyValue: unknown color format : %x", lfb_color_fmt); WriteTrace(TraceGlitch, TraceWarning, "grChromakeyValue: unknown color format : %x", lfb_color_fmt);
} }
vbo_draw(); vbo_draw();
chroma_color_location = glGetUniformLocation(program_object, "chroma_color"); chroma_color_location = glGetUniformLocation(program_object, "chroma_color");
@ -1758,7 +1757,7 @@ grStippleMode( GrStippleMode_t mode )
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
break; break;
default: default:
display_warning("grStippleMode:%x", mode); WriteTrace(TraceGlitch, TraceWarning, "grStippleMode:%x", mode);
} }
need_to_compile = 1; need_to_compile = 1;
} }
@ -1771,8 +1770,8 @@ grColorCombineExt(GrCCUColor_t a, GrCombineMode_t a_mode,
FxU32 shift, FxBool invert) FxU32 shift, FxBool invert)
{ {
LOG("grColorCombineExt(%d, %d, %d, %d, %d, %d, %d, %d, %d, %d)\r\n", a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); LOG("grColorCombineExt(%d, %d, %d, %d, %d, %d, %d, %d, %d, %d)\r\n", a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
if (invert) display_warning("grColorCombineExt : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : inverted result");
if (shift) display_warning("grColorCombineExt : shift = %d", shift); if (shift) WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : shift = %d", shift);
color_combiner_key = 0x80000000 | (a & 0x1F) | ((a_mode & 3) << 5) | color_combiner_key = 0x80000000 | (a & 0x1F) | ((a_mode & 3) << 5) |
((b & 0x1F) << 7) | ((b_mode & 3) << 12) | ((b & 0x1F) << 7) | ((b_mode & 3) << 12) |
@ -1805,7 +1804,7 @@ grColorCombineExt(GrCCUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_color_combiner, "vec4 cs_a = ctexture1; \n"); strcat(fragment_shader_color_combiner, "vec4 cs_a = ctexture1; \n");
break; break;
default: default:
display_warning("grColorCombineExt : a = %x", a); WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : a = %x", a);
strcat(fragment_shader_color_combiner, "vec4 cs_a = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 cs_a = vec4(0.0); \n");
} }
@ -1824,7 +1823,7 @@ grColorCombineExt(GrCCUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_color_combiner, "vec4 c_a = -cs_a; \n"); strcat(fragment_shader_color_combiner, "vec4 c_a = -cs_a; \n");
break; break;
default: default:
display_warning("grColorCombineExt : a_mode = %x", a_mode); WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : a_mode = %x", a_mode);
strcat(fragment_shader_color_combiner, "vec4 c_a = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 c_a = vec4(0.0); \n");
} }
@ -1852,7 +1851,7 @@ grColorCombineExt(GrCCUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_color_combiner, "vec4 cs_b = ctexture1; \n"); strcat(fragment_shader_color_combiner, "vec4 cs_b = ctexture1; \n");
break; break;
default: default:
display_warning("grColorCombineExt : b = %x", b); WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : b = %x", b);
strcat(fragment_shader_color_combiner, "vec4 cs_b = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 cs_b = vec4(0.0); \n");
} }
@ -1871,7 +1870,7 @@ grColorCombineExt(GrCCUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_color_combiner, "vec4 c_b = -cs_b; \n"); strcat(fragment_shader_color_combiner, "vec4 c_b = -cs_b; \n");
break; break;
default: default:
display_warning("grColorCombineExt : b_mode = %x", b_mode); WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : b_mode = %x", b_mode);
strcat(fragment_shader_color_combiner, "vec4 c_b = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 c_b = vec4(0.0); \n");
} }
@ -1908,7 +1907,7 @@ grColorCombineExt(GrCCUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_color_combiner, "vec4 c_c = ctexture1; \n"); strcat(fragment_shader_color_combiner, "vec4 c_c = ctexture1; \n");
break; break;
default: default:
display_warning("grColorCombineExt : c = %x", c); WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : c = %x", c);
strcat(fragment_shader_color_combiner, "vec4 c_c = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 c_c = vec4(0.0); \n");
} }
@ -1933,7 +1932,7 @@ grColorCombineExt(GrCCUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_color_combiner, "vec4 c_d = gl_Color; \n"); strcat(fragment_shader_color_combiner, "vec4 c_d = gl_Color; \n");
break; break;
default: default:
display_warning("grColorCombineExt : d = %x", d); WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : d = %x", d);
strcat(fragment_shader_color_combiner, "vec4 c_d = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 c_d = vec4(0.0); \n");
} }
@ -1953,8 +1952,8 @@ grAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode,
FxU32 shift, FxBool invert) FxU32 shift, FxBool invert)
{ {
LOG("grAlphaCombineExt(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)\r\n", a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); LOG("grAlphaCombineExt(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)\r\n", a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
if (invert) display_warning("grAlphaCombineExt : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : inverted result");
if (shift) display_warning("grAlphaCombineExt : shift = %d", shift); if (shift) WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : shift = %d", shift);
alpha_combiner_key = 0x80000000 | (a & 0x1F) | ((a_mode & 3) << 5) | alpha_combiner_key = 0x80000000 | (a & 0x1F) | ((a_mode & 3) << 5) |
((b & 0x1F) << 7) | ((b_mode & 3) << 12) | ((b & 0x1F) << 7) | ((b_mode & 3) << 12) |
@ -1978,7 +1977,7 @@ grAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_alpha_combiner, "float as_a = gl_Color.a; \n"); strcat(fragment_shader_alpha_combiner, "float as_a = gl_Color.a; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : a = %x", a); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : a = %x", a);
strcat(fragment_shader_alpha_combiner, "float as_a = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float as_a = 0.0; \n");
} }
@ -1997,7 +1996,7 @@ grAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_alpha_combiner, "float a_a = -as_a; \n"); strcat(fragment_shader_alpha_combiner, "float a_a = -as_a; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : a_mode = %x", a_mode); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : a_mode = %x", a_mode);
strcat(fragment_shader_alpha_combiner, "float a_a = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float a_a = 0.0; \n");
} }
@ -2016,7 +2015,7 @@ grAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_alpha_combiner, "float as_b = gl_Color.a; \n"); strcat(fragment_shader_alpha_combiner, "float as_b = gl_Color.a; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : b = %x", b); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : b = %x", b);
strcat(fragment_shader_alpha_combiner, "float as_b = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float as_b = 0.0; \n");
} }
@ -2035,7 +2034,7 @@ grAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_alpha_combiner, "float a_b = -as_b; \n"); strcat(fragment_shader_alpha_combiner, "float a_b = -as_b; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : b_mode = %x", b_mode); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : b_mode = %x", b_mode);
strcat(fragment_shader_alpha_combiner, "float a_b = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float a_b = 0.0; \n");
} }
@ -2063,7 +2062,7 @@ grAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_alpha_combiner, "float a_c = gl_Color.a; \n"); strcat(fragment_shader_alpha_combiner, "float a_c = gl_Color.a; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : c = %x", c); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : c = %x", c);
strcat(fragment_shader_alpha_combiner, "float a_c = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float a_c = 0.0; \n");
} }
@ -2085,7 +2084,7 @@ grAlphaCombineExt(GrACUColor_t a, GrCombineMode_t a_mode,
strcat(fragment_shader_alpha_combiner, "float a_d = as_b; \n"); strcat(fragment_shader_alpha_combiner, "float a_d = as_b; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : d = %x", d); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : d = %x", d);
strcat(fragment_shader_alpha_combiner, "float a_d = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float a_d = 0.0; \n");
} }
@ -2108,8 +2107,8 @@ grTexColorCombineExt(GrChipID_t tmu,
int num_tex; int num_tex;
LOG("grTexColorCombineExt(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)\r\n", tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); LOG("grTexColorCombineExt(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)\r\n", tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
if (invert) display_warning("grTexColorCombineExt : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : inverted result");
if (shift) display_warning("grTexColorCombineExt : shift = %d", shift); if (shift) WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : shift = %d", shift);
if (tmu == GR_TMU0) num_tex = 1; if (tmu == GR_TMU0) num_tex = 1;
else num_tex = 0; else num_tex = 0;
@ -2190,7 +2189,7 @@ grTexColorCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "vec4 ctex1s_a = vec4(ccolor1.a); \n"); strcat(fragment_shader_texture1, "vec4 ctex1s_a = vec4(ccolor1.a); \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : a = %x", a); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : a = %x", a);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0s_a = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0s_a = vec4(0.0); \n");
else else
@ -2224,7 +2223,7 @@ grTexColorCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "vec4 ctex1_a = -ctex1s_a; \n"); strcat(fragment_shader_texture1, "vec4 ctex1_a = -ctex1s_a; \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : a_mode = %x", a_mode); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : a_mode = %x", a_mode);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_a = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0_a = vec4(0.0); \n");
else else
@ -2288,7 +2287,7 @@ grTexColorCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "vec4 ctex1s_b = ccolor1; \n"); strcat(fragment_shader_texture1, "vec4 ctex1s_b = ccolor1; \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : b = %x", b); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : b = %x", b);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0s_b = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0s_b = vec4(0.0); \n");
else else
@ -2322,7 +2321,7 @@ grTexColorCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "vec4 ctex1_b = -ctex1s_b; \n"); strcat(fragment_shader_texture1, "vec4 ctex1_b = -ctex1s_b; \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : b_mode = %x", b_mode); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : b_mode = %x", b_mode);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_b = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0_b = vec4(0.0); \n");
else else
@ -2398,7 +2397,7 @@ grTexColorCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "vec4 ctex1_c = ccolor1; \n"); strcat(fragment_shader_texture1, "vec4 ctex1_c = ccolor1; \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : c = %x", c); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : c = %x", c);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_c = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0_c = vec4(0.0); \n");
else else
@ -2440,7 +2439,7 @@ grTexColorCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "vec4 ctex1_d = vec4(readtex1.a); \n"); strcat(fragment_shader_texture1, "vec4 ctex1_d = vec4(readtex1.a); \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : d = %x", d); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : d = %x", d);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_d = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0_d = vec4(0.0); \n");
else else
@ -2473,8 +2472,8 @@ grTexAlphaCombineExt(GrChipID_t tmu,
int num_tex; int num_tex;
LOG("grTexAlphaCombineExt(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)\r\n", tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); LOG("grTexAlphaCombineExt(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)\r\n", tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
if (invert) display_warning("grTexAlphaCombineExt : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : inverted result");
if (shift) display_warning("grTexAlphaCombineExt : shift = %d", shift); if (shift) WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : shift = %d", shift);
if (tmu == GR_TMU0) num_tex = 1; if (tmu == GR_TMU0) num_tex = 1;
else num_tex = 0; else num_tex = 0;
@ -2521,7 +2520,7 @@ grTexAlphaCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "ctex1s_a.a = ccolor1.a; \n"); strcat(fragment_shader_texture1, "ctex1s_a.a = ccolor1.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : a = %x", a); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : a = %x", a);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0s_a.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0s_a.a = 0.0; \n");
else else
@ -2555,7 +2554,7 @@ grTexAlphaCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "ctex1_a.a = -ctex1s_a.a; \n"); strcat(fragment_shader_texture1, "ctex1_a.a = -ctex1s_a.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : a_mode = %x", a_mode); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : a_mode = %x", a_mode);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_a.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0_a.a = 0.0; \n");
else else
@ -2589,7 +2588,7 @@ grTexAlphaCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "ctex1s_b.a = ccolor1.a; \n"); strcat(fragment_shader_texture1, "ctex1s_b.a = ccolor1.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : b = %x", b); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : b = %x", b);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0s_b.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0s_b.a = 0.0; \n");
else else
@ -2623,7 +2622,7 @@ grTexAlphaCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "ctex1_b.a = -ctex1s_b.a; \n"); strcat(fragment_shader_texture1, "ctex1_b.a = -ctex1s_b.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : b_mode = %x", b_mode); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : b_mode = %x", b_mode);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_b.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0_b.a = 0.0; \n");
else else
@ -2675,7 +2674,7 @@ grTexAlphaCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "ctex1_c.a = ccolor1.a; \n"); strcat(fragment_shader_texture1, "ctex1_c.a = ccolor1.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : c = %x", c); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : c = %x", c);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_c.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0_c.a = 0.0; \n");
else else
@ -2723,7 +2722,7 @@ grTexAlphaCombineExt(GrChipID_t tmu,
strcat(fragment_shader_texture1, "ctex1_d.a = readtex1.a; \n"); strcat(fragment_shader_texture1, "ctex1_d.a = readtex1.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : d = %x", d); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : d = %x", d);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_d.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0_d.a = 0.0; \n");
else else
@ -2791,7 +2790,7 @@ grConstantColorValueExt(GrChipID_t tmu,
} }
break; break;
default: default:
display_warning("grConstantColorValue: unknown color format : %x", lfb_color_fmt); WriteTrace(TraceGlitch, TraceWarning, "grConstantColorValue: unknown color format : %x", lfb_color_fmt);
} }
vbo_draw(); vbo_draw();

View File

@ -173,7 +173,7 @@ grCoordinateSpace( GrCoordinateSpaceMode_t mode )
case GR_WINDOW_COORDS: case GR_WINDOW_COORDS:
break; break;
default: default:
display_warning("unknwown coordinate space : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "unknwown coordinate space : %x", mode);
} }
} }
@ -212,7 +212,7 @@ grVertexLayout(FxU32 param, FxI32 offset, FxU32 mode)
st1_off = offset; st1_off = offset;
break; break;
default: default:
display_warning("unknown grVertexLayout parameter : %x", param); WriteTrace(TraceGlitch, TraceWarning, "unknown grVertexLayout parameter : %x", param);
} }
} }
@ -246,7 +246,7 @@ grCullMode( GrCullMode_t mode )
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
break; break;
default: default:
display_warning("unknown cull mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "unknown cull mode : %x", mode);
} }
} }
@ -273,7 +273,7 @@ grDepthBufferMode( GrDepthBufferMode_t mode )
w_buffer_mode = 0; w_buffer_mode = 0;
break; break;
default: default:
display_warning("unknown depth buffer mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "unknown depth buffer mode : %x", mode);
} }
} }
@ -321,7 +321,7 @@ grDepthBufferFunction( GrCmpFnc_t function )
break; break;
default: default:
display_warning("unknown depth buffer function : %x", function); WriteTrace(TraceGlitch, TraceWarning, "unknown depth buffer function : %x", function);
} }
} }
@ -600,7 +600,7 @@ grDrawVertexArray(FxU32 mode, FxU32 Count, void *pointers2)
if(mode != GR_TRIANGLE_FAN) if(mode != GR_TRIANGLE_FAN)
{ {
display_warning("grDrawVertexArray : unknown mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "grDrawVertexArray : unknown mode : %x", mode);
} }
vbo_enable(); vbo_enable();
@ -638,6 +638,6 @@ grDrawVertexArrayContiguous(FxU32 mode, FxU32 Count, void *pointers, FxU32 strid
vbo_buffer(GL_TRIANGLE_FAN,0,Count,pointers); vbo_buffer(GL_TRIANGLE_FAN,0,Count,pointers);
break; break;
default: default:
display_warning("grDrawVertexArrayContiguous : unknown mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "grDrawVertexArrayContiguous : unknown mode : %x", mode);
} }
} }

View File

@ -90,7 +90,6 @@ static inline void opt_glCopyTexImage2D( GLenum target,
#define glCopyTexImage2D opt_glCopyTexImage2D #define glCopyTexImage2D opt_glCopyTexImage2D
*/ */
#ifdef _WIN32 #ifdef _WIN32
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB; PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT; PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT;
@ -136,8 +135,6 @@ PFNGLSECONDARYCOLOR3FPROC glSecondaryColor3f;
PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2DARB; PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2DARB;
#endif // _WIN32 #endif // _WIN32
typedef struct typedef struct
{ {
unsigned int address; unsigned int address;
@ -211,23 +208,6 @@ unsigned short depthBuffer[2048*2048];
//#define VOODOO1 //#define VOODOO1
void display_warning(const char *text, ...)
{
static int first_message = 100;
if (first_message)
{
char buf[4096];
va_list ap;
va_start(ap, text);
vsprintf(buf, text, ap);
va_end(ap);
first_message--;
LOGINFO(buf);
}
}
#ifdef _WIN32 #ifdef _WIN32
void display_error() void display_error()
{ {
@ -317,7 +297,7 @@ grSstOrigin(GrOriginLocation_t origin)
{ {
LOG("grSstOrigin(%d)\r\n", origin); LOG("grSstOrigin(%d)\r\n", origin);
if (origin != GR_ORIGIN_UPPER_LEFT) if (origin != GR_ORIGIN_UPPER_LEFT)
display_warning("grSstOrigin : %x", origin); WriteTrace(TraceGlitch, TraceWarning, "grSstOrigin : %x", origin);
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
@ -350,7 +330,8 @@ grClipWindow( FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy )
if (maxy < miny) maxy = miny; if (maxy < miny) maxy = miny;
glScissor(minx, miny + viewport_offset, maxx - minx, maxy - miny); glScissor(minx, miny + viewport_offset, maxx - minx, maxy - miny);
//printf("gl scissor %d %d %d %d\n", minx, miny, maxx, maxy); //printf("gl scissor %d %d %d %d\n", minx, miny, maxx, maxy);
} else { }
else {
glScissor(minx, (viewport_offset)+height - maxy, maxx - minx, maxy - miny); glScissor(minx, (viewport_offset)+height - maxy, maxx - minx, maxy - miny);
} }
glEnable(GL_SCISSOR_TEST); glEnable(GL_SCISSOR_TEST);
@ -534,18 +515,18 @@ grSstWinOpen(
glViewport(0, viewport_offset, width, height); glViewport(0, viewport_offset, width, height);
lfb_color_fmt = color_format; lfb_color_fmt = color_format;
if (origin_location != GR_ORIGIN_UPPER_LEFT) display_warning("origin must be in upper left corner"); if (origin_location != GR_ORIGIN_UPPER_LEFT) WriteTrace(TraceGlitch, TraceWarning, "origin must be in upper left corner");
if (nColBuffers != 2) display_warning("number of color buffer is not 2"); if (nColBuffers != 2) WriteTrace(TraceGlitch, TraceWarning, "number of color buffer is not 2");
if (nAuxBuffers != 1) display_warning("number of auxiliary buffer is not 1"); if (nAuxBuffers != 1) WriteTrace(TraceGlitch, TraceWarning, "number of auxiliary buffer is not 1");
if (isExtensionSupported("GL_ARB_texture_env_combine") == 0 && if (isExtensionSupported("GL_ARB_texture_env_combine") == 0 &&
isExtensionSupported("GL_EXT_texture_env_combine") == 0 && isExtensionSupported("GL_EXT_texture_env_combine") == 0 &&
show_warning) show_warning)
display_warning("Your video card doesn't support GL_ARB_texture_env_combine extension"); WriteTrace(TraceGlitch, TraceWarning, "Your video card doesn't support GL_ARB_texture_env_combine extension");
if (isExtensionSupported("GL_ARB_multitexture") == 0 && show_warning) if (isExtensionSupported("GL_ARB_multitexture") == 0 && show_warning)
display_warning("Your video card doesn't support GL_ARB_multitexture extension"); WriteTrace(TraceGlitch, TraceWarning, "Your video card doesn't support GL_ARB_multitexture extension");
if (isExtensionSupported("GL_ARB_texture_mirrored_repeat") == 0 && show_warning) if (isExtensionSupported("GL_ARB_texture_mirrored_repeat") == 0 && show_warning)
display_warning("Your video card doesn't support GL_ARB_texture_mirrored_repeat extension"); WriteTrace(TraceGlitch, TraceWarning, "Your video card doesn't support GL_ARB_texture_mirrored_repeat extension");
show_warning = 0; show_warning = 0;
#ifdef _WIN32 #ifdef _WIN32
@ -555,7 +536,7 @@ grSstWinOpen(
nbTextureUnits = 4; nbTextureUnits = 4;
//glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &nbTextureUnits); //glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &nbTextureUnits);
if (nbTextureUnits == 1) display_warning("You need a video card that has at least 2 texture units"); if (nbTextureUnits == 1) WriteTrace(TraceGlitch, TraceWarning, "You need a video card that has at least 2 texture units");
nbAuxBuffers = 4; nbAuxBuffers = 4;
//glGetIntegerv(GL_AUX_BUFFERS, &nbAuxBuffers); //glGetIntegerv(GL_AUX_BUFFERS, &nbAuxBuffers);
@ -629,7 +610,6 @@ grSstWinOpen(
isExtensionSupported("GL_ARB_fragment_shader") && isExtensionSupported("GL_ARB_fragment_shader") &&
isExtensionSupported("GL_ARB_vertex_shader")) isExtensionSupported("GL_ARB_vertex_shader"))
{ {
#ifdef _WIN32 #ifdef _WIN32
glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)wglGetProcAddress("glCreateShaderObjectARB"); glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)wglGetProcAddress("glCreateShaderObjectARB");
glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)wglGetProcAddress("glShaderSourceARB"); glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)wglGetProcAddress("glShaderSourceARB");
@ -652,15 +632,14 @@ grSstWinOpen(
} }
if (isExtensionSupported("GL_EXT_texture_compression_s3tc") == 0 && show_warning) if (isExtensionSupported("GL_EXT_texture_compression_s3tc") == 0 && show_warning)
display_warning("Your video card doesn't support GL_EXT_texture_compression_s3tc extension"); WriteTrace(TraceGlitch, TraceWarning, "Your video card doesn't support GL_EXT_texture_compression_s3tc extension");
if (isExtensionSupported("GL_3DFX_texture_compression_FXT1") == 0 && show_warning) if (isExtensionSupported("GL_3DFX_texture_compression_FXT1") == 0 && show_warning)
display_warning("Your video card doesn't support GL_3DFX_texture_compression_FXT1 extension"); WriteTrace(TraceGlitch, TraceWarning, "Your video card doesn't support GL_3DFX_texture_compression_FXT1 extension");
#ifdef _WIN32 #ifdef _WIN32
glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)wglGetProcAddress("glCompressedTexImage2DARB"); glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)wglGetProcAddress("glCompressedTexImage2DARB");
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
glViewport(0, viewport_offset, width, height); glViewport(0, viewport_offset, width, height);
viewport_width = width; viewport_width = width;
@ -729,7 +708,7 @@ grSstWinOpen(
glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL); glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL);
glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &ifmt); glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &ifmt);
if (ifmt != GL_RGB5_A1) { if (ifmt != GL_RGB5_A1) {
display_warning("ATI SUCKS %x\n", ifmt); WriteTrace(TraceGlitch, TraceWarning, "ATI SUCKS %x\n", ifmt);
ati_sucks = 1; ati_sucks = 1;
} else } else
ati_sucks = 0; ati_sucks = 0;
@ -831,9 +810,8 @@ FX_ENTRY void FX_CALL grTextureBufferExt( GrChipID_t tmu,
//printf("grTextureBufferExt(%d, %d, %d, %d, %d, %d, %d)\r\n", tmu, startAddress, lodmin, lodmax, aspect, fmt, evenOdd); //printf("grTextureBufferExt(%d, %d, %d, %d, %d, %d, %d)\r\n", tmu, startAddress, lodmin, lodmax, aspect, fmt, evenOdd);
LOG("grTextureBufferExt(%d, %d, %d, %d %d, %d, %d)\r\n", tmu, startAddress, lodmin, lodmax, aspect, fmt, evenOdd); LOG("grTextureBufferExt(%d, %d, %d, %d %d, %d, %d)\r\n", tmu, startAddress, lodmin, lodmax, aspect, fmt, evenOdd);
if (lodmin != lodmax) display_warning("grTextureBufferExt : loading more than one LOD"); if (lodmin != lodmax) WriteTrace(TraceGlitch, TraceWarning, "grTextureBufferExt : loading more than one LOD");
if (!use_fbo) { if (!use_fbo) {
if (!render_to_texture) { //initialization if (!render_to_texture) { //initialization
return; return;
} }
@ -859,7 +837,8 @@ FX_ENTRY void FX_CALL grTextureBufferExt( GrChipID_t tmu,
if (nbAuxBuffers > 0) { if (nbAuxBuffers > 0) {
//glDrawBuffer(GL_AUX0); //glDrawBuffer(GL_AUX0);
//current_buffer = GL_AUX0; //current_buffer = GL_AUX0;
} else { }
else {
int tw, th; int tw, th;
if (pBufferWidth < screen_width) if (pBufferWidth < screen_width)
tw = pBufferWidth; tw = pBufferWidth;
@ -881,16 +860,19 @@ FX_ENTRY void FX_CALL grTextureBufferExt( GrChipID_t tmu,
save_w, viewport_offset, tw - save_w, save_h); save_w, viewport_offset, tw - save_w, save_h);
save_w = tw; save_w = tw;
save_h = th; save_h = th;
} else if (tw > save_w) { }
else if (tw > save_w) {
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, save_w, 0, glCopyTexSubImage2D(GL_TEXTURE_2D, 0, save_w, 0,
save_w, viewport_offset, tw - save_w, save_h); save_w, viewport_offset, tw - save_w, save_h);
save_w = tw; save_w = tw;
} else if (th > save_h) { }
else if (th > save_h) {
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, save_h, glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, save_h,
0, viewport_offset + save_h, save_w, th - save_h); 0, viewport_offset + save_h, save_w, th - save_h);
save_h = th; save_h = th;
} }
} else { }
else {
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,
0, viewport_offset, tw, th); 0, viewport_offset, tw, th);
save_w = tw; save_w = tw;
@ -916,7 +898,6 @@ FX_ENTRY void FX_CALL grTextureBufferExt( GrChipID_t tmu,
// printf("tmu %d usage now %gMb - %gMb\n", // printf("tmu %d usage now %gMb - %gMb\n",
// rtmu, tmu_usage[rtmu].min/1024.0f, tmu_usage[rtmu].max/1024.0f); // rtmu, tmu_usage[rtmu].min/1024.0f, tmu_usage[rtmu].max/1024.0f);
width = pBufferWidth; width = pBufferWidth;
height = pBufferHeight; height = pBufferHeight;
@ -943,13 +924,13 @@ FX_ENTRY void FX_CALL grTextureBufferExt( GrChipID_t tmu,
//printf("viewport %dx%d\n", width, height); //printf("viewport %dx%d\n", width, height);
if (height > screen_height) { if (height > screen_height) {
glViewport(0, viewport_offset + screen_height - height, width, height); glViewport(0, viewport_offset + screen_height - height, width, height);
} else }
else
glViewport(0, viewport_offset, width, height); glViewport(0, viewport_offset, width, height);
glScissor(0, viewport_offset, width, height); glScissor(0, viewport_offset, width, height);
}
else {
} else {
if (!render_to_texture) //initialization if (!render_to_texture) //initialization
{ {
if (!fbs_init) if (!fbs_init)
@ -1059,7 +1040,8 @@ int CheckTextureBufferFormat(GrChipID_t tmu, FxU32 startAddress, GrTexInfo *info
found = 1; found = 1;
break; break;
} }
} else { }
else {
found = i = 0; found = i = 0;
while (i < nb_fb) while (i < nb_fb)
{ {
@ -1105,7 +1087,8 @@ int CheckTextureBufferFormat(GrChipID_t tmu, FxU32 startAddress, GrTexInfo *info
//printf("th %d rh %d ch %d\n", th, rh, ch); //printf("th %d rh %d ch %d\n", th, rh, ch);
invtex[tmu] = 1.0f - (th - rh) / (float)th; invtex[tmu] = 1.0f - (th - rh) / (float)th;
} else }
else
invtex[tmu] = 0; invtex[tmu] = 0;
if (info->format == GR_TEXFMT_ALPHA_INTENSITY_88) { if (info->format == GR_TEXFMT_ALPHA_INTENSITY_88) {
@ -1131,10 +1114,8 @@ int CheckTextureBufferFormat(GrChipID_t tmu, FxU32 startAddress, GrTexInfo *info
return 1; return 1;
} }
return 0; return 0;
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grTextureAuxBufferExt(GrChipID_t tmu, grTextureAuxBufferExt(GrChipID_t tmu,
FxU32 startAddress, FxU32 startAddress,
@ -1145,7 +1126,7 @@ grTextureAuxBufferExt( GrChipID_t tmu,
FxU32 odd_even_mask) FxU32 odd_even_mask)
{ {
LOG("grTextureAuxBufferExt(%d, %d, %d, %d %d, %d, %d)\r\n", tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask); LOG("grTextureAuxBufferExt(%d, %d, %d, %d %d, %d, %d)\r\n", tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask);
//display_warning("grTextureAuxBufferExt"); //WriteTrace(TraceGlitch, TraceWarning, "grTextureAuxBufferExt");
} }
FX_ENTRY void FX_CALL grAuxBufferExt(GrBuffer_t buffer); FX_ENTRY void FX_CALL grAuxBufferExt(GrBuffer_t buffer);
@ -1193,7 +1174,7 @@ grGetProcAddress( char *procName )
return (GrProc)grQueryResolutionsExt; return (GrProc)grQueryResolutionsExt;
if (!strcmp(procName, "grGetGammaTableExt")) if (!strcmp(procName, "grGetGammaTableExt"))
return (GrProc)grGetGammaTableExt; return (GrProc)grGetGammaTableExt;
display_warning("grGetProcAddress : %s", procName); WriteTrace(TraceGlitch, TraceWarning, "grGetProcAddress : %s", procName);
return 0; return 0;
} }
@ -1310,7 +1291,7 @@ grGet( FxU32 pname, FxU32 plength, FxI32 *params )
return 4; return 4;
break; break;
default: default:
display_warning("unknown pname in grGet : %x", pname); WriteTrace(TraceGlitch, TraceWarning, "unknown pname in grGet : %x", pname);
} }
return 0; return 0;
} }
@ -1352,7 +1333,7 @@ grGetString( FxU32 pname )
} }
break; break;
default: default:
display_warning("unknown grGetString selector : %x", pname); WriteTrace(TraceGlitch, TraceWarning, "unknown grGetString selector : %x", pname);
} }
return NULL; return NULL;
} }
@ -1399,13 +1380,11 @@ static void render_rectangle(int texture_number,
glEnableVertexAttribArray(TEXCOORD_1_ATTR); glEnableVertexAttribArray(TEXCOORD_1_ATTR);
glEnableVertexAttribArray(FOG_ATTR); glEnableVertexAttribArray(FOG_ATTR);
disable_textureSizes(); disable_textureSizes();
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
vbo_enable(); vbo_enable();
/* /*
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@ -1500,11 +1479,11 @@ FX_ENTRY void FX_CALL grFramebufferCopyExt(int x, int y, int w, int h,
int from, int to, int mode) int from, int to, int mode)
{ {
if (mode == GR_FBCOPY_MODE_DEPTH) { if (mode == GR_FBCOPY_MODE_DEPTH) {
int tw = 1, th = 1; int tw = 1, th = 1;
if (npot_support) { if (npot_support) {
tw = width; th = height; tw = width; th = height;
} else { }
else {
while (tw < width) tw <<= 1; while (tw < width) tw <<= 1;
while (th < height) th <<= 1; while (th < height) th <<= 1;
} }
@ -1540,7 +1519,6 @@ FX_ENTRY void FX_CALL grFramebufferCopyExt(int x, int y, int w, int h,
//glPopAttrib(); //glPopAttrib();
return; return;
} }
} }
} }
@ -1588,13 +1566,15 @@ grRenderBuffer( GrBuffer_t buffer )
if (nbAuxBuffers > 0) { if (nbAuxBuffers > 0) {
//glDrawBuffer(GL_BACK); //glDrawBuffer(GL_BACK);
current_buffer = GL_BACK; current_buffer = GL_BACK;
} else if (save_w) { }
else if (save_w) {
int tw = 1, th = 1; int tw = 1, th = 1;
//printf("restore %dx%d\n", save_w, save_h); //printf("restore %dx%d\n", save_w, save_h);
if (npot_support) { if (npot_support) {
tw = screen_width; tw = screen_width;
th = screen_height; th = screen_height;
} else { }
else {
while (tw < screen_width) tw <<= 1; while (tw < screen_width) tw <<= 1;
while (th < screen_height) th <<= 1; while (th < screen_height) th <<= 1;
} }
@ -1639,7 +1619,8 @@ grRenderBuffer( GrBuffer_t buffer )
//glTranslatef(0, 0, 1-zscale); //glTranslatef(0, 0, 1-zscale);
//glScalef(1, 1, zscale); //glScalef(1, 1, zscale);
inverted_culling = 0; inverted_culling = 0;
} else { }
else {
/* /*
float m[4*4] = {1.0f, 0.0f, 0.0f, 0.0f, float m[4*4] = {1.0f, 0.0f, 0.0f, 0.0f,
0.0f,-1.0f, 0.0f, 0.0f, 0.0f,-1.0f, 0.0f, 0.0f,
@ -1658,7 +1639,7 @@ grRenderBuffer( GrBuffer_t buffer )
render_to_texture = 1; render_to_texture = 1;
break; break;
default: default:
display_warning("grRenderBuffer : unknown buffer : %x", buffer); WriteTrace(TraceGlitch, TraceWarning, "grRenderBuffer : unknown buffer : %x", buffer);
} }
} }
@ -1666,7 +1647,7 @@ FX_ENTRY void FX_CALL
grAuxBufferExt(GrBuffer_t buffer) grAuxBufferExt(GrBuffer_t buffer)
{ {
LOG("grAuxBufferExt(%d)\r\n", buffer); LOG("grAuxBufferExt(%d)\r\n", buffer);
//display_warning("grAuxBufferExt"); //WriteTrace(TraceGlitch, TraceWarning, "grAuxBufferExt");
if (buffer == GR_BUFFER_AUXBUFFER) { if (buffer == GR_BUFFER_AUXBUFFER) {
invtex[0] = 0; invtex[0] = 0;
@ -1680,7 +1661,8 @@ grAuxBufferExt( GrBuffer_t buffer )
//glDisable(GL_ALPHA_TEST); //glDisable(GL_ALPHA_TEST);
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
grTexFilterMode(GR_TMU1, GR_TEXTUREFILTER_POINT_SAMPLED, GR_TEXTUREFILTER_POINT_SAMPLED); grTexFilterMode(GR_TMU1, GR_TEXTUREFILTER_POINT_SAMPLED, GR_TEXTUREFILTER_POINT_SAMPLED);
} else { }
else {
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
need_to_compile = 1; need_to_compile = 1;
} }
@ -1706,7 +1688,7 @@ grBufferClear( GrColor_t color, GrAlpha_t alpha, FxU32 depth )
alpha / 255.0f); alpha / 255.0f);
break; break;
default: default:
display_warning("grBufferClear: unknown color format : %x", lfb_color_fmt); WriteTrace(TraceGlitch, TraceWarning, "grBufferClear: unknown color format : %x", lfb_color_fmt);
} }
if (w_buffer_mode) if (w_buffer_mode)
@ -1717,7 +1699,6 @@ grBufferClear( GrColor_t color, GrAlpha_t alpha, FxU32 depth )
// ZIGGY TODO check that color mask is on // ZIGGY TODO check that color mask is on
buffer_cleared = 1; buffer_cleared = 1;
} }
// #include <unistd.h> // #include <unistd.h>
@ -1740,7 +1721,7 @@ grBufferSwap( FxU32 swap_interval )
LOG("grBufferSwap(%d)\r\n", swap_interval); LOG("grBufferSwap(%d)\r\n", swap_interval);
//printf("swap\n"); //printf("swap\n");
if (render_to_texture) { if (render_to_texture) {
display_warning("swap while render_to_texture\n"); WriteTrace(TraceGlitch, TraceWarning, "swap while render_to_texture\n");
return; return;
} }
@ -1783,7 +1764,7 @@ grLfbLock( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode,
LOG("grLfbLock(%d,%d,%d,%d,%d)\r\n", type, buffer, writeMode, origin, pixelPipeline); LOG("grLfbLock(%d,%d,%d,%d,%d)\r\n", type, buffer, writeMode, origin, pixelPipeline);
if (type == GR_LFB_WRITE_ONLY) if (type == GR_LFB_WRITE_ONLY)
{ {
display_warning("grLfbLock : write only"); WriteTrace(TraceGlitch, TraceWarning, "grLfbLock : write only");
} }
else else
{ {
@ -1799,7 +1780,7 @@ grLfbLock( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode,
//glReadBuffer(GL_BACK); //glReadBuffer(GL_BACK);
break; break;
default: default:
display_warning("grLfbLock : unknown buffer : %x", buffer); WriteTrace(TraceGlitch, TraceWarning, "grLfbLock : unknown buffer : %x", buffer);
} }
if (buffer != GR_BUFFER_AUXBUFFER) if (buffer != GR_BUFFER_AUXBUFFER)
@ -1811,7 +1792,8 @@ grLfbLock( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode,
info->writeMode = GR_LFBWRITEMODE_888; info->writeMode = GR_LFBWRITEMODE_888;
info->origin = origin; info->origin = origin;
//glReadPixels(0, viewport_offset, width, height, GL_BGRA, GL_UNSIGNED_BYTE, frameBuffer); //glReadPixels(0, viewport_offset, width, height, GL_BGRA, GL_UNSIGNED_BYTE, frameBuffer);
} else { }
else {
buf = (unsigned char*)malloc(width*height * 4); buf = (unsigned char*)malloc(width*height * 4);
info->lfbPtr = frameBuffer; info->lfbPtr = frameBuffer;
@ -1852,7 +1834,7 @@ grLfbUnlock( GrLock_t type, GrBuffer_t buffer )
LOG("grLfbUnlock(%d,%d)\r\n", type, buffer); LOG("grLfbUnlock(%d,%d)\r\n", type, buffer);
if (type == GR_LFB_WRITE_ONLY) if (type == GR_LFB_WRITE_ONLY)
{ {
display_warning("grLfbUnlock : write only"); WriteTrace(TraceGlitch, TraceWarning, "grLfbUnlock : write only");
} }
return FXTRUE; return FXTRUE;
} }
@ -1881,7 +1863,7 @@ grLfbReadRegion( GrBuffer_t src_buffer,
glReadBuffer(current_buffer); glReadBuffer(current_buffer);
break;*/ break;*/
default: default:
display_warning("grReadRegion : unknown buffer : %x", src_buffer); WriteTrace(TraceGlitch, TraceWarning, "grReadRegion : unknown buffer : %x", src_buffer);
} }
if (src_buffer != GR_BUFFER_AUXBUFFER) if (src_buffer != GR_BUFFER_AUXBUFFER)
@ -1951,7 +1933,7 @@ grLfbWriteRegion( GrBuffer_t dst_buffer,
//glDrawBuffer(current_buffer); //glDrawBuffer(current_buffer);
break; break;
default: default:
display_warning("grLfbWriteRegion : unknown buffer : %x", dst_buffer); WriteTrace(TraceGlitch, TraceWarning, "grLfbWriteRegion : unknown buffer : %x", dst_buffer);
} }
if (dst_buffer != GR_BUFFER_AUXBUFFER) if (dst_buffer != GR_BUFFER_AUXBUFFER)
@ -2004,7 +1986,7 @@ grLfbWriteRegion( GrBuffer_t dst_buffer,
} }
break; break;
default: default:
display_warning("grLfbWriteRegion : unknown format : %d", src_format); WriteTrace(TraceGlitch, TraceWarning, "grLfbWriteRegion : unknown format : %d", src_format);
} }
#ifdef VPDEBUG #ifdef VPDEBUG
@ -2030,17 +2012,16 @@ grLfbWriteRegion( GrBuffer_t dst_buffer,
dst_x, dst_y, dst_x, dst_y,
src_width, src_height, src_width, src_height,
tex_width, tex_height, +1); tex_width, tex_height, +1);
} }
else else
{ {
float *buf = (float*)malloc(src_width*(src_height + (viewport_offset))*sizeof(float)); float *buf = (float*)malloc(src_width*(src_height + (viewport_offset))*sizeof(float));
if (src_format != GR_LFBWRITEMODE_ZA16) if (src_format != GR_LFBWRITEMODE_ZA16)
display_warning("unknown depth buffer write format:%x", src_format); WriteTrace(TraceGlitch, TraceWarning, "unknown depth buffer write format:%x", src_format);
if (dst_x || dst_y) if (dst_x || dst_y)
display_warning("dst_x:%d, dst_y:%d\n",dst_x, dst_y); WriteTrace(TraceGlitch, TraceWarning, "dst_x:%d, dst_y:%d\n", dst_x, dst_y);
for (j = 0; j < src_height; j++) for (j = 0; j < src_height; j++)
{ {
@ -2150,14 +2131,14 @@ grQueryResolutions( const GrResolution *resTemplate, GrResolution *output )
int i; int i;
int n = 0; int n = 0;
LOG("grQueryResolutions\r\n"); LOG("grQueryResolutions\r\n");
display_warning("grQueryResolutions"); WriteTrace(TraceGlitch, TraceWarning, "grQueryResolutions");
if ((unsigned int)resTemplate->resolution != GR_QUERY_ANY) if ((unsigned int)resTemplate->resolution != GR_QUERY_ANY)
{ {
res_inf = res_sup = resTemplate->resolution; res_inf = res_sup = resTemplate->resolution;
} }
if ((unsigned int)resTemplate->refresh == GR_QUERY_ANY) display_warning("querying any refresh rate"); if ((unsigned int)resTemplate->refresh == GR_QUERY_ANY) WriteTrace(TraceGlitch, TraceWarning, "querying any refresh rate");
if ((unsigned int)resTemplate->numAuxBuffers == GR_QUERY_ANY) display_warning("querying any numAuxBuffers"); if ((unsigned int)resTemplate->numAuxBuffers == GR_QUERY_ANY) WriteTrace(TraceGlitch, TraceWarning, "querying any numAuxBuffers");
if ((unsigned int)resTemplate->numColorBuffers == GR_QUERY_ANY) display_warning("querying any numColorBuffers"); if ((unsigned int)resTemplate->numColorBuffers == GR_QUERY_ANY) WriteTrace(TraceGlitch, TraceWarning, "querying any numColorBuffers");
if (output == NULL) return res_sup - res_inf + 1; if (output == NULL) return res_sup - res_inf + 1;
for (i = res_inf; i <= res_sup; i++) for (i = res_inf; i <= res_sup; i++)
@ -2174,7 +2155,7 @@ grQueryResolutions( const GrResolution *resTemplate, GrResolution *output )
FX_ENTRY FxBool FX_CALL FX_ENTRY FxBool FX_CALL
grReset(FxU32 what) grReset(FxU32 what)
{ {
display_warning("grReset"); WriteTrace(TraceGlitch, TraceWarning, "grReset");
return 1; return 1;
} }
@ -2197,32 +2178,32 @@ grDisable( GrEnableMode_t mode )
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grDisableAllEffects(void) grDisableAllEffects(void)
{ {
display_warning("grDisableAllEffects"); WriteTrace(TraceGlitch, TraceWarning, "grDisableAllEffects");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grErrorSetCallback(GrErrorCallbackFnc_t fnc) grErrorSetCallback(GrErrorCallbackFnc_t fnc)
{ {
display_warning("grErrorSetCallback"); WriteTrace(TraceGlitch, TraceWarning, "grErrorSetCallback");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grFinish(void) grFinish(void)
{ {
display_warning("grFinish"); WriteTrace(TraceGlitch, TraceWarning, "grFinish");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grFlush(void) grFlush(void)
{ {
display_warning("grFlush"); WriteTrace(TraceGlitch, TraceWarning, "grFlush");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grTexMultibase(GrChipID_t tmu, grTexMultibase(GrChipID_t tmu,
FxBool enable) FxBool enable)
{ {
display_warning("grTexMultibase"); WriteTrace(TraceGlitch, TraceWarning, "grTexMultibase");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
@ -2230,7 +2211,7 @@ grTexMipMapMode( GrChipID_t tmu,
GrMipMapMode_t mode, GrMipMapMode_t mode,
FxBool lodBlend) FxBool lodBlend)
{ {
display_warning("grTexMipMapMode"); WriteTrace(TraceGlitch, TraceWarning, "grTexMipMapMode");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
@ -2239,14 +2220,14 @@ grTexDownloadTablePartial( GrTexTable_t type,
int start, int start,
int end) int end)
{ {
display_warning("grTexDownloadTablePartial"); WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTablePartial");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grTexDownloadTable(GrTexTable_t type, grTexDownloadTable(GrTexTable_t type,
void *data) void *data)
{ {
display_warning("grTexDownloadTable"); WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTable");
} }
FX_ENTRY FxBool FX_CALL FX_ENTRY FxBool FX_CALL
@ -2261,7 +2242,7 @@ grTexDownloadMipMapLevelPartial( GrChipID_t tmu,
int start, int start,
int end) int end)
{ {
display_warning("grTexDownloadMipMapLevelPartial"); WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevelPartial");
return 1; return 1;
} }
@ -2275,37 +2256,37 @@ grTexDownloadMipMapLevel( GrChipID_t tmu,
FxU32 evenOdd, FxU32 evenOdd,
void *data) void *data)
{ {
display_warning("grTexDownloadMipMapLevel"); WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevel");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grTexNCCTable(GrNCCTable_t table) grTexNCCTable(GrNCCTable_t table)
{ {
display_warning("grTexNCCTable"); WriteTrace(TraceGlitch, TraceWarning, "grTexNCCTable");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grViewport(FxI32 x, FxI32 y, FxI32 width, FxI32 height) grViewport(FxI32 x, FxI32 y, FxI32 width, FxI32 height)
{ {
display_warning("grViewport"); WriteTrace(TraceGlitch, TraceWarning, "grViewport");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grDepthRange(FxFloat n, FxFloat f) grDepthRange(FxFloat n, FxFloat f)
{ {
display_warning("grDepthRange"); WriteTrace(TraceGlitch, TraceWarning, "grDepthRange");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grSplash(float x, float y, float width, float height, FxU32 frame) grSplash(float x, float y, float width, float height, FxU32 frame)
{ {
display_warning("grSplash"); WriteTrace(TraceGlitch, TraceWarning, "grSplash");
} }
FX_ENTRY FxBool FX_CALL FX_ENTRY FxBool FX_CALL
grSelectContext(GrContext_t context) grSelectContext(GrContext_t context)
{ {
display_warning("grSelectContext"); WriteTrace(TraceGlitch, TraceWarning, "grSelectContext");
return 1; return 1;
} }
@ -2315,61 +2296,61 @@ grAADrawTriangle(
FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias
) )
{ {
display_warning("grAADrawTriangle"); WriteTrace(TraceGlitch, TraceWarning, "grAADrawTriangle");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grAlphaControlsITRGBLighting(FxBool enable) grAlphaControlsITRGBLighting(FxBool enable)
{ {
display_warning("grAlphaControlsITRGBLighting"); WriteTrace(TraceGlitch, TraceWarning, "grAlphaControlsITRGBLighting");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grGlideSetVertexLayout(const void *layout) grGlideSetVertexLayout(const void *layout)
{ {
display_warning("grGlideSetVertexLayout"); WriteTrace(TraceGlitch, TraceWarning, "grGlideSetVertexLayout");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grGlideGetVertexLayout(void *layout) grGlideGetVertexLayout(void *layout)
{ {
display_warning("grGlideGetVertexLayout"); WriteTrace(TraceGlitch, TraceWarning, "grGlideGetVertexLayout");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grGlideSetState(const void *state) grGlideSetState(const void *state)
{ {
display_warning("grGlideSetState"); WriteTrace(TraceGlitch, TraceWarning, "grGlideSetState");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grGlideGetState(void *state) grGlideGetState(void *state)
{ {
display_warning("grGlideGetState"); WriteTrace(TraceGlitch, TraceWarning, "grGlideGetState");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grLfbWriteColorFormat(GrColorFormat_t colorFormat) grLfbWriteColorFormat(GrColorFormat_t colorFormat)
{ {
display_warning("grLfbWriteColorFormat"); WriteTrace(TraceGlitch, TraceWarning, "grLfbWriteColorFormat");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grLfbWriteColorSwizzle(FxBool swizzleBytes, FxBool swapWords) grLfbWriteColorSwizzle(FxBool swizzleBytes, FxBool swapWords)
{ {
display_warning("grLfbWriteColorSwizzle"); WriteTrace(TraceGlitch, TraceWarning, "grLfbWriteColorSwizzle");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grLfbConstantDepth(FxU32 depth) grLfbConstantDepth(FxU32 depth)
{ {
display_warning("grLfbConstantDepth"); WriteTrace(TraceGlitch, TraceWarning, "grLfbConstantDepth");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grLfbConstantAlpha(GrAlpha_t alpha) grLfbConstantAlpha(GrAlpha_t alpha)
{ {
display_warning("grLfbConstantAlpha"); WriteTrace(TraceGlitch, TraceWarning, "grLfbConstantAlpha");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
@ -2379,7 +2360,7 @@ grTexMultibaseAddress( GrChipID_t tmu,
FxU32 evenOdd, FxU32 evenOdd,
GrTexInfo *info) GrTexInfo *info)
{ {
display_warning("grTexMultibaseAddress"); WriteTrace(TraceGlitch, TraceWarning, "grTexMultibaseAddress");
} }
/* /*
@ -2477,27 +2458,27 @@ guGammaCorrectionRGB( FxFloat gammaR, FxFloat gammaG, FxFloat gammaB )
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grDitherMode(GrDitherMode_t mode) grDitherMode(GrDitherMode_t mode)
{ {
display_warning("grDitherMode"); WriteTrace(TraceGlitch, TraceWarning, "grDitherMode");
} }
void grChromaRangeExt(GrColor_t color0, GrColor_t color1, FxU32 mode) void grChromaRangeExt(GrColor_t color0, GrColor_t color1, FxU32 mode)
{ {
display_warning("grChromaRangeExt"); WriteTrace(TraceGlitch, TraceWarning, "grChromaRangeExt");
} }
void grChromaRangeModeExt(GrChromakeyMode_t mode) void grChromaRangeModeExt(GrChromakeyMode_t mode)
{ {
display_warning("grChromaRangeModeExt"); WriteTrace(TraceGlitch, TraceWarning, "grChromaRangeModeExt");
} }
void grTexChromaRangeExt(GrChipID_t tmu, GrColor_t color0, GrColor_t color1, GrTexChromakeyMode_t mode) void grTexChromaRangeExt(GrChipID_t tmu, GrColor_t color0, GrColor_t color1, GrTexChromakeyMode_t mode)
{ {
display_warning("grTexChromaRangeExt"); WriteTrace(TraceGlitch, TraceWarning, "grTexChromaRangeExt");
} }
void grTexChromaModeExt(GrChipID_t tmu, GrChromakeyMode_t mode) void grTexChromaModeExt(GrChipID_t tmu, GrChromakeyMode_t mode)
{ {
display_warning("grTexChromaRangeModeExt"); WriteTrace(TraceGlitch, TraceWarning, "grTexChromaRangeModeExt");
} }
// VP debug // VP debug

View File

@ -183,7 +183,7 @@ grTexTextureMemRequired( FxU32 evenOdd,
{ {
int width, height; int width, height;
LOG("grTextureMemRequired(%d)\r\n", evenOdd); LOG("grTextureMemRequired(%d)\r\n", evenOdd);
if (info->largeLodLog2 != info->smallLodLog2) display_warning("grTexTextureMemRequired : loading more than one LOD"); if (info->largeLodLog2 != info->smallLodLog2) WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : loading more than one LOD");
if (info->aspectRatioLog2 < 0) if (info->aspectRatioLog2 < 0)
{ {
@ -221,7 +221,7 @@ grTexTextureMemRequired( FxU32 evenOdd,
case GR_TEXFMT_ARGB_CMP_FXT1: case GR_TEXFMT_ARGB_CMP_FXT1:
return ((((width+0x7)&~0x7)*((height+0x3)&~0x3))>>1); return ((((width+0x7)&~0x7)*((height+0x3)&~0x3))>>1);
default: default:
display_warning("grTexTextureMemRequired : unknown texture format: %x", info->format); WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : unknown texture format: %x", info->format);
} }
return 0; return 0;
} }
@ -233,7 +233,7 @@ grTexCalcMemRequired(
{ {
int width, height; int width, height;
LOG("grTexCalcMemRequired(%d, %d, %d, %d)\r\n", lodmin, lodmax, aspect, fmt); LOG("grTexCalcMemRequired(%d, %d, %d, %d)\r\n", lodmin, lodmax, aspect, fmt);
if (lodmax != lodmin) display_warning("grTexCalcMemRequired : loading more than one LOD"); if (lodmax != lodmin) WriteTrace(TraceGlitch, TraceWarning, "grTexCalcMemRequired : loading more than one LOD");
if (aspect < 0) if (aspect < 0)
{ {
@ -271,7 +271,7 @@ grTexCalcMemRequired(
case GR_TEXFMT_ARGB_CMP_FXT1: case GR_TEXFMT_ARGB_CMP_FXT1:
return ((((width+0x7)&~0x7)*((height+0x3)&~0x3))>>1); return ((((width+0x7)&~0x7)*((height+0x3)&~0x3))>>1);
default: default:
display_warning("grTexTextureMemRequired : unknown texture format: %x", fmt); WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : unknown texture format: %x", fmt);
} }
return 0; return 0;
} }
@ -315,7 +315,7 @@ int grTexFormatSize(int fmt)
factor = 8; factor = 8;
break; break;
default: default:
display_warning("grTexFormatSize : unknown texture format: %x", fmt); WriteTrace(TraceGlitch, TraceWarning, "grTexFormatSize : unknown texture format: %x", fmt);
} }
return factor; return factor;
} }
@ -401,7 +401,7 @@ int grTexFormat2GLPackedFmt(int fmt, int * gltexfmt, int * glpixfmt, int * glpac
*glpackfmt = GL_COMPRESSED_RGBA_FXT1_3DFX; // XXX: what should we do about GL_COMPRESSED_RGB_FXT1_3DFX? *glpackfmt = GL_COMPRESSED_RGBA_FXT1_3DFX; // XXX: what should we do about GL_COMPRESSED_RGB_FXT1_3DFX?
break; break;
default: default:
display_warning("grTexFormat2GLPackedFmt : unknown texture format: %x", fmt); WriteTrace(TraceGlitch, TraceWarning, "grTexFormat2GLPackedFmt : unknown texture format: %x", fmt);
} }
return factor; return factor;
*/ */
@ -418,7 +418,7 @@ grTexDownloadMipMap( GrChipID_t tmu,
int glformat = 0; int glformat = 0;
int gltexfmt, glpixfmt, glpackfmt; int gltexfmt, glpixfmt, glpackfmt;
LOG("grTexDownloadMipMap(%d,%d,%d)\r\n", tmu, startAddress, evenOdd); LOG("grTexDownloadMipMap(%d,%d,%d)\r\n", tmu, startAddress, evenOdd);
if (info->largeLodLog2 != info->smallLodLog2) display_warning("grTexDownloadMipMap : loading more than one LOD"); if (info->largeLodLog2 != info->smallLodLog2) WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMap : loading more than one LOD");
if (info->aspectRatioLog2 < 0) if (info->aspectRatioLog2 < 0)
{ {
@ -622,7 +622,7 @@ grTexDownloadMipMap( GrChipID_t tmu,
break; break;
*/ */
default: default:
display_warning("grTexDownloadMipMap : unknown texture format: %x", info->format); WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMap : unknown texture format: %x", info->format);
factor = 0; factor = 0;
} }
} }
@ -767,14 +767,14 @@ grTexDetailControl(
{ {
if (!lod_bias && !detail_scale && !detail_max) return; if (!lod_bias && !detail_scale && !detail_max) return;
else else
display_warning("grTexDetailControl : %d, %d, %f", lod_bias, detail_scale, detail_max); WriteTrace(TraceGlitch, TraceWarning, "grTexDetailControl : %d, %d, %f", lod_bias, detail_scale, detail_max);
} }
lambda = detail_max; lambda = detail_max;
if(lambda > 1.0f) if(lambda > 1.0f)
{ {
lambda = 1.0f - (255.0f - lambda); lambda = 1.0f - (255.0f - lambda);
} }
if(lambda > 1.0f) display_warning("lambda:%f", lambda); if(lambda > 1.0f) WriteTrace(TraceGlitch, TraceWarning, "lambda:%f", lambda);
set_lambda(); set_lambda();
} }
@ -843,7 +843,7 @@ grTexClampMode(
wrap_s0 = GL_MIRRORED_REPEAT; wrap_s0 = GL_MIRRORED_REPEAT;
break; break;
default: default:
display_warning("grTexClampMode : unknown s_clampmode : %x", s_clampmode); WriteTrace(TraceGlitch, TraceWarning, "grTexClampMode : unknown s_clampmode : %x", s_clampmode);
} }
switch(t_clampmode) switch(t_clampmode)
{ {
@ -857,7 +857,7 @@ grTexClampMode(
wrap_t0 = GL_MIRRORED_REPEAT; wrap_t0 = GL_MIRRORED_REPEAT;
break; break;
default: default:
display_warning("grTexClampMode : unknown t_clampmode : %x", t_clampmode); WriteTrace(TraceGlitch, TraceWarning, "grTexClampMode : unknown t_clampmode : %x", t_clampmode);
} }
glActiveTexture(GL_TEXTURE0); glActiveTexture(GL_TEXTURE0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s0);
@ -877,7 +877,7 @@ grTexClampMode(
wrap_s1 = GL_MIRRORED_REPEAT; wrap_s1 = GL_MIRRORED_REPEAT;
break; break;
default: default:
display_warning("grTexClampMode : unknown s_clampmode : %x", s_clampmode); WriteTrace(TraceGlitch, TraceWarning, "grTexClampMode : unknown s_clampmode : %x", s_clampmode);
} }
switch(t_clampmode) switch(t_clampmode)
{ {
@ -891,7 +891,7 @@ grTexClampMode(
wrap_t1 = GL_MIRRORED_REPEAT; wrap_t1 = GL_MIRRORED_REPEAT;
break; break;
default: default:
display_warning("grTexClampMode : unknown t_clampmode : %x", t_clampmode); WriteTrace(TraceGlitch, TraceWarning, "grTexClampMode : unknown t_clampmode : %x", t_clampmode);
} }
glActiveTexture(GL_TEXTURE1); glActiveTexture(GL_TEXTURE1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s1); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s1);

View File

@ -243,11 +243,11 @@ void init_combiner()
if (!log_length) if (!log_length)
{ {
glGetInfoLogARB(fragment_shader_object, 2048, &log_length, shader_log); glGetInfoLogARB(fragment_shader_object, 2048, &log_length, shader_log);
if (log_length) display_warning(shader_log); if (log_length) WriteTrace(TraceGlitch, TraceWarning, shader_log);
glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log); glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log);
if (log_length) display_warning(shader_log); if (log_length) WriteTrace(TraceGlitch, TraceWarning, shader_log);
glGetInfoLogARB(program_object, 2048, &log_length, shader_log); glGetInfoLogARB(program_object, 2048, &log_length, shader_log);
if (log_length) display_warning(shader_log); if (log_length) WriteTrace(TraceGlitch, TraceWarning, shader_log);
} }
texture0_location = glGetUniformLocationARB(program_object, "texture0"); texture0_location = glGetUniformLocationARB(program_object, "texture0");
@ -267,11 +267,11 @@ void init_combiner()
if (!log_length) if (!log_length)
{ {
glGetInfoLogARB(fragment_shader_object, 2048, &log_length, shader_log); glGetInfoLogARB(fragment_shader_object, 2048, &log_length, shader_log);
if (log_length) display_warning(shader_log); if (log_length) WriteTrace(TraceGlitch, TraceWarning, shader_log);
glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log); glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log);
if (log_length) display_warning(shader_log); if (log_length) WriteTrace(TraceGlitch, TraceWarning, shader_log);
glGetInfoLogARB(program_object, 2048, &log_length, shader_log); glGetInfoLogARB(program_object, 2048, &log_length, shader_log);
if (log_length) display_warning(shader_log); if (log_length) WriteTrace(TraceGlitch, TraceWarning, shader_log);
} }
texture0_location = glGetUniformLocationARB(program_object, "texture0"); texture0_location = glGetUniformLocationARB(program_object, "texture0");
@ -314,7 +314,7 @@ void compile_chroma_shader()
strcat(fragment_shader_chroma, "float alpha = constant_color.a; \n"); strcat(fragment_shader_chroma, "float alpha = constant_color.a; \n");
break; break;
default: default:
display_warning("unknown compile_choma_shader_alpha : %x", chroma_other_alpha); WriteTrace(TraceGlitch, TraceWarning, "unknown compile_choma_shader_alpha : %x", chroma_other_alpha);
} }
switch (chroma_other_color) switch (chroma_other_color)
@ -329,7 +329,7 @@ void compile_chroma_shader()
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(constant_color),alpha); \n"); strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(constant_color),alpha); \n");
break; break;
default: default:
display_warning("unknown compile_choma_shader_alpha : %x", chroma_other_color); WriteTrace(TraceGlitch, TraceWarning, "unknown compile_choma_shader_alpha : %x", chroma_other_color);
} }
strcat(fragment_shader_chroma, "if (color.rgb == chroma_color.rgb) discard; \n"); strcat(fragment_shader_chroma, "if (color.rgb == chroma_color.rgb) discard; \n");
@ -487,12 +487,12 @@ void compile_shader()
{ {
glGetInfoLogARB(shader_programs[number_of_programs].fragment_shader_object, glGetInfoLogARB(shader_programs[number_of_programs].fragment_shader_object,
2048, &log_length, shader_log); 2048, &log_length, shader_log);
if (log_length) display_warning(shader_log); if (log_length) WriteTrace(TraceGlitch, TraceWarning, shader_log);
glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log); glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log);
if (log_length) display_warning(shader_log); if (log_length) WriteTrace(TraceGlitch, TraceWarning, shader_log);
glGetInfoLogARB(program_object, glGetInfoLogARB(program_object,
2048, &log_length, shader_log); 2048, &log_length, shader_log);
if (log_length) display_warning(shader_log); if (log_length) WriteTrace(TraceGlitch, TraceWarning, shader_log);
} }
texture0_location = glGetUniformLocationARB(program_object, "texture0"); texture0_location = glGetUniformLocationARB(program_object, "texture0");
@ -582,7 +582,7 @@ grConstantColorValue(GrColor_t value)
texture_env_color[3] = (value & 0xFF) / 255.0f; texture_env_color[3] = (value & 0xFF) / 255.0f;
break; break;
default: default:
display_warning("grConstantColorValue: unknown color format : %x", lfb_color_fmt); WriteTrace(TraceGlitch, TraceWarning, "grConstantColorValue: unknown color format : %x", lfb_color_fmt);
} }
constant_color_location = glGetUniformLocationARB(program_object, "constant_color"); constant_color_location = glGetUniformLocationARB(program_object, "constant_color");
@ -606,7 +606,7 @@ int setOtherColorSource(int other)
return GL_CONSTANT_ARB; return GL_CONSTANT_ARB;
break; break;
default: default:
display_warning("unknwown other color source : %x", other); WriteTrace(TraceGlitch, TraceWarning, "unknown other color source : %x", other);
} }
return 0; return 0;
} }
@ -622,7 +622,7 @@ int setLocalColorSource(int local)
return GL_CONSTANT_ARB; return GL_CONSTANT_ARB;
break; break;
default: default:
display_warning("unknwown local color source : %x", local); WriteTrace(TraceGlitch, TraceWarning, "unknown local color source : %x", local);
} }
return 0; return 0;
} }
@ -641,7 +641,7 @@ void writeGLSLColorOther(int other)
strcat(fragment_shader_color_combiner, "vec4 color_other = constant_color; \n"); strcat(fragment_shader_color_combiner, "vec4 color_other = constant_color; \n");
break; break;
default: default:
display_warning("unknown writeGLSLColorOther : %x", other); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLColorOther : %x", other);
} }
} }
@ -656,7 +656,7 @@ void writeGLSLColorLocal(int local)
strcat(fragment_shader_color_combiner, "vec4 color_local = constant_color; \n"); strcat(fragment_shader_color_combiner, "vec4 color_local = constant_color; \n");
break; break;
default: default:
display_warning("unknown writeGLSLColorLocal : %x", local); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLColorLocal : %x", local);
} }
} }
@ -704,7 +704,7 @@ void writeGLSLColorFactor(int factor, int local, int need_local, int other, int
strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - vec4(ctexture1.a); \n"); strcat(fragment_shader_color_combiner, "vec4 color_factor = vec4(1.0) - vec4(ctexture1.a); \n");
break; break;
default: default:
display_warning("unknown writeGLSLColorFactor : %x", factor); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLColorFactor : %x", factor);
} }
} }
@ -731,7 +731,7 @@ FxBool invert)
last_local = local; last_local = local;
last_other = other; last_other = other;
if (invert) display_warning("grColorCombine : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "inverted result");
color_combiner_key = function | (factor << 4) | (local << 8) | (other << 10); color_combiner_key = function | (factor << 4) | (local << 8) | (other << 10);
chroma_other_color = other; chroma_other_color = other;
@ -797,7 +797,7 @@ FxBool invert)
break; break;
default: default:
strcpy(fragment_shader_color_combiner, fragment_shader_default); strcpy(fragment_shader_color_combiner, fragment_shader_default);
display_warning("grColorCombine : unknown function : %x", function); WriteTrace(TraceGlitch, TraceWarning, "unknown function : %x", function);
} }
//compile_shader(); //compile_shader();
need_to_compile = 1; need_to_compile = 1;
@ -817,7 +817,7 @@ int setOtherAlphaSource(int other)
return GL_CONSTANT_ARB; return GL_CONSTANT_ARB;
break; break;
default: default:
display_warning("unknwown other alpha source : %x", other); WriteTrace(TraceGlitch, TraceWarning, "unknwown other alpha source : %x", other);
} }
return 0; return 0;
} }
@ -833,7 +833,7 @@ int setLocalAlphaSource(int local)
return GL_CONSTANT_ARB; return GL_CONSTANT_ARB;
break; break;
default: default:
display_warning("unknwown local alpha source : %x", local); WriteTrace(TraceGlitch, TraceWarning, "unknwown local alpha source : %x", local);
} }
return 0; return 0;
} }
@ -852,7 +852,7 @@ void writeGLSLAlphaOther(int other)
strcat(fragment_shader_alpha_combiner, "float alpha_other = constant_color.a; \n"); strcat(fragment_shader_alpha_combiner, "float alpha_other = constant_color.a; \n");
break; break;
default: default:
display_warning("unknown writeGLSLAlphaOther : %x", other); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLAlphaOther : %x", other);
} }
} }
@ -867,7 +867,7 @@ void writeGLSLAlphaLocal(int local)
strcat(fragment_shader_alpha_combiner, "float alpha_local = constant_color.a; \n"); strcat(fragment_shader_alpha_combiner, "float alpha_local = constant_color.a; \n");
break; break;
default: default:
display_warning("unknown writeGLSLAlphaLocal : %x", local); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLAlphaLocal : %x", local);
} }
} }
@ -912,7 +912,7 @@ void writeGLSLAlphaFactor(int factor, int local, int need_local, int other, int
strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - ctexture1.a; \n"); strcat(fragment_shader_alpha_combiner, "float alpha_factor = 1.0 - ctexture1.a; \n");
break; break;
default: default:
display_warning("unknown writeGLSLAlphaFactor : %x", factor); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLAlphaFactor : %x", factor);
} }
} }
@ -939,7 +939,7 @@ FxBool invert
last_local = local; last_local = local;
last_other = other; last_other = other;
if (invert) display_warning("grAlphaCombine : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "inverted result");
alpha_combiner_key = function | (factor << 4) | (local << 8) | (other << 10); alpha_combiner_key = function | (factor << 4) | (local << 8) | (other << 10);
chroma_other_alpha = other; chroma_other_alpha = other;
@ -1005,7 +1005,7 @@ FxBool invert
strcat(fragment_shader_alpha_combiner, "gl_FragColor.a = alpha_factor * (-alpha_local) + alpha_local; \n"); strcat(fragment_shader_alpha_combiner, "gl_FragColor.a = alpha_factor * (-alpha_local) + alpha_local; \n");
break; break;
default: default:
display_warning("grAlphaCombine : unknown function : %x", function); WriteTrace(TraceGlitch, TraceWarning, "unknown function : %x", function);
} }
//compile_shader(); //compile_shader();
@ -1077,7 +1077,7 @@ void writeGLSLTextureColorFactor(int num_tex, int factor)
strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0) - vec4(lambda); \n"); strcat(fragment_shader_texture1, "vec4 texture1_color_factor = vec4(1.0) - vec4(lambda); \n");
break; break;
default: default:
display_warning("unknown writeGLSLTextureColorFactor : %x", factor); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLTextureColorFactor : %x", factor);
} }
} }
@ -1146,7 +1146,7 @@ void writeGLSLTextureAlphaFactor(int num_tex, int factor)
strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0 - lambda; \n"); strcat(fragment_shader_texture1, "float texture1_alpha_factor = 1.0 - lambda; \n");
break; break;
default: default:
display_warning("unknown writeGLSLTextureAlphaFactor : %x", factor); WriteTrace(TraceGlitch, TraceWarning, "unknown writeGLSLTextureAlphaFactor : %x", factor);
} }
} }
@ -1300,7 +1300,7 @@ FxBool alpha_invert
strcat(fragment_shader_texture0, "vec4 ctexture0 = readtex0; \n"); strcat(fragment_shader_texture0, "vec4 ctexture0 = readtex0; \n");
else else
strcat(fragment_shader_texture1, "vec4 ctexture1 = readtex1; \n"); strcat(fragment_shader_texture1, "vec4 ctexture1 = readtex1; \n");
display_warning("grTextCombine : unknown rgb function : %x", rgb_function); WriteTrace(TraceGlitch, TraceWarning, "grTextCombine : unknown rgb function : %x", rgb_function);
} }
if (rgb_invert) if (rgb_invert)
@ -1392,7 +1392,7 @@ FxBool alpha_invert
strcat(fragment_shader_texture0, "ctexture0.a = readtex0.a; \n"); strcat(fragment_shader_texture0, "ctexture0.a = readtex0.a; \n");
else else
strcat(fragment_shader_texture1, "ctexture1.a = ctexture0.a; \n"); strcat(fragment_shader_texture1, "ctexture1.a = ctexture0.a; \n");
display_warning("grTextCombine : unknown alpha function : %x", alpha_function); WriteTrace(TraceGlitch, TraceWarning, "grTextCombine : unknown alpha function : %x", alpha_function);
} }
if (alpha_invert) if (alpha_invert)
@ -1429,7 +1429,7 @@ GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df
sfactorRGB = GL_ONE_MINUS_SRC_ALPHA; sfactorRGB = GL_ONE_MINUS_SRC_ALPHA;
break; break;
default: default:
display_warning("grAlphaBlendFunction : rgb_sf = %x", rgb_sf); WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : rgb_sf = %x", rgb_sf);
} }
switch (rgb_df) switch (rgb_df)
@ -1447,7 +1447,7 @@ GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df
dfactorRGB = GL_ONE_MINUS_SRC_ALPHA; dfactorRGB = GL_ONE_MINUS_SRC_ALPHA;
break; break;
default: default:
display_warning("grAlphaBlendFunction : rgb_df = %x", rgb_df); WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : rgb_df = %x", rgb_df);
} }
switch (alpha_sf) switch (alpha_sf)
@ -1459,7 +1459,7 @@ GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df
sfactorAlpha = GL_ONE; sfactorAlpha = GL_ONE;
break; break;
default: default:
display_warning("grAlphaBlendFunction : alpha_sf = %x", alpha_sf); WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : alpha_sf = %x", alpha_sf);
} }
switch (alpha_df) switch (alpha_df)
@ -1471,7 +1471,7 @@ GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df
dfactorAlpha = GL_ONE; dfactorAlpha = GL_ONE;
break; break;
default: default:
display_warning("grAlphaBlendFunction : alpha_df = %x", alpha_df); WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : alpha_df = %x", alpha_df);
} }
glEnable(GL_BLEND); glEnable(GL_BLEND);
if (blend_func_separate_support) if (blend_func_separate_support)
@ -1510,7 +1510,7 @@ grAlphaTestFunction(GrCmpFnc_t function)
return; return;
break; break;
default: default:
display_warning("grAlphaTestFunction : unknown function : %x", function); WriteTrace(TraceGlitch, TraceWarning, "unknown function : %x", function);
} }
glEnable(GL_ALPHA_TEST); glEnable(GL_ALPHA_TEST);
@ -1540,7 +1540,7 @@ grFogMode(GrFogMode_t mode)
fog_enabled = 2; fog_enabled = 2;
break; break;
default: default:
display_warning("grFogMode : unknown mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "unknown mode : %x", mode);
} }
need_to_compile = 1; need_to_compile = 1;
@ -1594,7 +1594,7 @@ grFogColorValue(GrColor_t fogcolor)
color[3] = (fogcolor & 0xFF) / 255.0f; color[3] = (fogcolor & 0xFF) / 255.0f;
break; break;
default: default:
display_warning("grFogColorValue: unknown color format : %x", lfb_color_fmt); WriteTrace(TraceGlitch, TraceWarning, "unknown color format : %x", lfb_color_fmt);
} }
glFogfv(GL_FOG_COLOR, color); glFogfv(GL_FOG_COLOR, color);
@ -1616,7 +1616,7 @@ grChromakeyMode(GrChromakeyMode_t mode)
chroma_enabled = 1; chroma_enabled = 1;
break; break;
default: default:
display_warning("grChromakeyMode : unknown mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "unknown mode : %x", mode);
} }
need_to_compile = 1; need_to_compile = 1;
} }
@ -1642,7 +1642,7 @@ grChromakeyValue(GrColor_t value)
chroma_color[3] = 1.0;//(value & 0xFF) / 255.0f; chroma_color[3] = 1.0;//(value & 0xFF) / 255.0f;
break; break;
default: default:
display_warning("grChromakeyValue: unknown color format : %x", lfb_color_fmt); WriteTrace(TraceGlitch, TraceWarning, "grChromakeyValue: unknown color format : %x", lfb_color_fmt);
} }
chroma_color_location = glGetUniformLocationARB(program_object, "chroma_color"); chroma_color_location = glGetUniformLocationARB(program_object, "chroma_color");
@ -1723,7 +1723,7 @@ grStippleMode(GrStippleMode_t mode)
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
break; break;
default: default:
display_warning("grStippleMode:%x", mode); WriteTrace(TraceGlitch, TraceWarning, "grStippleMode:%x", mode);
} }
need_to_compile = 1; need_to_compile = 1;
@ -1738,8 +1738,8 @@ GrCCUColor_t d, FxBool d_invert,
FxU32 shift, FxBool invert) FxU32 shift, FxBool invert)
{ {
WriteTrace(TraceResolution, 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); WriteTrace(TraceResolution, 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) display_warning("grColorCombineExt : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : inverted result");
if (shift) display_warning("grColorCombineExt : shift = %d", shift); if (shift) WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : shift = %d", shift);
color_combiner_key = 0x80000000 | (a & 0x1F) | ((a_mode & 3) << 5) | color_combiner_key = 0x80000000 | (a & 0x1F) | ((a_mode & 3) << 5) |
((b & 0x1F) << 7) | ((b_mode & 3) << 12) | ((b & 0x1F) << 7) | ((b_mode & 3) << 12) |
@ -1772,7 +1772,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_color_combiner, "vec4 cs_a = ctexture1; \n"); strcat(fragment_shader_color_combiner, "vec4 cs_a = ctexture1; \n");
break; break;
default: default:
display_warning("grColorCombineExt : a = %x", a); WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : a = %x", a);
strcat(fragment_shader_color_combiner, "vec4 cs_a = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 cs_a = vec4(0.0); \n");
} }
@ -1791,7 +1791,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_color_combiner, "vec4 c_a = -cs_a; \n"); strcat(fragment_shader_color_combiner, "vec4 c_a = -cs_a; \n");
break; break;
default: default:
display_warning("grColorCombineExt : a_mode = %x", a_mode); WriteTrace(TraceGlitch, TraceWarning, "a_mode = %x", a_mode);
strcat(fragment_shader_color_combiner, "vec4 c_a = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 c_a = vec4(0.0); \n");
} }
@ -1819,7 +1819,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_color_combiner, "vec4 cs_b = ctexture1; \n"); strcat(fragment_shader_color_combiner, "vec4 cs_b = ctexture1; \n");
break; break;
default: default:
display_warning("grColorCombineExt : b = %x", b); WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : b = %x", b);
strcat(fragment_shader_color_combiner, "vec4 cs_b = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 cs_b = vec4(0.0); \n");
} }
@ -1838,7 +1838,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_color_combiner, "vec4 c_b = -cs_b; \n"); strcat(fragment_shader_color_combiner, "vec4 c_b = -cs_b; \n");
break; break;
default: default:
display_warning("grColorCombineExt : b_mode = %x", b_mode); WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : b_mode = %x", b_mode);
strcat(fragment_shader_color_combiner, "vec4 c_b = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 c_b = vec4(0.0); \n");
} }
@ -1875,7 +1875,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_color_combiner, "vec4 c_c = ctexture1; \n"); strcat(fragment_shader_color_combiner, "vec4 c_c = ctexture1; \n");
break; break;
default: default:
display_warning("grColorCombineExt : c = %x", c); WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : c = %x", c);
strcat(fragment_shader_color_combiner, "vec4 c_c = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 c_c = vec4(0.0); \n");
} }
@ -1900,7 +1900,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_color_combiner, "vec4 c_d = gl_Color; \n"); strcat(fragment_shader_color_combiner, "vec4 c_d = gl_Color; \n");
break; break;
default: default:
display_warning("grColorCombineExt : d = %x", d); WriteTrace(TraceGlitch, TraceWarning, "grColorCombineExt : d = %x", d);
strcat(fragment_shader_color_combiner, "vec4 c_d = vec4(0.0); \n"); strcat(fragment_shader_color_combiner, "vec4 c_d = vec4(0.0); \n");
} }
@ -1920,8 +1920,8 @@ GrACUColor_t d, FxBool d_invert,
FxU32 shift, FxBool invert) FxU32 shift, FxBool invert)
{ {
WriteTrace(TraceResolution, 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); WriteTrace(TraceResolution, 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) display_warning("grAlphaCombineExt : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : inverted result");
if (shift) display_warning("grAlphaCombineExt : shift = %d", shift); if (shift) WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : shift = %d", shift);
alpha_combiner_key = 0x80000000 | (a & 0x1F) | ((a_mode & 3) << 5) | alpha_combiner_key = 0x80000000 | (a & 0x1F) | ((a_mode & 3) << 5) |
((b & 0x1F) << 7) | ((b_mode & 3) << 12) | ((b & 0x1F) << 7) | ((b_mode & 3) << 12) |
@ -1945,7 +1945,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_alpha_combiner, "float as_a = gl_Color.a; \n"); strcat(fragment_shader_alpha_combiner, "float as_a = gl_Color.a; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : a = %x", a); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : a = %x", a);
strcat(fragment_shader_alpha_combiner, "float as_a = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float as_a = 0.0; \n");
} }
@ -1964,7 +1964,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_alpha_combiner, "float a_a = -as_a; \n"); strcat(fragment_shader_alpha_combiner, "float a_a = -as_a; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : a_mode = %x", a_mode); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : a_mode = %x", a_mode);
strcat(fragment_shader_alpha_combiner, "float a_a = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float a_a = 0.0; \n");
} }
@ -1983,7 +1983,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_alpha_combiner, "float as_b = gl_Color.a; \n"); strcat(fragment_shader_alpha_combiner, "float as_b = gl_Color.a; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : b = %x", b); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : b = %x", b);
strcat(fragment_shader_alpha_combiner, "float as_b = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float as_b = 0.0; \n");
} }
@ -2002,7 +2002,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_alpha_combiner, "float a_b = -as_b; \n"); strcat(fragment_shader_alpha_combiner, "float a_b = -as_b; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : b_mode = %x", b_mode); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : b_mode = %x", b_mode);
strcat(fragment_shader_alpha_combiner, "float a_b = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float a_b = 0.0; \n");
} }
@ -2030,7 +2030,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_alpha_combiner, "float a_c = gl_Color.a; \n"); strcat(fragment_shader_alpha_combiner, "float a_c = gl_Color.a; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : c = %x", c); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : c = %x", c);
strcat(fragment_shader_alpha_combiner, "float a_c = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float a_c = 0.0; \n");
} }
@ -2052,7 +2052,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_alpha_combiner, "float a_d = as_b; \n"); strcat(fragment_shader_alpha_combiner, "float a_d = as_b; \n");
break; break;
default: default:
display_warning("grAlphaCombineExt : d = %x", d); WriteTrace(TraceGlitch, TraceWarning, "grAlphaCombineExt : d = %x", d);
strcat(fragment_shader_alpha_combiner, "float a_d = 0.0; \n"); strcat(fragment_shader_alpha_combiner, "float a_d = 0.0; \n");
} }
@ -2075,8 +2075,8 @@ FxU32 shift, FxBool invert)
int num_tex; int num_tex;
WriteTrace(TraceResolution, 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); WriteTrace(TraceResolution, 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);
if (invert) display_warning("grTexColorCombineExt : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : inverted result");
if (shift) display_warning("grTexColorCombineExt : shift = %d", shift); if (shift) WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : shift = %d", shift);
if (tmu == GR_TMU0) num_tex = 1; if (tmu == GR_TMU0) num_tex = 1;
else num_tex = 0; else num_tex = 0;
@ -2157,7 +2157,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "vec4 ctex1s_a = vec4(ccolor1.a); \n"); strcat(fragment_shader_texture1, "vec4 ctex1s_a = vec4(ccolor1.a); \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : a = %x", a); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : a = %x", a);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0s_a = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0s_a = vec4(0.0); \n");
else else
@ -2191,7 +2191,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "vec4 ctex1_a = -ctex1s_a; \n"); strcat(fragment_shader_texture1, "vec4 ctex1_a = -ctex1s_a; \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : a_mode = %x", a_mode); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : a_mode = %x", a_mode);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_a = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0_a = vec4(0.0); \n");
else else
@ -2255,7 +2255,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "vec4 ctex1s_b = ccolor1; \n"); strcat(fragment_shader_texture1, "vec4 ctex1s_b = ccolor1; \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : b = %x", b); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : b = %x", b);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0s_b = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0s_b = vec4(0.0); \n");
else else
@ -2289,7 +2289,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "vec4 ctex1_b = -ctex1s_b; \n"); strcat(fragment_shader_texture1, "vec4 ctex1_b = -ctex1s_b; \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : b_mode = %x", b_mode); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : b_mode = %x", b_mode);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_b = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0_b = vec4(0.0); \n");
else else
@ -2365,7 +2365,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "vec4 ctex1_c = ccolor1; \n"); strcat(fragment_shader_texture1, "vec4 ctex1_c = ccolor1; \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : c = %x", c); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : c = %x", c);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_c = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0_c = vec4(0.0); \n");
else else
@ -2407,7 +2407,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "vec4 ctex1_d = vec4(readtex1.a); \n"); strcat(fragment_shader_texture1, "vec4 ctex1_d = vec4(readtex1.a); \n");
break; break;
default: default:
display_warning("grTexColorCombineExt : d = %x", d); WriteTrace(TraceGlitch, TraceWarning, "grTexColorCombineExt : d = %x", d);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "vec4 ctex0_d = vec4(0.0); \n"); strcat(fragment_shader_texture0, "vec4 ctex0_d = vec4(0.0); \n");
else else
@ -2440,8 +2440,8 @@ FxU32 shift, FxBool invert)
int num_tex; int num_tex;
WriteTrace(TraceResolution, 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); WriteTrace(TraceResolution, 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);
if (invert) display_warning("grTexAlphaCombineExt : inverted result"); if (invert) WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : inverted result");
if (shift) display_warning("grTexAlphaCombineExt : shift = %d", shift); if (shift) WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : shift = %d", shift);
if (tmu == GR_TMU0) num_tex = 1; if (tmu == GR_TMU0) num_tex = 1;
else num_tex = 0; else num_tex = 0;
@ -2488,7 +2488,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "ctex1s_a.a = ccolor1.a; \n"); strcat(fragment_shader_texture1, "ctex1s_a.a = ccolor1.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : a = %x", a); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : a = %x", a);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0s_a.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0s_a.a = 0.0; \n");
else else
@ -2522,7 +2522,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "ctex1_a.a = -ctex1s_a.a; \n"); strcat(fragment_shader_texture1, "ctex1_a.a = -ctex1s_a.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : a_mode = %x", a_mode); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : a_mode = %x", a_mode);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_a.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0_a.a = 0.0; \n");
else else
@ -2556,7 +2556,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "ctex1s_b.a = ccolor1.a; \n"); strcat(fragment_shader_texture1, "ctex1s_b.a = ccolor1.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : b = %x", b); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : b = %x", b);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0s_b.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0s_b.a = 0.0; \n");
else else
@ -2590,7 +2590,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "ctex1_b.a = -ctex1s_b.a; \n"); strcat(fragment_shader_texture1, "ctex1_b.a = -ctex1s_b.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : b_mode = %x", b_mode); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : b_mode = %x", b_mode);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_b.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0_b.a = 0.0; \n");
else else
@ -2642,7 +2642,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "ctex1_c.a = ccolor1.a; \n"); strcat(fragment_shader_texture1, "ctex1_c.a = ccolor1.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : c = %x", c); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : c = %x", c);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_c.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0_c.a = 0.0; \n");
else else
@ -2690,7 +2690,7 @@ FxU32 shift, FxBool invert)
strcat(fragment_shader_texture1, "ctex1_d.a = readtex1.a; \n"); strcat(fragment_shader_texture1, "ctex1_d.a = readtex1.a; \n");
break; break;
default: default:
display_warning("grTexAlphaCombineExt : d = %x", d); WriteTrace(TraceGlitch, TraceWarning, "grTexAlphaCombineExt : d = %x", d);
if (num_tex == 0) if (num_tex == 0)
strcat(fragment_shader_texture0, "ctex0_d.a = 0.0; \n"); strcat(fragment_shader_texture0, "ctex0_d.a = 0.0; \n");
else else
@ -2758,7 +2758,7 @@ GrColor_t value)
} }
break; break;
default: default:
display_warning("grConstantColorValue: unknown color format : %x", lfb_color_fmt); WriteTrace(TraceGlitch, TraceWarning, "grConstantColorValue: unknown color format : %x", lfb_color_fmt);
} }
if (num_tex == 0) if (num_tex == 0)

View File

@ -67,7 +67,7 @@ grCoordinateSpace(GrCoordinateSpaceMode_t mode)
case GR_WINDOW_COORDS: case GR_WINDOW_COORDS:
break; break;
default: default:
display_warning("unknwown coordinate space : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "unknwown coordinate space : %x", mode);
} }
} }
@ -106,7 +106,7 @@ grVertexLayout(FxU32 param, FxI32 offset, FxU32 mode)
st1_off = offset; st1_off = offset;
break; break;
default: default:
display_warning("unknown grVertexLayout parameter : %x", param); WriteTrace(TraceGlitch, TraceWarning, "unknown grVertexLayout parameter : %x", param);
} }
} }
@ -140,7 +140,7 @@ grCullMode(GrCullMode_t mode)
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
break; break;
default: default:
display_warning("unknown cull mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "unknown cull mode : %x", mode);
} }
grDisplayGLError("grCullMode"); grDisplayGLError("grCullMode");
} }
@ -168,7 +168,7 @@ grDepthBufferMode(GrDepthBufferMode_t mode)
w_buffer_mode = 0; w_buffer_mode = 0;
break; break;
default: default:
display_warning("unknown depth buffer mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "unknown depth buffer mode : %x", mode);
} }
grDisplayGLError("grDepthBufferMode"); grDisplayGLError("grDepthBufferMode");
} }
@ -217,7 +217,7 @@ grDepthBufferFunction(GrCmpFnc_t function)
break; break;
default: default:
display_warning("unknown depth buffer function : %x", function); WriteTrace(TraceGlitch, TraceWarning, "unknown depth buffer function : %x", function);
} }
grDisplayGLError("grDepthBufferFunction"); grDisplayGLError("grDepthBufferFunction");
} }
@ -625,7 +625,7 @@ grDrawVertexArray(FxU32 mode, FxU32 Count, void *pointers2)
glBegin(GL_TRIANGLE_FAN); glBegin(GL_TRIANGLE_FAN);
break; break;
default: default:
display_warning("grDrawVertexArray : unknown mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "grDrawVertexArray : unknown mode : %x", mode);
} }
for (i = 0; i < Count; i++) for (i = 0; i < Count; i++)
@ -700,7 +700,7 @@ grDrawVertexArrayContiguous(FxU32 mode, FxU32 Count, void *pointers, FxU32 strid
glBegin(GL_TRIANGLE_FAN); glBegin(GL_TRIANGLE_FAN);
break; break;
default: default:
display_warning("grDrawVertexArrayContiguous : unknown mode : %x", mode); WriteTrace(TraceGlitch, TraceWarning, "grDrawVertexArrayContiguous : unknown mode : %x", mode);
} }
for (i = 0; i < Count; i++) for (i = 0; i < Count; i++)

View File

@ -538,22 +538,6 @@ unsigned short depthBuffer[2048 * 2048];
//#define VOODOO1 //#define VOODOO1
void display_warning(const char *text, ...)
{
static int first_message = 100;
if (first_message)
{
char buf[1000];
va_list ap;
va_start(ap, text);
vsprintf(buf, text, ap);
va_end(ap);
first_message--;
}
}
#ifdef _WIN32 #ifdef _WIN32
void display_error() void display_error()
{ {
@ -572,7 +556,7 @@ grSstOrigin(GrOriginLocation_t origin)
{ {
WriteTrace(TraceGlitch, TraceDebug, "origin = %d", origin); WriteTrace(TraceGlitch, TraceDebug, "origin = %d", origin);
if (origin != GR_ORIGIN_UPPER_LEFT) if (origin != GR_ORIGIN_UPPER_LEFT)
display_warning("grSstOrigin : %x", origin); WriteTrace(TraceGlitch, TraceWarning, "grSstOrigin : %x", origin);
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
@ -864,7 +848,7 @@ int nAuxBuffers)
height = 2048; height = 2048;
break; break;
default: default:
display_warning("unknown SstWinOpen resolution : %x", screen_resolution); WriteTrace(TraceGlitch, TraceWarning, "unknown SstWinOpen resolution : %x", screen_resolution);
} }
} }
@ -910,7 +894,7 @@ int nAuxBuffers)
// primary monitor only // primary monitor only
if (!g_FullScreenResolutions.changeDisplaySettings(screen_resolution)) if (!g_FullScreenResolutions.changeDisplaySettings(screen_resolution))
{ {
display_warning("can't change to fullscreen mode"); WriteTrace(TraceGlitch, TraceWarning, "can't change to fullscreen mode");
} }
windowedMenu = GetMenu(hwnd_win); windowedMenu = GetMenu(hwnd_win);
@ -935,7 +919,7 @@ int nAuxBuffers)
if ((hDC = GetDC(hwnd_win)) == NULL) if ((hDC = GetDC(hwnd_win)) == NULL)
{ {
display_warning("GetDC on main window failed"); WriteTrace(TraceGlitch, TraceWarning, "GetDC on main window failed");
return FXFALSE; return FXFALSE;
} }
@ -946,18 +930,18 @@ int nAuxBuffers)
} }
if (pfm == 0) if (pfm == 0)
{ {
display_warning("ChoosePixelFormat failed"); WriteTrace(TraceGlitch, TraceWarning, "ChoosePixelFormat failed");
return FXFALSE; return FXFALSE;
} }
if (SetPixelFormat(hDC, pfm, &pfd) == 0) if (SetPixelFormat(hDC, pfm, &pfd) == 0)
{ {
display_warning("SetPixelFormat failed"); WriteTrace(TraceGlitch, TraceWarning, "SetPixelFormat failed");
return FXFALSE; return FXFALSE;
} }
if ((hGLRC = wglCreateContext(hDC)) == 0) if ((hGLRC = wglCreateContext(hDC)) == 0)
{ {
display_warning("wglCreateContext failed!"); WriteTrace(TraceGlitch, TraceWarning, "wglCreateContext failed!");
grSstWinClose(0); grSstWinClose(0);
return FXFALSE; return FXFALSE;
} }
@ -968,7 +952,7 @@ int nAuxBuffers)
{ {
if (!wglMakeCurrent(hDC, hGLRC)) if (!wglMakeCurrent(hDC, hGLRC))
{ {
display_warning("wglMakeCurrent failed!"); WriteTrace(TraceGlitch, TraceWarning, "wglMakeCurrent failed!");
grSstWinClose(0); grSstWinClose(0);
return FXFALSE; return FXFALSE;
} }
@ -1058,18 +1042,18 @@ int nAuxBuffers)
glViewport(0, viewport_offset, width, height); glViewport(0, viewport_offset, width, height);
#endif // _WIN32 #endif // _WIN32
lfb_color_fmt = color_format; lfb_color_fmt = color_format;
if (origin_location != GR_ORIGIN_UPPER_LEFT) display_warning("origin must be in upper left corner"); if (origin_location != GR_ORIGIN_UPPER_LEFT) WriteTrace(TraceGlitch, TraceWarning, "origin must be in upper left corner");
if (nColBuffers != 2) display_warning("number of color buffer is not 2"); if (nColBuffers != 2) WriteTrace(TraceGlitch, TraceWarning, "number of color buffer is not 2");
if (nAuxBuffers != 1) display_warning("number of auxiliary buffer is not 1"); if (nAuxBuffers != 1) WriteTrace(TraceGlitch, TraceWarning, "number of auxiliary buffer is not 1");
if (isExtensionSupported("GL_ARB_texture_env_combine") == 0 && if (isExtensionSupported("GL_ARB_texture_env_combine") == 0 &&
isExtensionSupported("GL_EXT_texture_env_combine") == 0 && isExtensionSupported("GL_EXT_texture_env_combine") == 0 &&
show_warning) show_warning)
display_warning("Your video card doesn't support GL_ARB_texture_env_combine extension"); WriteTrace(TraceGlitch, TraceWarning, "Your video card doesn't support GL_ARB_texture_env_combine extension");
if (isExtensionSupported("GL_ARB_multitexture") == 0 && show_warning) if (isExtensionSupported("GL_ARB_multitexture") == 0 && show_warning)
display_warning("Your video card doesn't support GL_ARB_multitexture extension"); WriteTrace(TraceGlitch, TraceWarning, "Your video card doesn't support GL_ARB_multitexture extension");
if (isExtensionSupported("GL_ARB_texture_mirrored_repeat") == 0 && show_warning) if (isExtensionSupported("GL_ARB_texture_mirrored_repeat") == 0 && show_warning)
display_warning("Your video card doesn't support GL_ARB_texture_mirrored_repeat extension"); WriteTrace(TraceGlitch, TraceWarning, "Your video card doesn't support GL_ARB_texture_mirrored_repeat extension");
show_warning = 0; show_warning = 0;
#ifdef _WIN32 #ifdef _WIN32
@ -1084,7 +1068,7 @@ int nAuxBuffers)
nbTextureUnits = 0; nbTextureUnits = 0;
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &nbTextureUnits); glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &nbTextureUnits);
if (nbTextureUnits == 1) display_warning("You need a video card that has at least 2 texture units"); if (nbTextureUnits == 1) WriteTrace(TraceGlitch, TraceWarning, "You need a video card that has at least 2 texture units");
nbAuxBuffers = 0; nbAuxBuffers = 0;
glGetIntegerv(GL_AUX_BUFFERS, &nbAuxBuffers); glGetIntegerv(GL_AUX_BUFFERS, &nbAuxBuffers);
@ -1204,9 +1188,9 @@ int nAuxBuffers)
} }
if (isExtensionSupported("GL_EXT_texture_compression_s3tc") == 0 && show_warning) if (isExtensionSupported("GL_EXT_texture_compression_s3tc") == 0 && show_warning)
display_warning("Your video card doesn't support GL_EXT_texture_compression_s3tc extension"); WriteTrace(TraceGlitch, TraceWarning, "Your video card doesn't support GL_EXT_texture_compression_s3tc extension");
if (isExtensionSupported("GL_3DFX_texture_compression_FXT1") == 0 && show_warning) if (isExtensionSupported("GL_3DFX_texture_compression_FXT1") == 0 && show_warning)
display_warning("Your video card doesn't support GL_3DFX_texture_compression_FXT1 extension"); WriteTrace(TraceGlitch, TraceWarning, "Your video card doesn't support GL_3DFX_texture_compression_FXT1 extension");
#ifdef _WIN32 #ifdef _WIN32
glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)wglGetProcAddress("glCompressedTexImage2DARB"); glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)wglGetProcAddress("glCompressedTexImage2DARB");
@ -1315,7 +1299,7 @@ int nAuxBuffers)
glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL); glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL);
glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &ifmt); glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &ifmt);
if (ifmt != GL_RGB5_A1) { if (ifmt != GL_RGB5_A1) {
display_warning("ATI SUCKS %x\n", ifmt); WriteTrace(TraceGlitch, TraceWarning, "ATI SUCKS %x\n", ifmt);
ati_sucks = 1; ati_sucks = 1;
} }
else else
@ -1418,7 +1402,7 @@ FX_ENTRY void FX_CALL grTextureBufferExt(GrChipID_t tmu,
static int fbs_init = 0; static int fbs_init = 0;
WriteTrace(TraceGlitch, TraceDebug, "tmu: %d startAddress: %d lodmin: %d lodmax: %d aspect: %d fmt: %d evenOdd: %d", tmu, startAddress, lodmin, lodmax, aspect, fmt, evenOdd); WriteTrace(TraceGlitch, TraceDebug, "tmu: %d startAddress: %d lodmin: %d lodmax: %d aspect: %d fmt: %d evenOdd: %d", tmu, startAddress, lodmin, lodmax, aspect, fmt, evenOdd);
if (lodmin != lodmax) display_warning("grTextureBufferExt : loading more than one LOD"); if (lodmin != lodmax) WriteTrace(TraceGlitch, TraceWarning, "grTextureBufferExt : loading more than one LOD");
if (!use_fbo) { if (!use_fbo) {
if (!render_to_texture) { //initialization if (!render_to_texture) { //initialization
return; return;
@ -1785,7 +1769,7 @@ grGetProcAddress(char *procName)
return (GrProc)grQueryResolutionsExt; return (GrProc)grQueryResolutionsExt;
if (!strcmp(procName, "grGetGammaTableExt")) if (!strcmp(procName, "grGetGammaTableExt"))
return (GrProc)grGetGammaTableExt; return (GrProc)grGetGammaTableExt;
display_warning("grGetProcAddress : %s", procName); WriteTrace(TraceGlitch, TraceWarning, "grGetProcAddress : %s", procName);
return 0; return 0;
} }
@ -1902,7 +1886,7 @@ grGet(FxU32 pname, FxU32 plength, FxI32 *params)
return 4; return 4;
break; break;
default: default:
display_warning("unknown pname in grGet : %x", pname); WriteTrace(TraceGlitch, TraceWarning, "unknown pname in grGet : %x", pname);
} }
return 0; return 0;
} }
@ -1944,7 +1928,7 @@ grGetString(FxU32 pname)
} }
break; break;
default: default:
display_warning("unknown grGetString selector : %x", pname); WriteTrace(TraceGlitch, TraceWarning, "unknown grGetString selector : %x", pname);
} }
return NULL; return NULL;
} }
@ -2223,7 +2207,7 @@ grRenderBuffer(GrBuffer_t buffer)
render_to_texture = 1; render_to_texture = 1;
break; break;
default: default:
display_warning("grRenderBuffer : unknown buffer : %x", buffer); WriteTrace(TraceGlitch, TraceWarning, "grRenderBuffer : unknown buffer : %x", buffer);
} }
grDisplayGLError("grRenderBuffer"); grDisplayGLError("grRenderBuffer");
} }
@ -2272,7 +2256,7 @@ grBufferClear(GrColor_t color, GrAlpha_t alpha, FxU32 depth)
alpha / 255.0f); alpha / 255.0f);
break; break;
default: default:
display_warning("grBufferClear: unknown color format : %x", lfb_color_fmt); WriteTrace(TraceGlitch, TraceWarning, "grBufferClear: unknown color format : %x", lfb_color_fmt);
} }
if (w_buffer_mode) if (w_buffer_mode)
@ -2295,7 +2279,7 @@ grBufferSwap(FxU32 swap_interval)
WriteTrace(TraceGlitch, TraceDebug, "swap_interval: %d", swap_interval); WriteTrace(TraceGlitch, TraceDebug, "swap_interval: %d", swap_interval);
//printf("swap\n"); //printf("swap\n");
if (render_to_texture) { if (render_to_texture) {
display_warning("swap while render_to_texture\n"); WriteTrace(TraceGlitch, TraceWarning, "swap while render_to_texture\n");
return; return;
} }
@ -2346,7 +2330,7 @@ GrLfbInfo_t *info)
WriteTrace(TraceGlitch, TraceDebug, "type: %d buffer: %d writeMode: %d origin: %d pixelPipeline: %d", type, buffer, writeMode, origin, pixelPipeline); WriteTrace(TraceGlitch, TraceDebug, "type: %d buffer: %d writeMode: %d origin: %d pixelPipeline: %d", type, buffer, writeMode, origin, pixelPipeline);
if (type == GR_LFB_WRITE_ONLY) if (type == GR_LFB_WRITE_ONLY)
{ {
display_warning("grLfbLock : write only"); WriteTrace(TraceGlitch, TraceWarning, "grLfbLock : write only");
} }
else else
{ {
@ -2362,7 +2346,7 @@ GrLfbInfo_t *info)
glReadBuffer(GL_BACK); glReadBuffer(GL_BACK);
break; break;
default: default:
display_warning("grLfbLock : unknown buffer : %x", buffer); WriteTrace(TraceGlitch, TraceWarning, "grLfbLock : unknown buffer : %x", buffer);
} }
if (buffer != GR_BUFFER_AUXBUFFER) if (buffer != GR_BUFFER_AUXBUFFER)
@ -2417,7 +2401,7 @@ grLfbUnlock(GrLock_t type, GrBuffer_t buffer)
WriteTrace(TraceGlitch, TraceDebug, "type: %d, buffer: %d", type, buffer); WriteTrace(TraceGlitch, TraceDebug, "type: %d, buffer: %d", type, buffer);
if (type == GR_LFB_WRITE_ONLY) if (type == GR_LFB_WRITE_ONLY)
{ {
display_warning("grLfbUnlock : write only"); WriteTrace(TraceGlitch, TraceWarning, "grLfbUnlock : write only");
} }
return FXTRUE; return FXTRUE;
} }
@ -2446,7 +2430,7 @@ FxU32 dst_stride, void *dst_data)
glReadBuffer(current_buffer); glReadBuffer(current_buffer);
break;*/ break;*/
default: default:
display_warning("grReadRegion : unknown buffer : %x", src_buffer); WriteTrace(TraceGlitch, TraceWarning, "grReadRegion : unknown buffer : %x", src_buffer);
} }
if (src_buffer != GR_BUFFER_AUXBUFFER) if (src_buffer != GR_BUFFER_AUXBUFFER)
@ -2517,7 +2501,7 @@ FxI32 src_stride, void *src_data)
glDrawBuffer(current_buffer); glDrawBuffer(current_buffer);
break; break;
default: default:
display_warning("grLfbWriteRegion : unknown buffer : %x", dst_buffer); WriteTrace(TraceGlitch, TraceWarning, "grLfbWriteRegion : unknown buffer : %x", dst_buffer);
} }
if (dst_buffer != GR_BUFFER_AUXBUFFER) if (dst_buffer != GR_BUFFER_AUXBUFFER)
@ -2570,7 +2554,7 @@ FxI32 src_stride, void *src_data)
} }
break; break;
default: default:
display_warning("grLfbWriteRegion : unknown format : %d", src_format); WriteTrace(TraceGlitch, TraceWarning, "grLfbWriteRegion : unknown format : %d", src_format);
} }
#ifdef VPDEBUG #ifdef VPDEBUG
@ -2602,10 +2586,10 @@ FxI32 src_stride, void *src_data)
float *buf = (float*)malloc(src_width*(src_height + (viewport_offset))*sizeof(float)); float *buf = (float*)malloc(src_width*(src_height + (viewport_offset))*sizeof(float));
if (src_format != GR_LFBWRITEMODE_ZA16) if (src_format != GR_LFBWRITEMODE_ZA16)
display_warning("unknown depth buffer write format:%x", src_format); WriteTrace(TraceGlitch, TraceWarning, "unknown depth buffer write format:%x", src_format);
if (dst_x || dst_y) if (dst_x || dst_y)
display_warning("dst_x:%d, dst_y:%d\n", dst_x, dst_y); WriteTrace(TraceGlitch, TraceWarning, "dst_x:%d, dst_y:%d\n", dst_x, dst_y);
for (j = 0; j < src_height; j++) for (j = 0; j < src_height; j++)
{ {
@ -2708,14 +2692,14 @@ grQueryResolutions(const GrResolution *resTemplate, GrResolution *output)
int i; int i;
int n = 0; int n = 0;
WriteTrace(TraceGlitch, TraceDebug, "-"); WriteTrace(TraceGlitch, TraceDebug, "-");
display_warning("grQueryResolutions"); WriteTrace(TraceGlitch, TraceWarning, "grQueryResolutions");
if ((unsigned int)resTemplate->resolution != GR_QUERY_ANY) if ((unsigned int)resTemplate->resolution != GR_QUERY_ANY)
{ {
res_inf = res_sup = resTemplate->resolution; res_inf = res_sup = resTemplate->resolution;
} }
if ((unsigned int)resTemplate->refresh == GR_QUERY_ANY) display_warning("querying any refresh rate"); if ((unsigned int)resTemplate->refresh == GR_QUERY_ANY) WriteTrace(TraceGlitch, TraceWarning, "querying any refresh rate");
if ((unsigned int)resTemplate->numAuxBuffers == GR_QUERY_ANY) display_warning("querying any numAuxBuffers"); if ((unsigned int)resTemplate->numAuxBuffers == GR_QUERY_ANY) WriteTrace(TraceGlitch, TraceWarning, "querying any numAuxBuffers");
if ((unsigned int)resTemplate->numColorBuffers == GR_QUERY_ANY) display_warning("querying any numColorBuffers"); if ((unsigned int)resTemplate->numColorBuffers == GR_QUERY_ANY) WriteTrace(TraceGlitch, TraceWarning, "querying any numColorBuffers");
if (output == NULL) return res_sup - res_inf + 1; if (output == NULL) return res_sup - res_inf + 1;
for (i = res_inf; i <= res_sup; i++) for (i = res_inf; i <= res_sup; i++)
@ -2732,7 +2716,7 @@ grQueryResolutions(const GrResolution *resTemplate, GrResolution *output)
FX_ENTRY FxBool FX_CALL FX_ENTRY FxBool FX_CALL
grReset(FxU32 /*what*/) grReset(FxU32 /*what*/)
{ {
display_warning("grReset"); WriteTrace(TraceGlitch, TraceWarning, "grReset");
return 1; return 1;
} }
@ -2755,13 +2739,13 @@ grDisable(GrEnableMode_t mode)
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grDisableAllEffects(void) grDisableAllEffects(void)
{ {
display_warning("grDisableAllEffects"); WriteTrace(TraceGlitch, TraceWarning, "grDisableAllEffects");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grErrorSetCallback(GrErrorCallbackFnc_t /*fnc*/) grErrorSetCallback(GrErrorCallbackFnc_t /*fnc*/)
{ {
display_warning("grErrorSetCallback"); WriteTrace(TraceGlitch, TraceWarning, "grErrorSetCallback");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
@ -2782,7 +2766,7 @@ FX_ENTRY void FX_CALL
grTexMultibase(GrChipID_t /*tmu*/, grTexMultibase(GrChipID_t /*tmu*/,
FxBool /*enable*/) FxBool /*enable*/)
{ {
display_warning("grTexMultibase"); WriteTrace(TraceGlitch, TraceWarning, "grTexMultibase");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
@ -2790,7 +2774,7 @@ grTexMipMapMode(GrChipID_t /*tmu*/,
GrMipMapMode_t /*mode*/, GrMipMapMode_t /*mode*/,
FxBool /*lodBlend*/) FxBool /*lodBlend*/)
{ {
display_warning("grTexMipMapMode"); WriteTrace(TraceGlitch, TraceWarning, "grTexMipMapMode");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
@ -2799,14 +2783,14 @@ void * /*data*/,
int /*start*/, int /*start*/,
int /*end*/) int /*end*/)
{ {
display_warning("grTexDownloadTablePartial"); WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTablePartial");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grTexDownloadTable(GrTexTable_t /*type*/, grTexDownloadTable(GrTexTable_t /*type*/,
void * /*data*/) void * /*data*/)
{ {
display_warning("grTexDownloadTable"); WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTable");
} }
FX_ENTRY FxBool FX_CALL FX_ENTRY FxBool FX_CALL
@ -2821,7 +2805,7 @@ void * /*data*/,
int /*start*/, int /*start*/,
int /*end*/) int /*end*/)
{ {
display_warning("grTexDownloadMipMapLevelPartial"); WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevelPartial");
return 1; return 1;
} }
@ -2835,37 +2819,37 @@ GrTextureFormat_t /*format*/,
FxU32 /*evenOdd*/, FxU32 /*evenOdd*/,
void * /*data*/) void * /*data*/)
{ {
display_warning("grTexDownloadMipMapLevel"); WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevel");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grTexNCCTable(GrNCCTable_t /*table*/) grTexNCCTable(GrNCCTable_t /*table*/)
{ {
display_warning("grTexNCCTable"); WriteTrace(TraceGlitch, TraceWarning, "grTexNCCTable");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grViewport(FxI32 /*x*/, FxI32 /*y*/, FxI32 /*width*/, FxI32 /*height*/) grViewport(FxI32 /*x*/, FxI32 /*y*/, FxI32 /*width*/, FxI32 /*height*/)
{ {
display_warning("grViewport"); WriteTrace(TraceGlitch, TraceWarning, "grViewport");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grDepthRange(FxFloat /*n*/, FxFloat /*f*/) grDepthRange(FxFloat /*n*/, FxFloat /*f*/)
{ {
display_warning("grDepthRange"); WriteTrace(TraceGlitch, TraceWarning, "grDepthRange");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grSplash(float /*x*/, float /*y*/, float /*width*/, float /*height*/, FxU32 /*frame*/) grSplash(float /*x*/, float /*y*/, float /*width*/, float /*height*/, FxU32 /*frame*/)
{ {
display_warning("grSplash"); WriteTrace(TraceGlitch, TraceWarning, "grSplash");
} }
FX_ENTRY FxBool FX_CALL FX_ENTRY FxBool FX_CALL
grSelectContext(GrContext_t /*context*/) grSelectContext(GrContext_t /*context*/)
{ {
display_warning("grSelectContext"); WriteTrace(TraceGlitch, TraceWarning, "grSelectContext");
return 1; return 1;
} }
@ -2875,61 +2859,61 @@ const void * /*a*/, const void * /*b*/, const void * /*c*/,
FxBool /*ab_antialias*/, FxBool /*bc_antialias*/, FxBool /*ca_antialias*/ FxBool /*ab_antialias*/, FxBool /*bc_antialias*/, FxBool /*ca_antialias*/
) )
{ {
display_warning("grAADrawTriangle"); WriteTrace(TraceGlitch, TraceWarning, "grAADrawTriangle");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grAlphaControlsITRGBLighting(FxBool /*enable*/) grAlphaControlsITRGBLighting(FxBool /*enable*/)
{ {
display_warning("grAlphaControlsITRGBLighting"); WriteTrace(TraceGlitch, TraceWarning, "grAlphaControlsITRGBLighting");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grGlideSetVertexLayout(const void * /*layout*/) grGlideSetVertexLayout(const void * /*layout*/)
{ {
display_warning("grGlideSetVertexLayout"); WriteTrace(TraceGlitch, TraceWarning, "grGlideSetVertexLayout");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grGlideGetVertexLayout(void * /*layout*/) grGlideGetVertexLayout(void * /*layout*/)
{ {
display_warning("grGlideGetVertexLayout"); WriteTrace(TraceGlitch, TraceWarning, "grGlideGetVertexLayout");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grGlideSetState(const void * /*state*/) grGlideSetState(const void * /*state*/)
{ {
display_warning("grGlideSetState"); WriteTrace(TraceGlitch, TraceWarning, "grGlideSetState");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grGlideGetState(void * /*state*/) grGlideGetState(void * /*state*/)
{ {
display_warning("grGlideGetState"); WriteTrace(TraceGlitch, TraceWarning, "grGlideGetState");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grLfbWriteColorFormat(GrColorFormat_t /*colorFormat*/) grLfbWriteColorFormat(GrColorFormat_t /*colorFormat*/)
{ {
display_warning("grLfbWriteColorFormat"); WriteTrace(TraceGlitch, TraceWarning, "grLfbWriteColorFormat");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grLfbWriteColorSwizzle(FxBool /*swizzleBytes*/, FxBool /*swapWords*/) grLfbWriteColorSwizzle(FxBool /*swizzleBytes*/, FxBool /*swapWords*/)
{ {
display_warning("grLfbWriteColorSwizzle"); WriteTrace(TraceGlitch, TraceWarning, "grLfbWriteColorSwizzle");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grLfbConstantDepth(FxU32 /*depth*/) grLfbConstantDepth(FxU32 /*depth*/)
{ {
display_warning("grLfbConstantDepth"); WriteTrace(TraceGlitch, TraceWarning, "grLfbConstantDepth");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grLfbConstantAlpha(GrAlpha_t /*alpha*/) grLfbConstantAlpha(GrAlpha_t /*alpha*/)
{ {
display_warning("grLfbConstantAlpha"); WriteTrace(TraceGlitch, TraceWarning, "grLfbConstantAlpha");
} }
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
@ -2939,7 +2923,7 @@ FxU32 /*startAddress*/,
FxU32 /*evenOdd*/, FxU32 /*evenOdd*/,
GrTexInfo * /*info*/) GrTexInfo * /*info*/)
{ {
display_warning("grTexMultibaseAddress"); WriteTrace(TraceGlitch, TraceWarning, "grTexMultibaseAddress");
} }
inline void MySleep(FxU32 ms) inline void MySleep(FxU32 ms)
@ -3032,27 +3016,27 @@ guGammaCorrectionRGB(FxFloat gammaR, FxFloat gammaG, FxFloat gammaB)
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grDitherMode(GrDitherMode_t /*mode*/) grDitherMode(GrDitherMode_t /*mode*/)
{ {
display_warning("grDitherMode"); WriteTrace(TraceGlitch, TraceWarning, "grDitherMode");
} }
void grChromaRangeExt(GrColor_t /*color0*/, GrColor_t /*color1*/, FxU32 /*mode*/) void grChromaRangeExt(GrColor_t /*color0*/, GrColor_t /*color1*/, FxU32 /*mode*/)
{ {
display_warning("grChromaRangeExt"); WriteTrace(TraceGlitch, TraceWarning, "grChromaRangeExt");
} }
void grChromaRangeModeExt(GrChromakeyMode_t /*mode*/) void grChromaRangeModeExt(GrChromakeyMode_t /*mode*/)
{ {
display_warning("grChromaRangeModeExt"); WriteTrace(TraceGlitch, TraceWarning, "grChromaRangeModeExt");
} }
void grTexChromaRangeExt(GrChipID_t /*tmu*/, GrColor_t /*color0*/, GrColor_t /*color1*/, GrTexChromakeyMode_t /*mode*/) void grTexChromaRangeExt(GrChipID_t /*tmu*/, GrColor_t /*color0*/, GrColor_t /*color1*/, GrTexChromakeyMode_t /*mode*/)
{ {
display_warning("grTexChromaRangeExt"); WriteTrace(TraceGlitch, TraceWarning, "grTexChromaRangeExt");
} }
void grTexChromaModeExt(GrChipID_t /*tmu*/, GrChromakeyMode_t /*mode*/) void grTexChromaModeExt(GrChipID_t /*tmu*/, GrChromakeyMode_t /*mode*/)
{ {
display_warning("grTexChromaRangeModeExt"); WriteTrace(TraceGlitch, TraceWarning, "grTexChromaRangeModeExt");
} }
static const char * GL_errors[7 + 1] = { static const char * GL_errors[7 + 1] = {

View File

@ -164,7 +164,7 @@ GrTexInfo *info)
{ {
WriteTrace(TraceGlitch, TraceDebug, "evenOdd = %d", evenOdd); WriteTrace(TraceGlitch, TraceDebug, "evenOdd = %d", evenOdd);
int width, height; int width, height;
if (info->largeLodLog2 != info->smallLodLog2) display_warning("grTexTextureMemRequired : loading more than one LOD"); if (info->largeLodLog2 != info->smallLodLog2) WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : loading more than one LOD");
if (info->aspectRatioLog2 < 0) if (info->aspectRatioLog2 < 0)
{ {
@ -202,7 +202,7 @@ GrTexInfo *info)
case GR_TEXFMT_ARGB_CMP_FXT1: case GR_TEXFMT_ARGB_CMP_FXT1:
return ((((width + 0x7)&~0x7)*((height + 0x3)&~0x3)) >> 1); return ((((width + 0x7)&~0x7)*((height + 0x3)&~0x3)) >> 1);
default: default:
display_warning("grTexTextureMemRequired : unknown texture format: %x", info->format); WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : unknown texture format: %x", info->format);
} }
return 0; return 0;
} }
@ -214,7 +214,7 @@ GrAspectRatio_t aspect, GrTextureFormat_t fmt)
{ {
WriteTrace(TraceGlitch, TraceDebug, "lodmin = %d, lodmax: %d aspect: %d fmt: %d", lodmin, lodmax, aspect, fmt); WriteTrace(TraceGlitch, TraceDebug, "lodmin = %d, lodmax: %d aspect: %d fmt: %d", lodmin, lodmax, aspect, fmt);
int width, height; int width, height;
if (lodmax != lodmin) display_warning("grTexCalcMemRequired : loading more than one LOD"); if (lodmax != lodmin) WriteTrace(TraceGlitch, TraceWarning, "grTexCalcMemRequired : loading more than one LOD");
if (aspect < 0) if (aspect < 0)
{ {
@ -252,7 +252,7 @@ GrAspectRatio_t aspect, GrTextureFormat_t fmt)
case GR_TEXFMT_ARGB_CMP_FXT1: case GR_TEXFMT_ARGB_CMP_FXT1:
return ((((width + 0x7)&~0x7)*((height + 0x3)&~0x3)) >> 1); return ((((width + 0x7)&~0x7)*((height + 0x3)&~0x3)) >> 1);
default: default:
display_warning("grTexTextureMemRequired : unknown texture format: %x", fmt); WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : unknown texture format: %x", fmt);
} }
return 0; return 0;
} }
@ -296,7 +296,7 @@ int grTexFormatSize(int fmt)
factor = 8; factor = 8;
break; break;
default: default:
display_warning("grTexFormatSize : unknown texture format: %x", fmt); WriteTrace(TraceGlitch, TraceWarning, "grTexFormatSize : unknown texture format: %x", fmt);
} }
return factor; return factor;
} }
@ -377,7 +377,7 @@ int grTexFormat2GLPackedFmt(int fmt, int * gltexfmt, int * glpixfmt, int * glpac
*glpackfmt = GL_COMPRESSED_RGBA_FXT1_3DFX; // XXX: what should we do about GL_COMPRESSED_RGB_FXT1_3DFX? *glpackfmt = GL_COMPRESSED_RGBA_FXT1_3DFX; // XXX: what should we do about GL_COMPRESSED_RGB_FXT1_3DFX?
break; break;
default: default:
display_warning("grTexFormat2GLPackedFmt : unknown texture format: %x", fmt); WriteTrace(TraceGlitch, TraceWarning, "grTexFormat2GLPackedFmt : unknown texture format: %x", fmt);
} }
return factor; return factor;
} }
@ -394,7 +394,7 @@ GrTexInfo *info)
int factor; int factor;
int glformat = 0; int glformat = 0;
int gltexfmt = 0, glpixfmt = 0, glpackfmt = 0; int gltexfmt = 0, glpixfmt = 0, glpackfmt = 0;
if (info->largeLodLog2 != info->smallLodLog2) display_warning("grTexDownloadMipMap : loading more than one LOD"); if (info->largeLodLog2 != info->smallLodLog2) WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMap : loading more than one LOD");
if (info->aspectRatioLog2 < 0) if (info->aspectRatioLog2 < 0)
{ {
@ -595,7 +595,7 @@ GrTexInfo *info)
glformat = GL_COMPRESSED_RGBA_FXT1_3DFX; glformat = GL_COMPRESSED_RGBA_FXT1_3DFX;
break; break;
default: default:
display_warning("grTexDownloadMipMap : unknown texture format: %x", info->format); WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMap : unknown texture format: %x", info->format);
factor = 0; factor = 0;
} }
} }
@ -740,14 +740,14 @@ float detail_max
{ {
if (!lod_bias && !detail_scale && !detail_max) return; if (!lod_bias && !detail_scale && !detail_max) return;
else else
display_warning("grTexDetailControl : %d, %d, %f", lod_bias, detail_scale, detail_max); WriteTrace(TraceGlitch, TraceWarning, "grTexDetailControl : %d, %d, %f", lod_bias, detail_scale, detail_max);
} }
lambda = detail_max; lambda = detail_max;
if (lambda > 1.0f) if (lambda > 1.0f)
{ {
lambda = 1.0f - (255.0f - lambda); lambda = 1.0f - (255.0f - lambda);
} }
if (lambda > 1.0f) display_warning("lambda:%f", lambda); if (lambda > 1.0f) WriteTrace(TraceGlitch, TraceWarning, "lambda:%f", lambda);
set_lambda(); set_lambda();
} }
@ -817,7 +817,7 @@ GrTextureClampMode_t t_clampmode
wrap_s0 = GL_MIRRORED_REPEAT_ARB; wrap_s0 = GL_MIRRORED_REPEAT_ARB;
break; break;
default: default:
display_warning("grTexClampMode : unknown s_clampmode : %x", s_clampmode); WriteTrace(TraceGlitch, TraceWarning, "grTexClampMode : unknown s_clampmode : %x", s_clampmode);
} }
switch (t_clampmode) switch (t_clampmode)
{ {
@ -831,7 +831,7 @@ GrTextureClampMode_t t_clampmode
wrap_t0 = GL_MIRRORED_REPEAT_ARB; wrap_t0 = GL_MIRRORED_REPEAT_ARB;
break; break;
default: default:
display_warning("grTexClampMode : unknown t_clampmode : %x", t_clampmode); WriteTrace(TraceGlitch, TraceWarning, "grTexClampMode : unknown t_clampmode : %x", t_clampmode);
} }
glActiveTextureARB(GL_TEXTURE0_ARB); glActiveTextureARB(GL_TEXTURE0_ARB);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s0);
@ -851,7 +851,7 @@ GrTextureClampMode_t t_clampmode
wrap_s1 = GL_MIRRORED_REPEAT_ARB; wrap_s1 = GL_MIRRORED_REPEAT_ARB;
break; break;
default: default:
display_warning("grTexClampMode : unknown s_clampmode : %x", s_clampmode); WriteTrace(TraceGlitch, TraceWarning, "grTexClampMode : unknown s_clampmode : %x", s_clampmode);
} }
switch (t_clampmode) switch (t_clampmode)
{ {
@ -865,7 +865,7 @@ GrTextureClampMode_t t_clampmode
wrap_t1 = GL_MIRRORED_REPEAT_ARB; wrap_t1 = GL_MIRRORED_REPEAT_ARB;
break; break;
default: default:
display_warning("grTexClampMode : unknown t_clampmode : %x", t_clampmode); WriteTrace(TraceGlitch, TraceWarning, "grTexClampMode : unknown t_clampmode : %x", t_clampmode);
} }
glActiveTextureARB(GL_TEXTURE1_ARB); glActiveTextureARB(GL_TEXTURE1_ARB);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s1); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s1);

View File

@ -11,6 +11,8 @@ void dump_stop();
extern int dumping; extern int dumping;
#endif #endif
#include <Glide64/trace.h>
#define zscale 1.0f #define zscale 1.0f
typedef struct _wrapper_config typedef struct _wrapper_config
@ -82,8 +84,6 @@ extern "C" {
#endif // _WIN32 #endif // _WIN32
#include "glide.h" #include "glide.h"
void display_warning(const unsigned char *text, ...);
void display_warning(const char *text, ...);
void init_geometry(); void init_geometry();
void init_textures(); void init_textures();
void init_combiner(); void init_combiner();
@ -242,49 +242,52 @@ FX_ENTRY void FX_CALL
grConstantColorValueExt(GrChipID_t tmu, grConstantColorValueExt(GrChipID_t tmu,
GrColor_t value); GrColor_t value);
#define CHECK_FRAMEBUFFER_STATUS() \ static void CHECK_FRAMEBUFFER_STATUS(void)
{\ {
GLenum status; \ GLenum status;
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); \ status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
/*display_warning("%x\n", status);*/\
switch(status) { \ WriteTrace(TraceGlitch, TraceDebug, "status: %X", status);
case GL_FRAMEBUFFER_COMPLETE_EXT: \ switch (status)
/*display_warning("framebuffer complete!\n");*/\ {
break; \ case GL_FRAMEBUFFER_COMPLETE_EXT:
case GL_FRAMEBUFFER_UNSUPPORTED_EXT: \ WriteTrace(TraceGlitch, TraceDebug, "framebuffer complete!");
display_warning("framebuffer GL_FRAMEBUFFER_UNSUPPORTED_EXT\n");\ break;
/* you gotta choose different formats */ \ case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
/*assert(0);*/ \ WriteTrace(TraceGlitch, TraceWarning, "framebuffer GL_FRAMEBUFFER_UNSUPPORTED_EXT");
break; \ /* you gotta choose different formats */
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: \ /*assert(0);*/
display_warning("framebuffer INCOMPLETE_ATTACHMENT\n");\ break;
break; \ case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT: \ WriteTrace(TraceGlitch, TraceWarning, "framebuffer INCOMPLETE_ATTACHMENT");
display_warning("framebuffer FRAMEBUFFER_MISSING_ATTACHMENT\n");\ break;
break; \ case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: \ WriteTrace(TraceGlitch, TraceWarning, "framebuffer FRAMEBUFFER_MISSING_ATTACHMENT");
display_warning("framebuffer FRAMEBUFFER_DIMENSIONS\n");\ break;
break; \ case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
/*case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT: \ WriteTrace(TraceGlitch, TraceWarning, "framebuffer FRAMEBUFFER_DIMENSIONS");
display_warning("framebuffer INCOMPLETE_DUPLICATE_ATTACHMENT\n");\ break;
break;*/ \ /*case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT:
case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT: \ WriteTrace(TraceGlitch, TraceWarning, "framebuffer INCOMPLETE_DUPLICATE_ATTACHMENT");
display_warning("framebuffer INCOMPLETE_FORMATS\n");\ break;*/
break; \ case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT: \ WriteTrace(TraceGlitch, TraceWarning, "framebuffer INCOMPLETE_FORMATS");
display_warning("framebuffer INCOMPLETE_DRAW_BUFFER\n");\ break;
break; \ case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: \ WriteTrace(TraceGlitch, TraceWarning, "framebuffer INCOMPLETE_DRAW_BUFFER");
display_warning("framebuffer INCOMPLETE_READ_BUFFER\n");\ break;
break; \ case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
case GL_FRAMEBUFFER_BINDING_EXT: \ WriteTrace(TraceGlitch, TraceWarning, "framebuffer INCOMPLETE_READ_BUFFER");
display_warning("framebuffer BINDING_EXT\n");\ break;
break; \ case GL_FRAMEBUFFER_BINDING_EXT:
default: \ WriteTrace(TraceGlitch, TraceWarning, "framebuffer BINDING_EXT");
break; \ break;
/* programming error; will fail on all hardware */ \ default:
/*assert(0);*/ \ WriteTrace(TraceGlitch, TraceError, "Unhandled status: %X", status);
}\ break;
/* programming error; will fail on all hardware */
/*assert(0);*/
}
} }
#endif #endif