From 4ca6ea5657cda6099e821a11bdfe7cd8a087f64b Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 11 Aug 2017 08:36:26 +1000 Subject: [PATCH] [Video] Remove gfxGet --- Source/Project64-video/Main.cpp | 4 +- .../Renderer/OGLESglitchmain.cpp | 104 --------------- .../Renderer/OGLglitchmain.cpp | 118 +----------------- Source/Project64-video/Renderer/Renderer.h | 1 - 4 files changed, 3 insertions(+), 224 deletions(-) diff --git a/Source/Project64-video/Main.cpp b/Source/Project64-video/Main.cpp index 14eb16c95..f94d68bb0 100644 --- a/Source/Project64-video/Main.cpp +++ b/Source/Project64-video/Main.cpp @@ -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(); diff --git a/Source/Project64-video/Renderer/OGLESglitchmain.cpp b/Source/Project64-video/Renderer/OGLESglitchmain.cpp index 69029474c..c72cdcc1c 100644 --- a/Source/Project64-video/Renderer/OGLESglitchmain.cpp +++ b/Source/Project64-video/Renderer/OGLESglitchmain.cpp @@ -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, diff --git a/Source/Project64-video/Renderer/OGLglitchmain.cpp b/Source/Project64-video/Renderer/OGLglitchmain.cpp index 842e4e3f3..7de7e4eaa 100644 --- a/Source/Project64-video/Renderer/OGLglitchmain.cpp +++ b/Source/Project64-video/Renderer/OGLglitchmain.cpp @@ -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) { diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index 8496521ec..71b12edf0 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -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);