diff --git a/src/duckstation-qt/advancedsettingswidget.cpp b/src/duckstation-qt/advancedsettingswidget.cpp index e1b7e5aec..2b692e0d4 100644 --- a/src/duckstation-qt/advancedsettingswidget.cpp +++ b/src/duckstation-qt/advancedsettingswidget.cpp @@ -225,8 +225,6 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsDialog* dialog, QWidget* Settings::ParseCPUFastmemMode, Settings::GetCPUFastmemModeName, Settings::GetCPUFastmemModeDisplayName, "CPUFastmemMode", static_cast(CPUFastmemMode::Count), Settings::DEFAULT_CPU_FASTMEM_MODE); - addBooleanTweakOption(dialog, m_ui.tweakOptionTable, tr("Enable Recompiler ICache"), "CPU", "RecompilerICache", - false); addBooleanTweakOption(dialog, m_ui.tweakOptionTable, tr("Enable VRAM Write Texture Replacement"), "TextureReplacements", "EnableVRAMWriteReplacements", false); @@ -295,7 +293,6 @@ void AdvancedSettingsWidget::onResetToDefaultClicked() setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Recompiler memory exceptions setBooleanTweakOption(m_ui.tweakOptionTable, i++, true); // Recompiler block linking setChoiceTweakOption(m_ui.tweakOptionTable, i++, Settings::DEFAULT_CPU_FASTMEM_MODE); // Recompiler fastmem mode - setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Recompiler Icache setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // VRAM write texture replacement setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Preload texture replacements setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Dump replacable VRAM writes diff --git a/src/duckstation-qt/consolesettingswidget.cpp b/src/duckstation-qt/consolesettingswidget.cpp index fd7c94934..6daa9f99a 100644 --- a/src/duckstation-qt/consolesettingswidget.cpp +++ b/src/duckstation-qt/consolesettingswidget.cpp @@ -44,6 +44,7 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsDialog* dialog, QWidget* pa &Settings::ParseCPUExecutionMode, &Settings::GetCPUExecutionModeName, Settings::DEFAULT_CPU_EXECUTION_MODE); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableCPUClockSpeedControl, "CPU", "OverclockEnable", false); + SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.recompilerICache, "CPU", "RecompilerICache", false); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.cdromReadaheadSectors, "CDROM", "ReadaheadSectors", Settings::DEFAULT_CDROM_READAHEAD_SECTORS); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.cdromRegionCheck, "CDROM", "RegionCheck", false); @@ -61,6 +62,10 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsDialog* dialog, QWidget* pa tr("When this option is chosen, the clock speed set below will be used.")); dialog->registerWidgetHelp(m_ui.cpuClockSpeed, tr("Overclocking Percentage"), tr("100%"), tr("Selects the percentage of the normal clock speed the emulated hardware will run at.")); + dialog->registerWidgetHelp(m_ui.recompilerICache, tr("Enable Recompiler ICache"), tr("Unchecked"), + tr("Simulates stalls in the recompilers when the emulated CPU would have to fetch " + "instructions into its cache. Makes games run closer to their console framerate, at a " + "small cost to performance. Interpreter mode always simulates the instruction cache.")); dialog->registerWidgetHelp( m_ui.enable8MBRAM, tr("Enable 8MB RAM (Dev Console)"), tr("Unchecked"), tr("Enables an additional 6MB of RAM to obtain a total of 2+6 = 8MB, usually present on dev consoles. Games have " @@ -104,6 +109,18 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsDialog* dialog, QWidget* pa ConsoleSettingsWidget::~ConsoleSettingsWidget() = default; +void ConsoleSettingsWidget::updateRecompilerICacheEnabled() +{ + const CPUExecutionMode mode = + Settings::ParseCPUExecutionMode( + m_dialog + ->getEffectiveStringValue("CPU", "ExecutionMode", + Settings::GetCPUExecutionModeName(Settings::DEFAULT_CPU_EXECUTION_MODE)) + .c_str()) + .value_or(Settings::DEFAULT_CPU_EXECUTION_MODE); + m_ui.recompilerICache->setEnabled(mode != CPUExecutionMode::Interpreter); +} + void ConsoleSettingsWidget::onEnableCPUClockSpeedControlChecked(int state) { if (state == Qt::Checked && @@ -116,7 +133,8 @@ void ConsoleSettingsWidget::onEnableCPUClockSpeedControlChecked(int state) "have confirmed the bug also occurs with overclocking disabled.\n\nThis warning will only be shown once."); QMessageBox mb(QMessageBox::Warning, tr("CPU Overclocking Warning"), message, QMessageBox::NoButton, this); - const QAbstractButton* const yes_button = mb.addButton(tr("Yes, I will confirm bugs without overclocking before reporting."), QMessageBox::YesRole); + const QAbstractButton* const yes_button = + mb.addButton(tr("Yes, I will confirm bugs without overclocking before reporting."), QMessageBox::YesRole); mb.addButton(tr("No, take me back to safety."), QMessageBox::NoRole); mb.exec(); diff --git a/src/duckstation-qt/consolesettingswidget.h b/src/duckstation-qt/consolesettingswidget.h index cde4983a6..0aec29783 100644 --- a/src/duckstation-qt/consolesettingswidget.h +++ b/src/duckstation-qt/consolesettingswidget.h @@ -15,6 +15,7 @@ public: ~ConsoleSettingsWidget(); private Q_SLOTS: + void updateRecompilerICacheEnabled(); void onEnableCPUClockSpeedControlChecked(int state); void onCPUClockSpeedValueChanged(int value); void updateCPUClockSpeedLabel(); diff --git a/src/duckstation-qt/consolesettingswidget.ui b/src/duckstation-qt/consolesettingswidget.ui index f8e9ad790..aa7261ab6 100644 --- a/src/duckstation-qt/consolesettingswidget.ui +++ b/src/duckstation-qt/consolesettingswidget.ui @@ -128,6 +128,13 @@ + + + + Enable Recompiler ICache + + +