[Video] Remove gfxGet

This commit is contained in:
zilmar 2017-08-11 08:36:26 +10:00
parent 05a4cce447
commit 4ca6ea5657
4 changed files with 3 additions and 224 deletions

View File

@ -485,7 +485,7 @@ int InitGfx()
to_fullscreen = FALSE;
// get maximal texture size
gfxGet(GR_MAX_TEXTURE_SIZE, 4, (int32_t*)&voodoo.max_tex_size);
voodoo.max_tex_size = 2048;
voodoo.sup_large_tex = (voodoo.max_tex_size > 256 && !g_settings->hacks(CSettings::hack_PPL));
voodoo.tex_min_addr[0] = voodoo.tex_min_addr[1] = gfxTexMinAddress(GFX_TMU0);
@ -499,7 +499,7 @@ int InitGfx()
voodoo.sup_32bit_tex = TRUE;
voodoo.gamma_correction = 0;
gfxGet(GR_GAMMA_TABLE_ENTRIES, sizeof(voodoo.gamma_table_size), &voodoo.gamma_table_size);
voodoo.gamma_table_size = 256;
srand(g_settings->stipple_pattern());
setPattern();

View File

@ -875,110 +875,6 @@ int CheckTextureBufferFormat(gfxChipID_t tmu, uint32_t startAddress, gfxTexInfo
return 0;
}
uint32_t gfxGet(uint32_t pname, uint32_t plength, int32_t *params)
{
WriteTrace(TraceGlitch, TraceDebug, "pname: %d plength: %d", pname, plength);
switch (pname)
{
case GR_MAX_TEXTURE_SIZE:
if (plength < 4 || params == NULL) return 0;
params[0] = 2048;
return 4;
break;
case GR_NUM_TMU:
if (plength < 4 || params == NULL) return 0;
params[0] = 2;
return 4;
break;
case GR_NUM_BOARDS:
case GR_NUM_FB:
case GR_REVISION_FB:
case GR_REVISION_TMU:
if (plength < 4 || params == NULL) return 0;
params[0] = 1;
return 4;
break;
case GR_MEMORY_FB:
if (plength < 4 || params == NULL) return 0;
params[0] = 16 * 1024 * 1024;
return 4;
break;
case GR_MEMORY_TMU:
if (plength < 4 || params == NULL) return 0;
params[0] = 16 * 1024 * 1024;
return 4;
break;
case GR_MEMORY_UMA:
if (plength < 4 || params == NULL) return 0;
params[0] = 16 * 1024 * 1024 * 4;
return 4;
break;
case GR_BITS_RGBA:
if (plength < 16 || params == NULL) return 0;
params[0] = 8;
params[1] = 8;
params[2] = 8;
params[3] = 8;
return 16;
break;
case GR_BITS_DEPTH:
if (plength < 4 || params == NULL) return 0;
params[0] = 16;
return 4;
break;
case GR_BITS_GAMMA:
if (plength < 4 || params == NULL) return 0;
params[0] = 8;
return 4;
break;
case GR_GAMMA_TABLE_ENTRIES:
if (plength < 4 || params == NULL) return 0;
params[0] = 256;
return 4;
break;
case GR_FOG_TABLE_ENTRIES:
if (plength < 4 || params == NULL) return 0;
params[0] = 64;
return 4;
break;
case GR_WDEPTH_MIN_MAX:
if (plength < 8 || params == NULL) return 0;
params[0] = 0;
params[1] = 65528;
return 8;
break;
case GR_ZDEPTH_MIN_MAX:
if (plength < 8 || params == NULL) return 0;
params[0] = 0;
params[1] = 65535;
return 8;
break;
case GR_LFB_PIXEL_PIPE:
if (plength < 4 || params == NULL) return 0;
params[0] = false;
return 4;
break;
case GR_MAX_TEXTURE_ASPECT_RATIO:
if (plength < 4 || params == NULL) return 0;
params[0] = 3;
return 4;
break;
case GR_NON_POWER_OF_TWO_TEXTURES:
if (plength < 4 || params == NULL) return 0;
params[0] = false;
return 4;
break;
case GR_TEXTURE_ALIGN:
if (plength < 4 || params == NULL) return 0;
params[0] = 0;
return 4;
break;
default:
WriteTrace(TraceGlitch, TraceWarning, "unknown pname in gfxGet : %x", pname);
}
return 0;
}
static void render_rectangle(int texture_number,
int dst_x, int dst_y,
int src_width, int src_height,

View File

@ -1179,122 +1179,6 @@ int CheckTextureBufferFormat(gfxChipID_t tmu, uint32_t startAddress, gfxTexInfo
return 0;
}
uint32_t gfxGet(uint32_t pname, uint32_t plength, int32_t *params)
{
WriteTrace(TraceGlitch, TraceDebug, "pname: %d plength: %d", pname, plength);
switch (pname)
{
case GR_MAX_TEXTURE_SIZE:
if (plength < 4 || params == NULL) return 0;
params[0] = 2048;
return 4;
break;
case GR_NUM_TMU:
if (plength < 4 || params == NULL) return 0;
if (!nbTextureUnits)
{
gfxSstWinOpen(GFX_COLORFORMAT_ARGB, GFX_ORIGIN_UPPER_LEFT, 2, 1);
gfxSstWinClose();
}
#ifdef VOODOO1
params[0] = 1;
#else
if (nbTextureUnits > 2)
params[0] = 2;
else
params[0] = 1;
#endif
return 4;
break;
case GR_NUM_BOARDS:
case GR_NUM_FB:
case GR_REVISION_FB:
case GR_REVISION_TMU:
if (plength < 4 || params == NULL) return 0;
params[0] = 1;
return 4;
break;
case GR_MEMORY_FB:
if (plength < 4 || params == NULL) return 0;
params[0] = 16 * 1024 * 1024;
return 4;
break;
case GR_MEMORY_TMU:
if (plength < 4 || params == NULL) return 0;
params[0] = 16 * 1024 * 1024;
return 4;
break;
case GR_MEMORY_UMA:
if (plength < 4 || params == NULL) return 0;
params[0] = 16 * 1024 * 1024 * nbTextureUnits;
return 4;
break;
case GR_BITS_RGBA:
if (plength < 16 || params == NULL) return 0;
params[0] = 8;
params[1] = 8;
params[2] = 8;
params[3] = 8;
return 16;
break;
case GR_BITS_DEPTH:
if (plength < 4 || params == NULL) return 0;
params[0] = 16;
return 4;
break;
case GR_BITS_GAMMA:
if (plength < 4 || params == NULL) return 0;
params[0] = 8;
return 4;
break;
case GR_GAMMA_TABLE_ENTRIES:
if (plength < 4 || params == NULL) return 0;
params[0] = 256;
return 4;
break;
case GR_FOG_TABLE_ENTRIES:
if (plength < 4 || params == NULL) return 0;
params[0] = 64;
return 4;
break;
case GR_WDEPTH_MIN_MAX:
if (plength < 8 || params == NULL) return 0;
params[0] = 0;
params[1] = 65528;
return 8;
break;
case GR_ZDEPTH_MIN_MAX:
if (plength < 8 || params == NULL) return 0;
params[0] = 0;
params[1] = 65535;
return 8;
break;
case GR_LFB_PIXEL_PIPE:
if (plength < 4 || params == NULL) return 0;
params[0] = false;
return 4;
break;
case GR_MAX_TEXTURE_ASPECT_RATIO:
if (plength < 4 || params == NULL) return 0;
params[0] = 3;
return 4;
break;
case GR_NON_POWER_OF_TWO_TEXTURES:
if (plength < 4 || params == NULL) return 0;
params[0] = false;
return 4;
break;
case GR_TEXTURE_ALIGN:
if (plength < 4 || params == NULL) return 0;
params[0] = 0;
return 4;
break;
default:
WriteTrace(TraceGlitch, TraceWarning, "unknown pname in gfxGet : %x", pname);
}
return 0;
}
static void render_rectangle(int texture_number,
int dst_x, int dst_y,
int src_width, int src_height,
@ -1933,7 +1817,7 @@ void gfxGetGammaTableExt(uint32_t /*nentries*/, uint32_t *red, uint32_t *green,
blue[i] = aGammaRamp[2][i] >> 8;
}
}
}
}
void gfxGammaCorrectionRGB(float gammaR, float gammaG, float gammaB)
{

View File

@ -53,7 +53,6 @@ void gfxDrawVertexArrayContiguous(gfxDrawMode_t mode, uint32_t Count, void *poin
bool gfxSstWinOpen(gfxColorFormat_t color_format, gfxOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers);
void gfxAuxBufferExt(gfxBuffer_t buffer);
uint32_t gfxGet(uint32_t pname, uint32_t plength, int32_t *params);
void gfxRenderBuffer(gfxBuffer_t buffer);
void gfxBufferClear(gfxColor_t color, gfxAlpha_t alpha, uint32_t depth);
void gfxBufferSwap(uint32_t swap_interval);