debug: add CLI option to have multithreaded interpreter

This still allows you to have good stack traces, but is known to cause race conditions with the memory access breakpoints. I also decided against having it be usable via game profiles since a user might think it's a performant enough option.
This commit is contained in:
Crementif 2025-05-04 14:55:54 +02:00
parent fa7ae84314
commit 63f86937b5
3 changed files with 9 additions and 3 deletions

View file

@ -669,9 +669,9 @@ void PPCRecompiler_init()
ppcRecompilerEnabled = false;
return;
}
if (LaunchSettings::ForceInterpreter())
if (LaunchSettings::ForceInterpreter() || LaunchSettings::ForceMultiCoreInterpreter())
{
cemuLog_log(LogType::Force, "Recompiler disabled. Command line --force-interpreter was passed");
cemuLog_log(LogType::Force, "Recompiler disabled. Command line --force-interpreter or force-multicore-interpreter was passed");
return;
}
if (ppcRecompilerInstanceData)

View file

@ -69,7 +69,8 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
("account,a", po::value<std::string>(), "Persistent id of account")
("force-interpreter", po::value<bool>()->implicit_value(true), "Force interpreter CPU emulation, disables recompiler")
("force-interpreter", po::value<bool>()->implicit_value(true), "Force interpreter CPU emulation, disables recompiler. Useful for debugging purposes where you want to get accurate memory accesses and stack traces.")
("force-multicore-interpreter", po::value<bool>()->implicit_value(true), "Force multi-core interpreter CPU emulation, disables recompiler. Only useful for getting stack traces, but slightly faster than the single-core interpreter mode.")
("enable-gdbstub", po::value<bool>()->implicit_value(true), "Enable GDB stub to debug executables inside Cemu using an external debugger");
po::options_description hidden{ "Hidden options" };
@ -177,6 +178,9 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
if(vm.count("force-interpreter"))
s_force_interpreter = vm["force-interpreter"].as<bool>();
if(vm.count("force-multicore-interpreter"))
s_force_multicore_interpreter = vm["force-multicore-interpreter"].as<bool>();
if (vm.count("enable-gdbstub"))
s_enable_gdbstub = vm["enable-gdbstub"].as<bool>();

View file

@ -26,6 +26,7 @@ public:
static bool NSightModeEnabled() { return s_nsight_mode; }
static bool ForceInterpreter() { return s_force_interpreter; };
static bool ForceMultiCoreInterpreter() { return s_force_multicore_interpreter; }
static std::optional<uint32> GetPersistentId() { return s_persistent_id; }
@ -44,6 +45,7 @@ private:
inline static bool s_nsight_mode = false;
inline static bool s_force_interpreter = false;
inline static bool s_force_multicore_interpreter = false;
inline static std::optional<uint32> s_persistent_id{};