diff --git a/Source/Glide64/Config.cpp b/Source/Glide64/Config.cpp index 88a3dc235..5bfddc7e5 100644 --- a/Source/Glide64/Config.cpp +++ b/Source/Glide64/Config.cpp @@ -662,7 +662,7 @@ public: 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]"); - 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) { m_cbxHrsAltCRC.EnableWindow(false); @@ -698,7 +698,7 @@ public: g_settings->SetGhqHirsTile(m_cbxHrsTile.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_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->SetGhqHirsGz(m_cbxHrsCompressCache.GetCheck() == BST_CHECKED); g_settings->ghq_hirs_let_texartists_fly = (int)m_cbxHrsLetFly.GetCheck() == BST_CHECKED; diff --git a/Source/Glide64/Settings.cpp b/Source/Glide64/Settings.cpp index c3b53225a..067e408e1 100644 --- a/Source/Glide64/Settings.cpp +++ b/Source/Glide64/Settings.cpp @@ -48,7 +48,7 @@ CSettings::CSettings() : m_ghq_hirs_tile(false), m_ghq_hirs_f16bpp(false), m_ghq_hirs_gz(false), -ghq_hirs_altcrc(0), + m_ghq_hirs_altcrc(false), ghq_cache_save(0), ghq_cache_size(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_f16bpp, "ghq_hirs_f16bpp", false); 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_size, "ghq_cache_size", 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) { 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_f16bpp = GetSetting(Set_ghq_hirs_f16bpp) != 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_size = GetSetting(Set_ghq_cache_size); 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_f16bpp, m_ghq_hirs_f16bpp); 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_size, g_settings->ghq_cache_size); SetSetting(Set_ghq_hirs_let_texartists_fly, g_settings->ghq_hirs_let_texartists_fly); diff --git a/Source/Glide64/Settings.h b/Source/Glide64/Settings.h index 5dfa060f2..1ea62ef9d 100644 --- a/Source/Glide64/Settings.h +++ b/Source/Glide64/Settings.h @@ -215,7 +215,7 @@ public: 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_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_size; int ghq_hirs_let_texartists_fly; @@ -281,6 +281,7 @@ public: void SetGhqHirsF16bpp(bool value); void SetGhqEnhtNobg(bool value); void SetGhqEnhtCmpr(bool value); + void SetGhqHirsAltcrc(bool value); void SetGhqHirsCmpr(bool value); void SetGhqHirsGz(bool value); void UpdateFrameBufferBits(uint32_t BitsToAdd, uint32_t BitsToRemove); @@ -335,6 +336,7 @@ private: bool m_ghq_hirs_tile; bool m_ghq_hirs_f16bpp; bool m_ghq_hirs_gz; + bool m_ghq_hirs_altcrc; ucode_t m_ucode; StippleMode_t m_stipple_mode; hacks_t m_hacks; diff --git a/Source/Glide64/TexCache.cpp b/Source/Glide64/TexCache.cpp index b4288e094..e152a7f67 100644 --- a/Source/Glide64/TexCache.cpp +++ b/Source/Glide64/TexCache.cpp @@ -1299,7 +1299,7 @@ void LoadTex(int id, int tmu) { if (rdp.tiles[td].size == 1) 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)); else paladdr = (uint8_t*)(rdp.pal_8_rice + (rdp.tiles[td].palette << 4));