[Glide64] Make ghq_hirs_altcrc private

This commit is contained in:
zilmar 2017-03-11 07:43:12 +11:00
parent 08e5df4dc6
commit 94b17378d5
4 changed files with 19 additions and 8 deletions

View File

@ -662,7 +662,7 @@ public:
m_cbxHrsAltCRC.Attach(GetDlgItem(IDC_CHK_ALT_CRC)); m_cbxHrsAltCRC.Attach(GetDlgItem(IDC_CHK_ALT_CRC));
TTSetTxt(IDC_CHK_ALT_CRC, "Alternative CRC calculation:\n\nThis option enables emulation of a palette CRC calculation bug in RiceVideo.\nIf some textures are not loaded, try to set this option on/off.\n\n[Recommended: texture pack dependant, mostly on]"); TTSetTxt(IDC_CHK_ALT_CRC, "Alternative CRC calculation:\n\nThis option enables emulation of a palette CRC calculation bug in RiceVideo.\nIf some textures are not loaded, try to set this option on/off.\n\n[Recommended: texture pack dependant, mostly on]");
m_cbxHrsAltCRC.SetCheck(g_settings->ghq_hirs_altcrc > 0 ? BST_CHECKED : BST_UNCHECKED); m_cbxHrsAltCRC.SetCheck(g_settings->ghq_hirs_altcrc() > 0 ? BST_CHECKED : BST_UNCHECKED);
if (g_settings->ghq_hirs_dump) if (g_settings->ghq_hirs_dump)
{ {
m_cbxHrsAltCRC.EnableWindow(false); m_cbxHrsAltCRC.EnableWindow(false);
@ -698,7 +698,7 @@ public:
g_settings->SetGhqHirsTile(m_cbxHrsTile.GetCheck() == BST_CHECKED); g_settings->SetGhqHirsTile(m_cbxHrsTile.GetCheck() == BST_CHECKED);
g_settings->SetGhqHirsF16bpp(m_cbxHrsForce16.GetCheck() == BST_CHECKED); g_settings->SetGhqHirsF16bpp(m_cbxHrsForce16.GetCheck() == BST_CHECKED);
g_settings->ghq_hirs_dump = (int)m_cbxHrsTexEdit.GetCheck() == BST_CHECKED; g_settings->ghq_hirs_dump = (int)m_cbxHrsTexEdit.GetCheck() == BST_CHECKED;
g_settings->ghq_hirs_altcrc = (int)m_cbxHrsAltCRC.GetCheck() == BST_CHECKED; g_settings->SetGhqHirsAltcrc(m_cbxHrsAltCRC.GetCheck() == BST_CHECKED);
g_settings->SetGhqHirsCmpr(m_cbxHrsTexCompression.GetCheck() == BST_CHECKED); g_settings->SetGhqHirsCmpr(m_cbxHrsTexCompression.GetCheck() == BST_CHECKED);
g_settings->SetGhqHirsGz(m_cbxHrsCompressCache.GetCheck() == BST_CHECKED); g_settings->SetGhqHirsGz(m_cbxHrsCompressCache.GetCheck() == BST_CHECKED);
g_settings->ghq_hirs_let_texartists_fly = (int)m_cbxHrsLetFly.GetCheck() == BST_CHECKED; g_settings->ghq_hirs_let_texartists_fly = (int)m_cbxHrsLetFly.GetCheck() == BST_CHECKED;

View File

@ -48,7 +48,7 @@ CSettings::CSettings() :
m_ghq_hirs_tile(false), m_ghq_hirs_tile(false),
m_ghq_hirs_f16bpp(false), m_ghq_hirs_f16bpp(false),
m_ghq_hirs_gz(false), m_ghq_hirs_gz(false),
ghq_hirs_altcrc(0), m_ghq_hirs_altcrc(false),
ghq_cache_save(0), ghq_cache_save(0),
ghq_cache_size(0), ghq_cache_size(0),
ghq_hirs_let_texartists_fly(0), ghq_hirs_let_texartists_fly(0),
@ -147,7 +147,7 @@ void CSettings::RegisterSettings(void)
general_setting(Set_ghq_hirs_tile, "ghq_hirs_tile", false); general_setting(Set_ghq_hirs_tile, "ghq_hirs_tile", false);
general_setting(Set_ghq_hirs_f16bpp, "ghq_hirs_f16bpp", false); general_setting(Set_ghq_hirs_f16bpp, "ghq_hirs_f16bpp", false);
general_setting(Set_ghq_hirs_gz, "ghq_hirs_gz", true); general_setting(Set_ghq_hirs_gz, "ghq_hirs_gz", true);
general_setting(Set_ghq_hirs_altcrc, "ghq_hirs_altcrc", 1); general_setting(Set_ghq_hirs_altcrc, "ghq_hirs_altcrc", true);
general_setting(Set_ghq_cache_save, "ghq_cache_save", 1); general_setting(Set_ghq_cache_save, "ghq_cache_save", 1);
general_setting(Set_ghq_cache_size, "ghq_cache_size", 0); general_setting(Set_ghq_cache_size, "ghq_cache_size", 0);
general_setting(Set_ghq_hirs_let_texartists_fly, "ghq_hirs_let_texartists_fly", 0); general_setting(Set_ghq_hirs_let_texartists_fly, "ghq_hirs_let_texartists_fly", 0);
@ -406,6 +406,15 @@ void CSettings::SetGhqEnhtCmpr(bool value)
} }
} }
void CSettings::SetGhqHirsAltcrc(bool value)
{
if (value != m_ghq_hirs_altcrc)
{
m_ghq_hirs_altcrc = value;
m_dirty = true;
}
}
void CSettings::SetGhqHirsCmpr(bool value) void CSettings::SetGhqHirsCmpr(bool value)
{ {
if (value != m_ghq_hirs_cmpr) if (value != m_ghq_hirs_cmpr)
@ -538,7 +547,7 @@ void CSettings::ReadSettings()
m_ghq_hirs_tile = GetSetting(Set_ghq_hirs_tile) != 0; m_ghq_hirs_tile = GetSetting(Set_ghq_hirs_tile) != 0;
m_ghq_hirs_f16bpp = GetSetting(Set_ghq_hirs_f16bpp) != 0; m_ghq_hirs_f16bpp = GetSetting(Set_ghq_hirs_f16bpp) != 0;
m_ghq_hirs_gz = GetSetting(Set_ghq_hirs_gz) != 0; m_ghq_hirs_gz = GetSetting(Set_ghq_hirs_gz) != 0;
this->ghq_hirs_altcrc = GetSetting(Set_ghq_hirs_altcrc); m_ghq_hirs_altcrc = GetSetting(Set_ghq_hirs_altcrc) != 0;
this->ghq_cache_save = GetSetting(Set_ghq_cache_save); this->ghq_cache_save = GetSetting(Set_ghq_cache_save);
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);
@ -807,7 +816,7 @@ void CSettings::WriteSettings(void)
SetSetting(Set_ghq_hirs_tile, m_ghq_hirs_tile); SetSetting(Set_ghq_hirs_tile, m_ghq_hirs_tile);
SetSetting(Set_ghq_hirs_f16bpp, m_ghq_hirs_f16bpp); SetSetting(Set_ghq_hirs_f16bpp, m_ghq_hirs_f16bpp);
SetSetting(Set_ghq_hirs_gz, m_ghq_hirs_gz); SetSetting(Set_ghq_hirs_gz, m_ghq_hirs_gz);
SetSetting(Set_ghq_hirs_altcrc, g_settings->ghq_hirs_altcrc); SetSetting(Set_ghq_hirs_altcrc, m_ghq_hirs_altcrc);
SetSetting(Set_ghq_cache_save, g_settings->ghq_cache_save); SetSetting(Set_ghq_cache_save, g_settings->ghq_cache_save);
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);

