From 1211a6b62e72f5ba876f33c66f58e17443e6fbb3 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 4 Jul 2021 20:47:04 +0200 Subject: [PATCH] Add AlignmentExceptions setting --- Source/Core/Core/Config/MainSettings.cpp | 1 + Source/Core/Core/Config/MainSettings.h | 1 + Source/Core/Core/ConfigLoaders/NetPlayConfigLoader.cpp | 1 + Source/Core/Core/NetPlayClient.cpp | 1 + Source/Core/Core/NetPlayProto.h | 1 + Source/Core/Core/NetPlayServer.cpp | 2 ++ Source/Core/Core/PowerPC/JitCommon/JitBase.cpp | 2 +- Source/Core/Core/PowerPC/JitCommon/JitBase.h | 2 +- 8 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Config/MainSettings.cpp b/Source/Core/Core/Config/MainSettings.cpp index a45c014262..d36c70401a 100644 --- a/Source/Core/Core/Config/MainSettings.cpp +++ b/Source/Core/Core/Config/MainSettings.cpp @@ -202,6 +202,7 @@ const Info MAIN_LOW_DCBZ_HACK{{System::Main, "Core", "LowDCBZHack"}, false const Info MAIN_FLOAT_EXCEPTIONS{{System::Main, "Core", "FloatExceptions"}, false}; const Info MAIN_DIVIDE_BY_ZERO_EXCEPTIONS{{System::Main, "Core", "DivByZeroExceptions"}, false}; +const Info MAIN_ALIGNMENT_EXCEPTIONS{{System::Main, "Core", "AlignmentExceptions"}, false}; const Info MAIN_FPRF{{System::Main, "Core", "FPRF"}, false}; const Info MAIN_ACCURATE_NANS{{System::Main, "Core", "AccurateNaNs"}, false}; const Info MAIN_DISABLE_ICACHE{{System::Main, "Core", "DisableICache"}, false}; diff --git a/Source/Core/Core/Config/MainSettings.h b/Source/Core/Core/Config/MainSettings.h index d7e78bf6e9..6a72fc1023 100644 --- a/Source/Core/Core/Config/MainSettings.h +++ b/Source/Core/Core/Config/MainSettings.h @@ -119,6 +119,7 @@ extern const Info MAIN_FAST_DISC_SPEED; extern const Info MAIN_LOW_DCBZ_HACK; extern const Info MAIN_FLOAT_EXCEPTIONS; extern const Info MAIN_DIVIDE_BY_ZERO_EXCEPTIONS; +extern const Info MAIN_ALIGNMENT_EXCEPTIONS; extern const Info MAIN_FPRF; extern const Info MAIN_ACCURATE_NANS; extern const Info MAIN_DISABLE_ICACHE; diff --git a/Source/Core/Core/ConfigLoaders/NetPlayConfigLoader.cpp b/Source/Core/Core/ConfigLoaders/NetPlayConfigLoader.cpp index 75b1bda454..5d494733e5 100644 --- a/Source/Core/Core/ConfigLoaders/NetPlayConfigLoader.cpp +++ b/Source/Core/Core/ConfigLoaders/NetPlayConfigLoader.cpp @@ -72,6 +72,7 @@ public: layer->Set(Config::GFX_PERF_QUERIES_ENABLE, m_settings.perf_queries_enable); layer->Set(Config::MAIN_FLOAT_EXCEPTIONS, m_settings.float_exceptions); layer->Set(Config::MAIN_DIVIDE_BY_ZERO_EXCEPTIONS, m_settings.divide_by_zero_exceptions); + layer->Set(Config::MAIN_ALIGNMENT_EXCEPTIONS, m_settings.alignment_exceptions); layer->Set(Config::MAIN_FPRF, m_settings.fprf); layer->Set(Config::MAIN_ACCURATE_NANS, m_settings.accurate_nans); layer->Set(Config::MAIN_DISABLE_ICACHE, m_settings.disable_icache); diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index c40b122a70..49ac1fc082 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -879,6 +879,7 @@ void NetPlayClient::OnStartGame(sf::Packet& packet) packet >> m_net_settings.perf_queries_enable; packet >> m_net_settings.float_exceptions; packet >> m_net_settings.divide_by_zero_exceptions; + packet >> m_net_settings.alignment_exceptions; packet >> m_net_settings.fprf; packet >> m_net_settings.accurate_nans; packet >> m_net_settings.disable_icache; diff --git a/Source/Core/Core/NetPlayProto.h b/Source/Core/Core/NetPlayProto.h index a20aee39ce..bda52a9af5 100644 --- a/Source/Core/Core/NetPlayProto.h +++ b/Source/Core/Core/NetPlayProto.h @@ -63,6 +63,7 @@ struct NetSettings bool perf_queries_enable = false; bool float_exceptions = false; bool divide_by_zero_exceptions = false; + bool alignment_exceptions = false; bool fprf = false; bool accurate_nans = false; bool disable_icache = false; diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index 0705e4d2a7..81650cc9b0 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -1409,6 +1409,7 @@ bool NetPlayServer::SetupNetSettings() settings.perf_queries_enable = Config::Get(Config::GFX_PERF_QUERIES_ENABLE); settings.float_exceptions = Config::Get(Config::MAIN_FLOAT_EXCEPTIONS); settings.divide_by_zero_exceptions = Config::Get(Config::MAIN_DIVIDE_BY_ZERO_EXCEPTIONS); + settings.alignment_exceptions = Config::Get(Config::MAIN_ALIGNMENT_EXCEPTIONS); settings.fprf = Config::Get(Config::MAIN_FPRF); settings.accurate_nans = Config::Get(Config::MAIN_ACCURATE_NANS); settings.disable_icache = Config::Get(Config::MAIN_DISABLE_ICACHE); @@ -1617,6 +1618,7 @@ bool NetPlayServer::StartGame() spac << m_settings.perf_queries_enable; spac << m_settings.float_exceptions; spac << m_settings.divide_by_zero_exceptions; + spac << m_settings.alignment_exceptions; spac << m_settings.fprf; spac << m_settings.accurate_nans; spac << m_settings.disable_icache; diff --git a/Source/Core/Core/PowerPC/JitCommon/JitBase.cpp b/Source/Core/Core/PowerPC/JitCommon/JitBase.cpp index 372a06008c..841fc6a064 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitBase.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitBase.cpp @@ -57,7 +57,7 @@ // After resetting the stack to the top, we call _resetstkoflw() to restore // the guard page at the 256kb mark. -const std::array*>, 23> JitBase::JIT_SETTINGS{{ +const std::array*>, 24> JitBase::JIT_SETTINGS{{ {&JitBase::bJITOff, &Config::MAIN_DEBUG_JIT_OFF}, {&JitBase::bJITLoadStoreOff, &Config::MAIN_DEBUG_JIT_LOAD_STORE_OFF}, {&JitBase::bJITLoadStorelXzOff, &Config::MAIN_DEBUG_JIT_LOAD_STORE_LXZ_OFF}, diff --git a/Source/Core/Core/PowerPC/JitCommon/JitBase.h b/Source/Core/Core/PowerPC/JitCommon/JitBase.h index d90662ffe4..ca27bf2b3f 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitBase.h +++ b/Source/Core/Core/PowerPC/JitCommon/JitBase.h @@ -162,7 +162,7 @@ protected: bool m_cleanup_after_stackfault = false; u8* m_stack_guard = nullptr; - static const std::array*>, 23> JIT_SETTINGS; + static const std::array*>, 24> JIT_SETTINGS; bool DoesConfigNeedRefresh(); void RefreshConfig();