diff --git a/rpcs3/Emu/system_config.cpp b/rpcs3/Emu/system_config.cpp index 1136989d31..5ef5aeaa5d 100644 --- a/rpcs3/Emu/system_config.cpp +++ b/rpcs3/Emu/system_config.cpp @@ -1,9 +1,15 @@ #include "stdafx.h" #include "system_config.h" #include "Utilities/StrUtil.h" +#include "Utilities/sysinfo.h" cfg_root g_cfg; +bool cfg_root::node_core::has_rtm() const +{ + return utils::has_rtm(); +} + std::string cfg_root::node_vfs::get(const cfg::string& _cfg, const char* _def) const { auto [spath, sshared] = _cfg.get(); diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h index d4097d036d..b0783eeaca 100644 --- a/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -11,6 +11,11 @@ struct cfg_root : cfg::node { struct node_core : cfg::node { + private: + /** We don't wanna include the sysinfo header here */ + bool has_rtm() const; + + public: static constexpr bool thread_scheduler_enabled_def = #ifdef _WIN32 true; @@ -42,7 +47,7 @@ struct cfg_root : cfg::node cfg::_bool spu_verification{ this, "SPU Verification", true }; // Should be enabled cfg::_bool spu_cache{ this, "SPU Cache", true }; cfg::_bool spu_prof{ this, "SPU Profiler", false }; - cfg::_enum enable_TSX{ this, "Enable TSX", tsx_usage::enabled }; // Enable TSX. Forcing this on Haswell/Broadwell CPUs should be used carefully + cfg::_enum enable_TSX{ this, "Enable TSX", has_rtm() ? tsx_usage::enabled : tsx_usage::disabled }; // Enable TSX. Forcing this on Haswell/Broadwell CPUs should be used carefully cfg::_bool spu_accurate_xfloat{ this, "Accurate xfloat", false }; cfg::_bool spu_approx_xfloat{ this, "Approximate xfloat", true }; cfg::_bool llvm_accurate_dfma{ this, "LLVM Accurate DFMA", true }; // Enable accurate double-precision FMA for CPUs which do not support it natively diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index d62becfe6a..2db9b70178 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -231,6 +231,8 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std ui->enableTSX->setEnabled(false); ui->enableTSX->addItem(tr("Not supported", "Enable TSX")); SubscribeTooltip(ui->enableTSX, tr("Unfortunately your CPU model does not support this instruction set.", "Enable TSX")); + + m_emu_settings->SetSetting(emu_settings_type::EnableTSX, fmt::format("%s", tsx_usage::disabled)); } // PPU tool tips