[Glide64] Remove TEXTURE_FILTER check

This commit is contained in:
zilmar 2017-01-24 08:41:20 +11:00
parent 4305890799
commit 2ed3a57917
7 changed files with 1 additions and 65 deletions

View File

@ -105,7 +105,6 @@ void ConfigCleanup(void)
void CloseConfig(); void CloseConfig();
#ifdef TEXTURE_FILTER
uint32_t texfltr[] = uint32_t texfltr[] =
{ {
NO_FILTER, //"None" NO_FILTER, //"None"
@ -145,7 +144,6 @@ uint32_t texhirs[] =
// GHQ_HIRESTEXTURES, //"GlideHQ format" // GHQ_HIRESTEXTURES, //"GlideHQ format"
// JABO_HIRESTEXTURES, //"Jabo format" // JABO_HIRESTEXTURES, //"Jabo format"
}; };
#endif
#ifdef _WIN32 #ifdef _WIN32
@ -870,13 +868,11 @@ void CALL DllConfig(HWND hParent)
ReleaseGfx(); ReleaseGfx();
rdp_reset(); rdp_reset();
} }
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
if (g_settings->ghq_use) if (g_settings->ghq_use)
{ {
ext_ghq_shutdown(); ext_ghq_shutdown();
g_settings->ghq_use = 0; g_settings->ghq_use = 0;
} }
#endif
} }
else else
{ {

View File

@ -60,10 +60,8 @@
#include "DepthBufferRender.h" #include "DepthBufferRender.h"
#include "trace.h" #include "trace.h"
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
#include <stdarg.h> #include <stdarg.h>
int ghq_dmptex_toggle_key = 0; int ghq_dmptex_toggle_key = 0;
#endif
GFX_INFO gfx; GFX_INFO gfx;
@ -406,7 +404,6 @@ void guLoadTextures()
free(cursorTex.data); free(cursorTex.data);
} }
#ifdef TEXTURE_FILTER
void DisplayLoadProgress(const wchar_t *format, ...) void DisplayLoadProgress(const wchar_t *format, ...)
{ {
va_list args; va_list args;
@ -431,7 +428,6 @@ void DisplayLoadProgress(const wchar_t *format, ...)
grColorMask(FXTRUE, FXTRUE); grColorMask(FXTRUE, FXTRUE);
grBufferClear(0, 0, 0xFFFF); grBufferClear(0, 0, 0xFFFF);
} }
#endif
int InitGfx() int InitGfx()
{ {
@ -660,7 +656,6 @@ int InitGfx()
grClipWindow(0, 0, g_settings->scr_res_x, g_settings->scr_res_y); grClipWindow(0, 0, g_settings->scr_res_x, g_settings->scr_res_y);
rdp.update |= UPDATE_SCISSOR | UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE; rdp.update |= UPDATE_SCISSOR | UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE;
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
if (!g_settings->ghq_use) if (!g_settings->ghq_use)
{ {
g_settings->ghq_use = g_settings->ghq_fltr || g_settings->ghq_enht /*|| g_settings->ghq_cmpr*/ || g_settings->ghq_hirs; g_settings->ghq_use = g_settings->ghq_fltr || g_settings->ghq_enht /*|| g_settings->ghq_cmpr*/ || g_settings->ghq_hirs;
@ -705,7 +700,6 @@ int InitGfx()
} }
if (g_settings->ghq_use && strstr(extensions, "TEXMIRROR")) if (g_settings->ghq_use && strstr(extensions, "TEXMIRROR"))
voodoo.sup_mirroring = 1; voodoo.sup_mirroring = 1;
#endif
return TRUE; return TRUE;
} }
@ -919,15 +913,11 @@ void CALL CloseDLL(void)
{ {
WriteTrace(TraceGlide64, TraceDebug, "-"); WriteTrace(TraceGlide64, TraceDebug, "-");
//CLOSELOG ();
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
if (g_settings->ghq_use) if (g_settings->ghq_use)
{ {
ext_ghq_shutdown(); ext_ghq_shutdown();
g_settings->ghq_use = 0; g_settings->ghq_use = 0;
} }
#endif
if (g_settings) if (g_settings)
{ {

View File

@ -33,7 +33,6 @@ swapmode(0),
lodmode(0), lodmode(0),
aspectmode(0), aspectmode(0),
use_hotkeys(0), use_hotkeys(0),
#ifdef TEXTURE_FILTER
//Texture filtering options //Texture filtering options
texture_dir(""), texture_dir(""),
ghq_fltr(0), ghq_fltr(0),
@ -55,7 +54,6 @@ ghq_cache_save(0),
ghq_cache_size(0), ghq_cache_size(0),
ghq_hirs_let_texartists_fly(0), ghq_hirs_let_texartists_fly(0),
ghq_hirs_dump(0), ghq_hirs_dump(0),
#endif
autodetect_ucode(0), autodetect_ucode(0),
ucode(0), ucode(0),
logging(0), logging(0),
@ -282,7 +280,6 @@ void CSettings::ReadSettings()
this->unk_clear = FALSE; this->unk_clear = FALSE;
#endif #endif
#ifdef TEXTURE_FILTER
char texture_dir[260]; char texture_dir[260];
memset(texture_dir, 0, sizeof(texture_dir)); memset(texture_dir, 0, sizeof(texture_dir));
GetSystemSettingSz(Set_texture_dir, texture_dir, sizeof(texture_dir)); GetSystemSettingSz(Set_texture_dir, texture_dir, sizeof(texture_dir));
@ -305,7 +302,6 @@ void CSettings::ReadSettings()
this->ghq_cache_size = GetSetting(Set_ghq_cache_size); this->ghq_cache_size = GetSetting(Set_ghq_cache_size);
this->ghq_hirs_let_texartists_fly = GetSetting(Set_ghq_hirs_let_texartists_fly); this->ghq_hirs_let_texartists_fly = GetSetting(Set_ghq_hirs_let_texartists_fly);
this->ghq_hirs_dump = GetSetting(Set_ghq_hirs_dump); this->ghq_hirs_dump = GetSetting(Set_ghq_hirs_dump);
#endif
if (Set_log_dir != 0) if (Set_log_dir != 0)
{ {
@ -500,7 +496,6 @@ void WriteSettings(void)
SetSetting(Set_unk_clear, g_settings->unk_clear); SetSetting(Set_unk_clear, g_settings->unk_clear);
#endif //_ENDUSER_RELEASE_ #endif //_ENDUSER_RELEASE_
#ifdef TEXTURE_FILTER
SetSetting(Set_ghq_fltr, g_settings->ghq_fltr); SetSetting(Set_ghq_fltr, g_settings->ghq_fltr);
SetSetting(Set_ghq_cmpr, g_settings->ghq_cmpr); SetSetting(Set_ghq_cmpr, g_settings->ghq_cmpr);
SetSetting(Set_ghq_enht, g_settings->ghq_enht); SetSetting(Set_ghq_enht, g_settings->ghq_enht);
@ -519,7 +514,6 @@ void WriteSettings(void)
SetSetting(Set_ghq_cache_size, g_settings->ghq_cache_size); SetSetting(Set_ghq_cache_size, g_settings->ghq_cache_size);
SetSetting(Set_ghq_hirs_let_texartists_fly, g_settings->ghq_hirs_let_texartists_fly); SetSetting(Set_ghq_hirs_let_texartists_fly, g_settings->ghq_hirs_let_texartists_fly);
SetSetting(Set_ghq_hirs_dump, g_settings->ghq_hirs_dump); SetSetting(Set_ghq_hirs_dump, g_settings->ghq_hirs_dump);
#endif
SetSetting(g_romopen ? Set_filtering : Set_filtering_default, g_settings->filtering); SetSetting(g_romopen ? Set_filtering : Set_filtering_default, g_settings->filtering);
SetSetting(g_romopen ? Set_fog : Set_fog_default, g_settings->fog); SetSetting(g_romopen ? Set_fog : Set_fog_default, g_settings->fog);

View File

@ -61,7 +61,6 @@ public:
inline const char * log_dir(void) const { return m_log_dir; } inline const char * log_dir(void) const { return m_log_dir; }
inline bool FlushLogs(void) const { return m_FlushLogs; } inline bool FlushLogs(void) const { return m_FlushLogs; }
#ifdef TEXTURE_FILTER
//Texture filtering options //Texture filtering options
std::string texture_dir; std::string texture_dir;
int ghq_fltr; int ghq_fltr;
@ -83,7 +82,6 @@ public:
int ghq_cache_size; int ghq_cache_size;
int ghq_hirs_let_texartists_fly; int ghq_hirs_let_texartists_fly;
int ghq_hirs_dump; int ghq_hirs_dump;
#endif
//Debug //Debug
int autodetect_ucode; int autodetect_ucode;

View File

@ -59,9 +59,8 @@ uint8_t *texture_buffer = tex1;
#include "TexMod.h" #include "TexMod.h"
#include "TexModCI.h" #include "TexModCI.h"
#include "CRC.h" #include "CRC.h"
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
extern int ghq_dmptex_toggle_key; extern int ghq_dmptex_toggle_key;
#endif
typedef struct TEXINFO_t { typedef struct TEXINFO_t {
int real_image_width, real_image_height; // FOR ALIGNMENT PURPOSES ONLY!!! int real_image_width, real_image_height; // FOR ALIGNMENT PURPOSES ONLY!!!
@ -72,21 +71,17 @@ typedef struct TEXINFO_t {
uint32_t crc; uint32_t crc;
uint32_t flags; uint32_t flags;
int splits, splitheight; int splits, splitheight;
#ifdef TEXTURE_FILTER
uint64 ricecrc; uint64 ricecrc;
#endif
} TEXINFO; } TEXINFO;
TEXINFO texinfo[2]; TEXINFO texinfo[2];
int tex_found[2][MAX_TMU]; int tex_found[2][MAX_TMU];
#ifdef TEXTURE_FILTER
typedef struct HIRESTEX_t { typedef struct HIRESTEX_t {
int width, height; int width, height;
uint16_t format; uint16_t format;
uint8_t *data; uint8_t *data;
} HIRESTEX; } HIRESTEX;
#endif
//**************************************************************** //****************************************************************
// List functions // List functions
@ -940,7 +935,6 @@ void TexCache()
WriteTrace(TraceRDP, TraceDebug, " | +- TexCache End"); WriteTrace(TraceRDP, TraceDebug, " | +- TexCache End");
} }
#ifdef TEXTURE_FILTER
/** cite from RiceVideo */ /** cite from RiceVideo */
inline uint32_t CalculateDXT(uint32_t txl2words) inline uint32_t CalculateDXT(uint32_t txl2words)
{ {
@ -974,7 +968,6 @@ inline uint32_t ReverseDXT(uint32_t val, uint32_t /*lrs*/, uint32_t width, uint3
return (low + high) / 2; return (low + high) / 2;
} }
/** end RiceVideo cite */ /** end RiceVideo cite */
#endif
//**************************************************************** //****************************************************************
// LoadTex - does the actual texture loading after everything is prepared // LoadTex - does the actual texture loading after everything is prepared
@ -1032,10 +1025,8 @@ void LoadTex(int id, int tmu)
cache->f_mirror_t = FALSE; cache->f_mirror_t = FALSE;
cache->f_wrap_s = FALSE; cache->f_wrap_s = FALSE;
cache->f_wrap_t = FALSE; cache->f_wrap_t = FALSE;
#ifdef TEXTURE_FILTER
cache->is_hires_tex = FALSE; cache->is_hires_tex = FALSE;
cache->ricecrc = texinfo[id].ricecrc; cache->ricecrc = texinfo[id].ricecrc;
#endif
// Add this cache to the list // Add this cache to the list
AddToList(&cachelut[cache->crc >> 16], cache->crc, uintptr_t(cache), tmu, rdp.n_cached[tmu]); AddToList(&cachelut[cache->crc >> 16], cache->crc, uintptr_t(cache), tmu, rdp.n_cached[tmu]);
@ -1261,7 +1252,6 @@ void LoadTex(int id, int tmu)
// when we get passed the texture ram cache and texture buffers for // when we get passed the texture ram cache and texture buffers for
// minimal calculation overhead. // minimal calculation overhead.
// //
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
GHQTexInfo ghqTexInfo; GHQTexInfo ghqTexInfo;
memset(&ghqTexInfo, 0, sizeof(GHQTexInfo)); memset(&ghqTexInfo, 0, sizeof(GHQTexInfo));
uint32_t g64_crc = cache->crc; uint32_t g64_crc = cache->crc;
@ -1337,7 +1327,6 @@ void LoadTex(int id, int tmu)
if (ghqTexInfo.data) if (ghqTexInfo.data)
;//do nothing ;//do nothing
else else
#endif
if (splits > 1) if (splits > 1)
{ {
cache->scale_y = 0.125f; cache->scale_y = 0.125f;
@ -1469,11 +1458,7 @@ void LoadTex(int id, int tmu)
memcpy(rdp.pal_8, tmp_pal, 512); memcpy(rdp.pal_8, tmp_pal, 512);
} }
#ifdef TEXTURE_FILTER
if (mod && !modifyPalette && !ghqTexInfo.data) if (mod && !modifyPalette && !ghqTexInfo.data)
#else
if (mod && !modifyPalette)
#endif
{ {
// Convert the texture to ARGB 4444 // Convert the texture to ARGB 4444
if (LOWORD(result) == GR_TEXFMT_ARGB_1555) if (LOWORD(result) == GR_TEXFMT_ARGB_1555)
@ -1594,7 +1579,6 @@ void LoadTex(int id, int tmu)
if (GfxInitDone) if (GfxInitDone)
{ {
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
if (g_settings->ghq_use) if (g_settings->ghq_use)
{ {
if (!ghqTexInfo.data && ghq_dmptex_toggle_key) { if (!ghqTexInfo.data && ghq_dmptex_toggle_key) {
@ -1753,7 +1737,6 @@ void LoadTex(int id, int tmu)
} }
} }
} }
#endif
// Load the texture into texture memory // Load the texture into texture memory
GrTexInfo *t_info = &cache->t_info; GrTexInfo *t_info = &cache->t_info;

View File

@ -746,13 +746,11 @@ EXPORT void CALL ProcessDList(void)
{ {
ReleaseGfx (); ReleaseGfx ();
rdp_reset(); rdp_reset();
#ifdef TEXTURE_FILTER
if (g_settings->ghq_use) if (g_settings->ghq_use)
{ {
ext_ghq_shutdown(); ext_ghq_shutdown();
g_settings->ghq_use = 0; g_settings->ghq_use = 0;
} }
#endif
} }
if (MessageBox(gfx.hWnd, "The GFX plugin caused an exception and has been disabled.\nWould you like to turn it back on and attempt to continue?","Glide64 Exception", MB_YESNO|MB_ICONEXCLAMATION) == MB_NO) if (MessageBox(gfx.hWnd, "The GFX plugin caused an exception and has been disabled.\nWould you like to turn it back on and attempt to continue?","Glide64 Exception", MB_YESNO|MB_ICONEXCLAMATION) == MB_NO)
{ {
@ -1124,14 +1122,12 @@ static void rdp_texrect()
if (((rdp.cmd0 >> 24) & 0xFF) == 0xE5) //texrectflip if (((rdp.cmd0 >> 24) & 0xFF) == 0xE5) //texrectflip
{ {
#ifdef TEXTURE_FILTER
if (rdp.cur_cache[0]->is_hires_tex) if (rdp.cur_cache[0]->is_hires_tex)
{ {
off_size_x = (float)((lr_y - ul_y) * dsdx); off_size_x = (float)((lr_y - ul_y) * dsdx);
off_size_y = (float)((lr_x - ul_x) * dtdy); off_size_y = (float)((lr_x - ul_x) * dtdy);
} }
else else
#endif
{ {
off_size_x = (lr_y - ul_y - 1) * dsdx; off_size_x = (lr_y - ul_y - 1) * dsdx;
off_size_y = (lr_x - ul_x - 1) * dtdy; off_size_y = (lr_x - ul_x - 1) * dtdy;
@ -1139,14 +1135,12 @@ static void rdp_texrect()
} }
else else
{ {
#ifdef TEXTURE_FILTER
if (rdp.cur_cache[0]->is_hires_tex) if (rdp.cur_cache[0]->is_hires_tex)
{ {
off_size_x = (float)((lr_x - ul_x) * dsdx); off_size_x = (float)((lr_x - ul_x) * dsdx);
off_size_y = (float)((lr_y - ul_y) * dtdy); off_size_y = (float)((lr_y - ul_y) * dtdy);
} }
else else
#endif
{ {
off_size_x = (lr_x - ul_x - 1) * dsdx; off_size_x = (lr_x - ul_x - 1) * dsdx;
off_size_y = (lr_y - ul_y - 1) * dtdy; off_size_y = (lr_y - ul_y - 1) * dtdy;
@ -1564,9 +1558,7 @@ void load_palette(uint32_t addr, uint16_t start, uint16_t count)
WriteTrace(TraceRDP, TraceDebug, "Loading palette... "); WriteTrace(TraceRDP, TraceDebug, "Loading palette... ");
uint16_t *dpal = rdp.pal_8 + start; uint16_t *dpal = rdp.pal_8 + start;
uint16_t end = start + count; uint16_t end = start + count;
#ifdef TEXTURE_FILTER
uint16_t *spal = (uint16_t*)(gfx.RDRAM + (addr & BMASK)); uint16_t *spal = (uint16_t*)(gfx.RDRAM + (addr & BMASK));
#endif
for (uint16_t i = start; i < end; i++) for (uint16_t i = start; i < end; i++)
{ {
@ -1575,12 +1567,10 @@ void load_palette(uint32_t addr, uint16_t start, uint16_t count)
WriteTrace(TraceTLUT, TraceDebug, "%d: %08lx", i, *(uint16_t *)(gfx.RDRAM + (addr ^ 2))); WriteTrace(TraceTLUT, TraceDebug, "%d: %08lx", i, *(uint16_t *)(gfx.RDRAM + (addr ^ 2)));
} }
#ifdef TEXTURE_FILTER
if (g_settings->ghq_hirs) if (g_settings->ghq_hirs)
{ {
memcpy((uint8_t*)(rdp.pal_8_rice + start), spal, count << 1); memcpy((uint8_t*)(rdp.pal_8_rice + start), spal, count << 1);
} }
#endif
start >>= 4; start >>= 4;
end = start + (count >> 4); end = start + (count >> 4);
if (end == start) // it can be if count < 16 if (end == start) // it can be if count < 16
@ -1885,11 +1875,9 @@ static void rdp_loadblock()
rdp.timg.set_by = 0; // load block rdp.timg.set_by = 0; // load block
#ifdef TEXTURE_FILTER
LOAD_TILE_INFO &info = rdp.load_info[rdp.tiles[tile].t_mem]; LOAD_TILE_INFO &info = rdp.load_info[rdp.tiles[tile].t_mem];
info.tile_width = lr_s; info.tile_width = lr_s;
info.dxt = dxt; info.dxt = dxt;
#endif
// do a quick boundary check before copying to eliminate the possibility for exception // do a quick boundary check before copying to eliminate the possibility for exception
if (ul_s >= 512) { if (ul_s >= 512) {
@ -2108,7 +2096,6 @@ static void rdp_loadtile()
uint32_t height = lr_t - ul_t + 1; // get height uint32_t height = lr_t - ul_t + 1; // get height
uint32_t width = lr_s - ul_s + 1; uint32_t width = lr_s - ul_s + 1;
#ifdef TEXTURE_FILTER
LOAD_TILE_INFO &info = rdp.load_info[rdp.tiles[tile].t_mem]; LOAD_TILE_INFO &info = rdp.load_info[rdp.tiles[tile].t_mem];
info.tile_ul_s = ul_s; info.tile_ul_s = ul_s;
info.tile_ul_t = ul_t; info.tile_ul_t = ul_t;
@ -2122,7 +2109,6 @@ static void rdp_loadtile()
} }
info.tex_width = rdp.timg.width; info.tex_width = rdp.timg.width;
info.tex_size = rdp.timg.size; info.tex_size = rdp.timg.size;
#endif
int line_n = rdp.timg.width << rdp.tiles[tile].size >> 1; int line_n = rdp.timg.width << rdp.tiles[tile].size >> 1;
uint32_t offs = ul_t * line_n; uint32_t offs = ul_t * line_n;

View File

@ -47,10 +47,7 @@ extern char out_buf[2048];
extern uint32_t frame_count; // frame counter extern uint32_t frame_count; // frame counter
//GlideHQ support //GlideHQ support
#define TEXTURE_FILTER
#ifdef TEXTURE_FILTER
#include "Ext_TxFilter.h" #include "Ext_TxFilter.h"
#endif
#define MAX_CACHE 1024*4 #define MAX_CACHE 1024*4
#define MAX_TRI_CACHE 768 // this is actually # of vertices, not triangles #define MAX_TRI_CACHE 768 // this is actually # of vertices, not triangles
@ -167,7 +164,6 @@ typedef struct {
uint32_t lr_y; uint32_t lr_y;
} SCISSOR; } SCISSOR;
#ifdef TEXTURE_FILTER
extern uint32_t texfltr[]; extern uint32_t texfltr[];
extern uint32_t texenht[]; extern uint32_t texenht[];
extern uint32_t texcmpr[]; extern uint32_t texcmpr[];
@ -182,7 +178,6 @@ typedef struct {
uint16_t tex_size; uint16_t tex_size;
uint32_t dxt; uint32_t dxt;
} LOAD_TILE_INFO; } LOAD_TILE_INFO;
#endif
enum rdpBitmapType enum rdpBitmapType
{ {
@ -318,10 +313,8 @@ typedef struct {
float c_scl_y; // scale to lower-right center-texel y float c_scl_y; // scale to lower-right center-texel y
uint32_t mod, mod_color, mod_color1, mod_color2, mod_factor; uint32_t mod, mod_color, mod_color1, mod_color2, mod_factor;
#ifdef TEXTURE_FILTER
uint64 ricecrc; uint64 ricecrc;
int is_hires_tex; int is_hires_tex;
#endif
} CACHE_LUT; } CACHE_LUT;
// Lights // Lights
@ -496,9 +489,7 @@ struct RDP_Base{
TILE tiles[8]; // 8 tile descriptors TILE tiles[8]; // 8 tile descriptors
uint8_t tmem[4096]; // 4k tmem uint8_t tmem[4096]; // 4k tmem
uint32_t addr[512]; // 512 addresses (used to determine address loaded from) uint32_t addr[512]; // 512 addresses (used to determine address loaded from)
#ifdef TEXTURE_FILTER
LOAD_TILE_INFO load_info[512]; // 512 addresses. inforamation about tile loading. LOAD_TILE_INFO load_info[512]; // 512 addresses. inforamation about tile loading.
#endif
int cur_tile; // current tile int cur_tile; // current tile
int mipmap_level; int mipmap_level;
@ -519,9 +510,7 @@ struct RDP_Base{
int Persp_en; int Persp_en;
int persp_supported; int persp_supported;
int force_wrap; int force_wrap;
#ifdef TEXTURE_FILTER
uint16_t pal_8_rice[512]; uint16_t pal_8_rice[512];
#endif
// Lighting // Lighting
uint32_t num_lights; uint32_t num_lights;