mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-29 23:06:23 -05:00
config: Use simplified checkbox (from Citra) for CPU JIT.
This commit is contained in:
parent
5ecf152c8e
commit
94f4009c3b
8 changed files with 33 additions and 46 deletions
|
@ -148,19 +148,15 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
|
||||||
|
|
||||||
current_process = Kernel::Process::Create("main");
|
current_process = Kernel::Process::Create("main");
|
||||||
|
|
||||||
switch (Settings::values.cpu_core) {
|
if (Settings::values.use_cpu_jit) {
|
||||||
case Settings::CpuCore::Unicorn:
|
|
||||||
cpu_core = std::make_shared<ARM_Unicorn>();
|
|
||||||
break;
|
|
||||||
case Settings::CpuCore::Dynarmic:
|
|
||||||
default:
|
|
||||||
#ifdef ARCHITECTURE_x86_64
|
#ifdef ARCHITECTURE_x86_64
|
||||||
cpu_core = std::make_shared<ARM_Dynarmic>();
|
cpu_core = std::make_shared<ARM_Dynarmic>();
|
||||||
#else
|
#else
|
||||||
cpu_core = std::make_shared<ARM_Unicorn>();
|
cpu_core = std::make_shared<ARM_Unicorn>();
|
||||||
LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available");
|
LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available");
|
||||||
#endif
|
#endif
|
||||||
break;
|
} else {
|
||||||
|
cpu_core = std::make_shared<ARM_Unicorn>();
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu_core = std::make_unique<Tegra::GPU>();
|
gpu_core = std::make_unique<Tegra::GPU>();
|
||||||
|
|
|
@ -121,7 +121,7 @@ struct Values {
|
||||||
std::string touch_device;
|
std::string touch_device;
|
||||||
|
|
||||||
// Core
|
// Core
|
||||||
CpuCore cpu_core;
|
bool use_cpu_jit;
|
||||||
|
|
||||||
// Data Storage
|
// Data Storage
|
||||||
bool use_virtual_sd;
|
bool use_virtual_sd;
|
||||||
|
|
|
@ -154,12 +154,13 @@ TelemetrySession::TelemetrySession() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Log user configuration information
|
// Log user configuration information
|
||||||
AddField(Telemetry::FieldType::UserConfig, "Core_CpuCore",
|
AddField(Telemetry::FieldType::UserConfig, "Core_UseCpuJit", Settings::values.use_cpu_jit);
|
||||||
static_cast<int>(Settings::values.cpu_core));
|
|
||||||
AddField(Telemetry::FieldType::UserConfig, "Renderer_ResolutionFactor",
|
AddField(Telemetry::FieldType::UserConfig, "Renderer_ResolutionFactor",
|
||||||
Settings::values.resolution_factor);
|
Settings::values.resolution_factor);
|
||||||
AddField(Telemetry::FieldType::UserConfig, "Renderer_ToggleFramelimit",
|
AddField(Telemetry::FieldType::UserConfig, "Renderer_ToggleFramelimit",
|
||||||
Settings::values.toggle_framelimit);
|
Settings::values.toggle_framelimit);
|
||||||
|
AddField(Telemetry::FieldType::UserConfig, "System_UseDockedMode",
|
||||||
|
Settings::values.use_docked_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
TelemetrySession::~TelemetrySession() {
|
TelemetrySession::~TelemetrySession() {
|
||||||
|
|
|
@ -77,8 +77,7 @@ void Config::ReadValues() {
|
||||||
qt_config->endGroup();
|
qt_config->endGroup();
|
||||||
|
|
||||||
qt_config->beginGroup("Core");
|
qt_config->beginGroup("Core");
|
||||||
Settings::values.cpu_core =
|
Settings::values.use_cpu_jit = qt_config->value("use_cpu_jit", true).toBool();
|
||||||
static_cast<Settings::CpuCore>(qt_config->value("cpu_core", 1).toInt());
|
|
||||||
qt_config->endGroup();
|
qt_config->endGroup();
|
||||||
|
|
||||||
qt_config->beginGroup("Renderer");
|
qt_config->beginGroup("Renderer");
|
||||||
|
@ -175,7 +174,7 @@ void Config::SaveValues() {
|
||||||
qt_config->endGroup();
|
qt_config->endGroup();
|
||||||
|
|
||||||
qt_config->beginGroup("Core");
|
qt_config->beginGroup("Core");
|
||||||
qt_config->setValue("cpu_core", static_cast<int>(Settings::values.cpu_core));
|
qt_config->setValue("use_cpu_jit", Settings::values.use_cpu_jit);
|
||||||
qt_config->endGroup();
|
qt_config->endGroup();
|
||||||
|
|
||||||
qt_config->beginGroup("Renderer");
|
qt_config->beginGroup("Renderer");
|
||||||
|
|
|
@ -15,7 +15,7 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent)
|
||||||
|
|
||||||
this->setConfiguration();
|
this->setConfiguration();
|
||||||
|
|
||||||
ui->cpu_core_combobox->setEnabled(!Core::System::GetInstance().IsPoweredOn());
|
ui->use_cpu_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn());
|
||||||
ui->use_docked_mode->setEnabled(!Core::System::GetInstance().IsPoweredOn());
|
ui->use_docked_mode->setEnabled(!Core::System::GetInstance().IsPoweredOn());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,15 +24,14 @@ ConfigureGeneral::~ConfigureGeneral() {}
|
||||||
void ConfigureGeneral::setConfiguration() {
|
void ConfigureGeneral::setConfiguration() {
|
||||||
ui->toggle_deepscan->setChecked(UISettings::values.gamedir_deepscan);
|
ui->toggle_deepscan->setChecked(UISettings::values.gamedir_deepscan);
|
||||||
ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing);
|
ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing);
|
||||||
ui->cpu_core_combobox->setCurrentIndex(static_cast<int>(Settings::values.cpu_core));
|
ui->use_cpu_jit->setChecked(Settings::values.use_cpu_jit);
|
||||||
ui->use_docked_mode->setChecked(Settings::values.use_docked_mode);
|
ui->use_docked_mode->setChecked(Settings::values.use_docked_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureGeneral::applyConfiguration() {
|
void ConfigureGeneral::applyConfiguration() {
|
||||||
UISettings::values.gamedir_deepscan = ui->toggle_deepscan->isChecked();
|
UISettings::values.gamedir_deepscan = ui->toggle_deepscan->isChecked();
|
||||||
UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked();
|
UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked();
|
||||||
Settings::values.cpu_core =
|
Settings::values.use_cpu_jit = ui->use_cpu_jit->isChecked();
|
||||||
static_cast<Settings::CpuCore>(ui->cpu_core_combobox->currentIndex());
|
|
||||||
Settings::values.use_docked_mode = ui->use_docked_mode->isChecked();
|
Settings::values.use_docked_mode = ui->use_docked_mode->isChecked();
|
||||||
Settings::Apply();
|
Settings::Apply();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,31 +44,24 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="CpuCoreGroupBox">
|
<widget class="QGroupBox" name="PerformanceGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>CPU Core</string>
|
<string>Performance</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="CpuCoreHorizontalLayout">
|
<layout class="QHBoxLayout" name="PerformanceHorizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="CpuCoreVerticalLayout">
|
<layout class="QVBoxLayout" name="PerformanceVerticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="cpu_core_combobox">
|
<widget class="QCheckBox" name="use_cpu_jit">
|
||||||
<item>
|
<property name="text">
|
||||||
<property name="text">
|
<string>Enable CPU JIT</string>
|
||||||
<string>Unicorn</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Dynarmic</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="EmulationGroupBox">
|
<widget class="QGroupBox" name="EmulationGroupBox">
|
||||||
|
|
|
@ -90,8 +90,7 @@ void Config::ReadValues() {
|
||||||
sdl2_config->Get("Controls", "touch_device", "engine:emu_window");
|
sdl2_config->Get("Controls", "touch_device", "engine:emu_window");
|
||||||
|
|
||||||
// Core
|
// Core
|
||||||
Settings::values.cpu_core =
|
Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true);
|
||||||
static_cast<Settings::CpuCore>(sdl2_config->GetInteger("Core", "cpu_core", 1));
|
|
||||||
|
|
||||||
// Renderer
|
// Renderer
|
||||||
Settings::values.resolution_factor =
|
Settings::values.resolution_factor =
|
||||||
|
|
|
@ -76,9 +76,9 @@ motion_device=
|
||||||
touch_device=
|
touch_device=
|
||||||
|
|
||||||
[Core]
|
[Core]
|
||||||
# Which CPU core to use for CPU emulation
|
# Whether to use the Just-In-Time (JIT) compiler for CPU emulation
|
||||||
# 0: Unicorn (slow), 1 (default): Dynarmic (faster)
|
# 0: Interpreter (slow), 1 (default): JIT (fast)
|
||||||
cpu_core =
|
use_cpu_jit =
|
||||||
|
|
||||||
[Renderer]
|
[Renderer]
|
||||||
# Whether to use software or hardware rendering.
|
# Whether to use software or hardware rendering.
|
||||||
|
|
Loading…
Reference in a new issue