View File

@ -215,7 +215,7 @@ public:
inline bool ghq_hirs_tile(void) const { return m_ghq_hirs_tile; } inline bool ghq_hirs_tile(void) const { return m_ghq_hirs_tile; }
inline bool ghq_hirs_f16bpp(void) const { return m_ghq_hirs_f16bpp; } inline bool ghq_hirs_f16bpp(void) const { return m_ghq_hirs_f16bpp; }
inline bool ghq_hirs_gz(void) const { return m_ghq_hirs_gz; } inline bool ghq_hirs_gz(void) const { return m_ghq_hirs_gz; }
int ghq_hirs_altcrc; inline bool ghq_hirs_altcrc(void) const { return m_ghq_hirs_altcrc; }
int ghq_cache_save; int ghq_cache_save;
int ghq_cache_size; int ghq_cache_size;
int ghq_hirs_let_texartists_fly; int ghq_hirs_let_texartists_fly;
@ -281,6 +281,7 @@ public:
void SetGhqHirsF16bpp(bool value); void SetGhqHirsF16bpp(bool value);
void SetGhqEnhtNobg(bool value); void SetGhqEnhtNobg(bool value);
void SetGhqEnhtCmpr(bool value); void SetGhqEnhtCmpr(bool value);
void SetGhqHirsAltcrc(bool value);
void SetGhqHirsCmpr(bool value); void SetGhqHirsCmpr(bool value);
void SetGhqHirsGz(bool value); void SetGhqHirsGz(bool value);
void UpdateFrameBufferBits(uint32_t BitsToAdd, uint32_t BitsToRemove); void UpdateFrameBufferBits(uint32_t BitsToAdd, uint32_t BitsToRemove);
@ -335,6 +336,7 @@ private:
bool m_ghq_hirs_tile; bool m_ghq_hirs_tile;
bool m_ghq_hirs_f16bpp; bool m_ghq_hirs_f16bpp;
bool m_ghq_hirs_gz; bool m_ghq_hirs_gz;
bool m_ghq_hirs_altcrc;
ucode_t m_ucode; ucode_t m_ucode;
StippleMode_t m_stipple_mode; StippleMode_t m_stipple_mode;
hacks_t m_hacks; hacks_t m_hacks;

View File

@ -1299,7 +1299,7 @@ void LoadTex(int id, int tmu)
{ {
if (rdp.tiles[td].size == 1) if (rdp.tiles[td].size == 1)
paladdr = (uint8_t*)(rdp.pal_8_rice); paladdr = (uint8_t*)(rdp.pal_8_rice);
else if (g_settings->ghq_hirs_altcrc) else if (g_settings->ghq_hirs_altcrc())
paladdr = (uint8_t*)(rdp.pal_8_rice + (rdp.tiles[td].palette << 5)); paladdr = (uint8_t*)(rdp.pal_8_rice + (rdp.tiles[td].palette << 5));
else else
paladdr = (uint8_t*)(rdp.pal_8_rice + (rdp.tiles[td].palette << 4)); paladdr = (uint8_t*)(rdp.pal_8_rice + (rdp.tiles[td].palette << 4));