diff options
| author | 2020-07-14 12:38:03 -0400 | |
|---|---|---|
| committer | 2020-07-14 12:38:03 -0400 | |
| commit | e2730372b8b26bf3141bf91107f9982e270f751b (patch) | |
| tree | fb09276b0a1a736c6b106f1c6b51af9f97b3c307 | |
| parent | Merge pull request #4282 from Morph1984/fs-size (diff) | |
| parent | configure_cpu: Split optimization settings off into Debug tab (diff) | |
| download | yuzu-e2730372b8b26bf3141bf91107f9982e270f751b.tar.gz yuzu-e2730372b8b26bf3141bf91107f9982e270f751b.tar.xz yuzu-e2730372b8b26bf3141bf91107f9982e270f751b.zip | |
Merge pull request #4294 from MerryMage/cpu-opt-settings
configuration: Add settings to enable/disable specific CPU optimizations
| m--------- | externals/dynarmic | 0 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_32.cpp | 30 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.cpp | 34 | ||||
| -rw-r--r-- | src/core/settings.h | 18 | ||||
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 59 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure.ui | 22 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.cpp | 61 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.h | 33 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.ui | 92 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu_debug.cpp | 65 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu_debug.h | 31 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu_debug.ui | 174 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_debug.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_debug.ui | 7 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_dialog.cpp | 7 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 36 | ||||
| -rw-r--r-- | src/yuzu_tester/default_ini.h | 33 |
20 files changed, 685 insertions, 29 deletions
diff --git a/externals/dynarmic b/externals/dynarmic | |||
| Subproject 4f967387c07365b7ea35d2fa3e19b7df8872a09 | Subproject 82417da7803e2cf18efc28a1cd3f3d0a4b6045a | ||
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 0d4ab95b7..443ca72eb 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp | |||
| @@ -142,10 +142,32 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable& | |||
| 142 | // Timing | 142 | // Timing |
| 143 | config.wall_clock_cntpct = uses_wall_clock; | 143 | config.wall_clock_cntpct = uses_wall_clock; |
| 144 | 144 | ||
| 145 | // Optimizations | 145 | // Safe optimizations |
| 146 | if (Settings::values.disable_cpu_opt) { | 146 | if (Settings::values.cpu_accuracy != Settings::CPUAccuracy::Accurate) { |
| 147 | config.enable_optimizations = false; | 147 | if (!Settings::values.cpuopt_page_tables) { |
| 148 | config.enable_fast_dispatch = false; | 148 | config.page_table = nullptr; |
| 149 | } | ||
| 150 | if (!Settings::values.cpuopt_block_linking) { | ||
| 151 | config.optimizations &= ~Dynarmic::OptimizationFlag::BlockLinking; | ||
| 152 | } | ||
| 153 | if (!Settings::values.cpuopt_return_stack_buffer) { | ||
| 154 | config.optimizations &= ~Dynarmic::OptimizationFlag::ReturnStackBuffer; | ||
| 155 | } | ||
| 156 | if (!Settings::values.cpuopt_fast_dispatcher) { | ||
| 157 | config.optimizations &= ~Dynarmic::OptimizationFlag::FastDispatch; | ||
| 158 | } | ||
| 159 | if (!Settings::values.cpuopt_context_elimination) { | ||
| 160 | config.optimizations &= ~Dynarmic::OptimizationFlag::GetSetElimination; | ||
| 161 | } | ||
| 162 | if (!Settings::values.cpuopt_const_prop) { | ||
| 163 | config.optimizations &= ~Dynarmic::OptimizationFlag::ConstProp; | ||
| 164 | } | ||
| 165 | if (!Settings::values.cpuopt_misc_ir) { | ||
| 166 | config.optimizations &= ~Dynarmic::OptimizationFlag::MiscIROpt; | ||
| 167 | } | ||
| 168 | if (!Settings::values.cpuopt_reduce_misalign_checks) { | ||
| 169 | config.only_detect_misalignment_via_page_table_on_page_boundary = false; | ||
| 170 | } | ||
| 149 | } | 171 | } |
| 150 | 172 | ||
| 151 | return std::make_unique<Dynarmic::A32::Jit>(config); | 173 | return std::make_unique<Dynarmic::A32::Jit>(config); |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 790981034..a63a04a25 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp | |||
| @@ -191,15 +191,37 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable& | |||
| 191 | // Unpredictable instructions | 191 | // Unpredictable instructions |
| 192 | config.define_unpredictable_behaviour = true; | 192 | config.define_unpredictable_behaviour = true; |
| 193 | 193 | ||
| 194 | // Optimizations | ||
| 195 | if (Settings::values.disable_cpu_opt) { | ||
| 196 | config.enable_optimizations = false; | ||
| 197 | config.enable_fast_dispatch = false; | ||
| 198 | } | ||
| 199 | |||
| 200 | // Timing | 194 | // Timing |
| 201 | config.wall_clock_cntpct = uses_wall_clock; | 195 | config.wall_clock_cntpct = uses_wall_clock; |
| 202 | 196 | ||
| 197 | // Safe optimizations | ||
| 198 | if (Settings::values.cpu_accuracy != Settings::CPUAccuracy::Accurate) { | ||
| 199 | if (!Settings::values.cpuopt_page_tables) { | ||
| 200 | config.page_table = nullptr; | ||
| 201 | } | ||
| 202 | if (!Settings::values.cpuopt_block_linking) { | ||
| 203 | config.optimizations &= ~Dynarmic::OptimizationFlag::BlockLinking; | ||
| 204 | } | ||
| 205 | if (!Settings::values.cpuopt_return_stack_buffer) { | ||
| 206 | config.optimizations &= ~Dynarmic::OptimizationFlag::ReturnStackBuffer; | ||
| 207 | } | ||
| 208 | if (!Settings::values.cpuopt_fast_dispatcher) { | ||
| 209 | config.optimizations &= ~Dynarmic::OptimizationFlag::FastDispatch; | ||
| 210 | } | ||
| 211 | if (!Settings::values.cpuopt_context_elimination) { | ||
| 212 | config.optimizations &= ~Dynarmic::OptimizationFlag::GetSetElimination; | ||
| 213 | } | ||
| 214 | if (!Settings::values.cpuopt_const_prop) { | ||
| 215 | config.optimizations &= ~Dynarmic::OptimizationFlag::ConstProp; | ||
| 216 | } | ||
| 217 | if (!Settings::values.cpuopt_misc_ir) { | ||
| 218 | config.optimizations &= ~Dynarmic::OptimizationFlag::MiscIROpt; | ||
| 219 | } | ||
| 220 | if (!Settings::values.cpuopt_reduce_misalign_checks) { | ||
| 221 | config.only_detect_misalignment_via_page_table_on_page_boundary = false; | ||
| 222 | } | ||
| 223 | } | ||
| 224 | |||
| 203 | return std::make_shared<Dynarmic::A64::Jit>(config); | 225 | return std::make_shared<Dynarmic::A64::Jit>(config); |
| 204 | } | 226 | } |
| 205 | 227 | ||
diff --git a/src/core/settings.h b/src/core/settings.h index 29dc57c16..3eb336f75 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -357,6 +357,11 @@ enum class GPUAccuracy : u32 { | |||
| 357 | Extreme = 2, | 357 | Extreme = 2, |
| 358 | }; | 358 | }; |
| 359 | 359 | ||
| 360 | enum class CPUAccuracy { | ||
| 361 | Accurate = 0, | ||
| 362 | DebugMode = 1, | ||
| 363 | }; | ||
| 364 | |||
| 360 | extern bool configuring_global; | 365 | extern bool configuring_global; |
| 361 | 366 | ||
| 362 | template <typename Type> | 367 | template <typename Type> |
| @@ -402,6 +407,18 @@ struct Values { | |||
| 402 | // Core | 407 | // Core |
| 403 | Setting<bool> use_multi_core; | 408 | Setting<bool> use_multi_core; |
| 404 | 409 | ||
| 410 | // Cpu | ||
| 411 | CPUAccuracy cpu_accuracy; | ||
| 412 | |||
| 413 | bool cpuopt_page_tables; | ||
| 414 | bool cpuopt_block_linking; | ||
| 415 | bool cpuopt_return_stack_buffer; | ||
| 416 | bool cpuopt_fast_dispatcher; | ||
| 417 | bool cpuopt_context_elimination; | ||
| 418 | bool cpuopt_const_prop; | ||
| 419 | bool cpuopt_misc_ir; | ||
| 420 | bool cpuopt_reduce_misalign_checks; | ||
| 421 | |||
| 405 | // Renderer | 422 | // Renderer |
| 406 | Setting<RendererBackend> renderer_backend; | 423 | Setting<RendererBackend> renderer_backend; |
| 407 | bool renderer_debug; | 424 | bool renderer_debug; |
| @@ -476,7 +493,6 @@ struct Values { | |||
| 476 | bool dump_nso; | 493 | bool dump_nso; |
| 477 | bool reporting_services; | 494 | bool reporting_services; |
| 478 | bool quest_flag; | 495 | bool quest_flag; |
| 479 | bool disable_cpu_opt; | ||
| 480 | bool disable_macro_jit; | 496 | bool disable_macro_jit; |
| 481 | 497 | ||
| 482 | // Misceallaneous | 498 | // Misceallaneous |
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index ff7d9c1fa..a862b2610 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt | |||
| @@ -30,6 +30,12 @@ add_executable(yuzu | |||
| 30 | configuration/configure_audio.cpp | 30 | configuration/configure_audio.cpp |
| 31 | configuration/configure_audio.h | 31 | configuration/configure_audio.h |
| 32 | configuration/configure_audio.ui | 32 | configuration/configure_audio.ui |
| 33 | configuration/configure_cpu.cpp | ||
| 34 | configuration/configure_cpu.h | ||
| 35 | configuration/configure_cpu.ui | ||
| 36 | configuration/configure_cpu_debug.cpp | ||
| 37 | configuration/configure_cpu_debug.h | ||
| 38 | configuration/configure_cpu_debug.ui | ||
| 33 | configuration/configure_debug.cpp | 39 | configuration/configure_debug.cpp |
| 34 | configuration/configure_debug.h | 40 | configuration/configure_debug.h |
| 35 | configuration/configure_debug.ui | 41 | configuration/configure_debug.ui |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index f48785697..9e9b38214 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -524,8 +524,6 @@ void Config::ReadDebuggingValues() { | |||
| 524 | Settings::values.reporting_services = | 524 | Settings::values.reporting_services = |
| 525 | ReadSetting(QStringLiteral("reporting_services"), false).toBool(); | 525 | ReadSetting(QStringLiteral("reporting_services"), false).toBool(); |
| 526 | Settings::values.quest_flag = ReadSetting(QStringLiteral("quest_flag"), false).toBool(); | 526 | Settings::values.quest_flag = ReadSetting(QStringLiteral("quest_flag"), false).toBool(); |
| 527 | Settings::values.disable_cpu_opt = | ||
| 528 | ReadSetting(QStringLiteral("disable_cpu_opt"), false).toBool(); | ||
| 529 | Settings::values.disable_macro_jit = | 527 | Settings::values.disable_macro_jit = |
| 530 | ReadSetting(QStringLiteral("disable_macro_jit"), false).toBool(); | 528 | ReadSetting(QStringLiteral("disable_macro_jit"), false).toBool(); |
| 531 | 529 | ||
| @@ -617,6 +615,34 @@ void Config::ReadPathValues() { | |||
| 617 | qt_config->endGroup(); | 615 | qt_config->endGroup(); |
| 618 | } | 616 | } |
| 619 | 617 | ||
| 618 | void Config::ReadCpuValues() { | ||
| 619 | qt_config->beginGroup(QStringLiteral("Cpu")); | ||
| 620 | |||
| 621 | if (global) { | ||
| 622 | Settings::values.cpu_accuracy = static_cast<Settings::CPUAccuracy>( | ||
| 623 | ReadSetting(QStringLiteral("cpu_accuracy"), 0).toInt()); | ||
| 624 | |||
| 625 | Settings::values.cpuopt_page_tables = | ||
| 626 | ReadSetting(QStringLiteral("cpuopt_page_tables"), true).toBool(); | ||
| 627 | Settings::values.cpuopt_block_linking = | ||
| 628 | ReadSetting(QStringLiteral("cpuopt_block_linking"), true).toBool(); | ||
| 629 | Settings::values.cpuopt_return_stack_buffer = | ||
| 630 | ReadSetting(QStringLiteral("cpuopt_return_stack_buffer"), true).toBool(); | ||
| 631 | Settings::values.cpuopt_fast_dispatcher = | ||
| 632 | ReadSetting(QStringLiteral("cpuopt_fast_dispatcher"), true).toBool(); | ||
| 633 | Settings::values.cpuopt_context_elimination = | ||
| 634 | ReadSetting(QStringLiteral("cpuopt_context_elimination"), true).toBool(); | ||
| 635 | Settings::values.cpuopt_const_prop = | ||
| 636 | ReadSetting(QStringLiteral("cpuopt_const_prop"), true).toBool(); | ||
| 637 | Settings::values.cpuopt_misc_ir = | ||
| 638 | ReadSetting(QStringLiteral("cpuopt_misc_ir"), true).toBool(); | ||
| 639 | Settings::values.cpuopt_reduce_misalign_checks = | ||
| 640 | ReadSetting(QStringLiteral("cpuopt_reduce_misalign_checks"), true).toBool(); | ||
| 641 | } | ||
| 642 | |||
| 643 | qt_config->endGroup(); | ||
| 644 | } | ||
| 645 | |||
| 620 | void Config::ReadRendererValues() { | 646 | void Config::ReadRendererValues() { |
| 621 | qt_config->beginGroup(QStringLiteral("Renderer")); | 647 | qt_config->beginGroup(QStringLiteral("Renderer")); |
| 622 | 648 | ||
| @@ -813,6 +839,7 @@ void Config::ReadValues() { | |||
| 813 | ReadMiscellaneousValues(); | 839 | ReadMiscellaneousValues(); |
| 814 | } | 840 | } |
| 815 | ReadCoreValues(); | 841 | ReadCoreValues(); |
| 842 | ReadCpuValues(); | ||
| 816 | ReadRendererValues(); | 843 | ReadRendererValues(); |
| 817 | ReadAudioValues(); | 844 | ReadAudioValues(); |
| 818 | ReadSystemValues(); | 845 | ReadSystemValues(); |
| @@ -913,6 +940,7 @@ void Config::SaveValues() { | |||
| 913 | SaveMiscellaneousValues(); | 940 | SaveMiscellaneousValues(); |
| 914 | } | 941 | } |
| 915 | SaveCoreValues(); | 942 | SaveCoreValues(); |
| 943 | SaveCpuValues(); | ||
| 916 | SaveRendererValues(); | 944 | SaveRendererValues(); |
| 917 | SaveAudioValues(); | 945 | SaveAudioValues(); |
| 918 | SaveSystemValues(); | 946 | SaveSystemValues(); |
| @@ -1006,7 +1034,6 @@ void Config::SaveDebuggingValues() { | |||
| 1006 | WriteSetting(QStringLiteral("dump_exefs"), Settings::values.dump_exefs, false); | 1034 | WriteSetting(QStringLiteral("dump_exefs"), Settings::values.dump_exefs, false); |
| 1007 | WriteSetting(QStringLiteral("dump_nso"), Settings::values.dump_nso, false); | 1035 | WriteSetting(QStringLiteral("dump_nso"), Settings::values.dump_nso, false); |
| 1008 | WriteSetting(QStringLiteral("quest_flag"), Settings::values.quest_flag, false); | 1036 | WriteSetting(QStringLiteral("quest_flag"), Settings::values.quest_flag, false); |
| 1009 | WriteSetting(QStringLiteral("disable_cpu_opt"), Settings::values.disable_cpu_opt, false); | ||
| 1010 | WriteSetting(QStringLiteral("disable_macro_jit"), Settings::values.disable_macro_jit, false); | 1037 | WriteSetting(QStringLiteral("disable_macro_jit"), Settings::values.disable_macro_jit, false); |
| 1011 | 1038 | ||
| 1012 | qt_config->endGroup(); | 1039 | qt_config->endGroup(); |
| @@ -1070,6 +1097,32 @@ void Config::SavePathValues() { | |||
| 1070 | qt_config->endGroup(); | 1097 | qt_config->endGroup(); |
| 1071 | } | 1098 | } |
| 1072 | 1099 | ||
| 1100 | void Config::SaveCpuValues() { | ||
| 1101 | qt_config->beginGroup(QStringLiteral("Cpu")); | ||
| 1102 | |||
| 1103 | if (global) { | ||
| 1104 | WriteSetting(QStringLiteral("cpu_accuracy"), | ||
| 1105 | static_cast<int>(Settings::values.cpu_accuracy), 0); | ||
| 1106 | |||
| 1107 | WriteSetting(QStringLiteral("cpuopt_page_tables"), Settings::values.cpuopt_page_tables, | ||
| 1108 | true); | ||
| 1109 | WriteSetting(QStringLiteral("cpuopt_block_linking"), Settings::values.cpuopt_block_linking, | ||
| 1110 | true); | ||
| 1111 | WriteSetting(QStringLiteral("cpuopt_return_stack_buffer"), | ||
| 1112 | Settings::values.cpuopt_return_stack_buffer, true); | ||
| 1113 | WriteSetting(QStringLiteral("cpuopt_fast_dispatcher"), | ||
| 1114 | Settings::values.cpuopt_fast_dispatcher, true); | ||
| 1115 | WriteSetting(QStringLiteral("cpuopt_context_elimination"), | ||
| 1116 | Settings::values.cpuopt_context_elimination, true); | ||
| 1117 | WriteSetting(QStringLiteral("cpuopt_const_prop"), Settings::values.cpuopt_const_prop, true); | ||
| 1118 | WriteSetting(QStringLiteral("cpuopt_misc_ir"), Settings::values.cpuopt_misc_ir, true); | ||
| 1119 | WriteSetting(QStringLiteral("cpuopt_reduce_misalign_checks"), | ||
| 1120 | Settings::values.cpuopt_reduce_misalign_checks, true); | ||
| 1121 | } | ||
| 1122 | |||
| 1123 | qt_config->endGroup(); | ||
| 1124 | } | ||
| 1125 | |||
| 1073 | void Config::SaveRendererValues() { | 1126 | void Config::SaveRendererValues() { |
| 1074 | qt_config->beginGroup(QStringLiteral("Renderer")); | 1127 | qt_config->beginGroup(QStringLiteral("Renderer")); |
| 1075 | 1128 | ||
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index 681f0bca5..8e815f829 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h | |||
| @@ -49,6 +49,7 @@ private: | |||
| 49 | void ReadDisabledAddOnValues(); | 49 | void ReadDisabledAddOnValues(); |
| 50 | void ReadMiscellaneousValues(); | 50 | void ReadMiscellaneousValues(); |
| 51 | void ReadPathValues(); | 51 | void ReadPathValues(); |
| 52 | void ReadCpuValues(); | ||
| 52 | void ReadRendererValues(); | 53 | void ReadRendererValues(); |
| 53 | void ReadShortcutValues(); | 54 | void ReadShortcutValues(); |
| 54 | void ReadSystemValues(); | 55 | void ReadSystemValues(); |
| @@ -73,6 +74,7 @@ private: | |||
| 73 | void SaveDisabledAddOnValues(); | 74 | void SaveDisabledAddOnValues(); |
| 74 | void SaveMiscellaneousValues(); | 75 | void SaveMiscellaneousValues(); |
| 75 | void SavePathValues(); | 76 | void SavePathValues(); |
| 77 | void SaveCpuValues(); | ||
| 76 | void SaveRendererValues(); | 78 | void SaveRendererValues(); |
| 77 | void SaveShortcutValues(); | 79 | void SaveShortcutValues(); |
| 78 | void SaveSystemValues(); | 80 | void SaveSystemValues(); |
diff --git a/src/yuzu/configuration/configure.ui b/src/yuzu/configuration/configure.ui index 9aec1bd09..5f5d8e571 100644 --- a/src/yuzu/configuration/configure.ui +++ b/src/yuzu/configuration/configure.ui | |||
| @@ -78,6 +78,16 @@ | |||
| 78 | <string>Hotkeys</string> | 78 | <string>Hotkeys</string> |
| 79 | </attribute> | 79 | </attribute> |
| 80 | </widget> | 80 | </widget> |
| 81 | <widget class="ConfigureCpu" name="cpuTab"> | ||
| 82 | <attribute name="title"> | ||
| 83 | <string>CPU</string> | ||
| 84 | </attribute> | ||
| 85 | </widget> | ||
| 86 | <widget class="ConfigureCpuDebug" name="cpuDebugTab"> | ||
| 87 | <attribute name="title"> | ||
| 88 | <string>Debug</string> | ||
| 89 | </attribute> | ||
| 90 | </widget> | ||
| 81 | <widget class="ConfigureGraphics" name="graphicsTab"> | 91 | <widget class="ConfigureGraphics" name="graphicsTab"> |
| 82 | <attribute name="title"> | 92 | <attribute name="title"> |
| 83 | <string>Graphics</string> | 93 | <string>Graphics</string> |
| @@ -159,6 +169,18 @@ | |||
| 159 | <container>1</container> | 169 | <container>1</container> |
| 160 | </customwidget> | 170 | </customwidget> |
| 161 | <customwidget> | 171 | <customwidget> |
| 172 | <class>ConfigureCpu</class> | ||
| 173 | <extends>QWidget</extends> | ||
| 174 | <header>configuration/configure_cpu.h</header> | ||
| 175 | <container>1</container> | ||
| 176 | </customwidget> | ||
| 177 | <customwidget> | ||
| 178 | <class>ConfigureCpuDebug</class> | ||
| 179 | <extends>QWidget</extends> | ||
| 180 | <header>configuration/configure_cpu_debug.h</header> | ||
| 181 | <container>1</container> | ||
| 182 | </customwidget> | ||
| 183 | <customwidget> | ||
| 162 | <class>ConfigureGraphics</class> | 184 | <class>ConfigureGraphics</class> |
| 163 | <extends>QWidget</extends> | 185 | <extends>QWidget</extends> |
| 164 | <header>configuration/configure_graphics.h</header> | 186 | <header>configuration/configure_graphics.h</header> |
diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cpp new file mode 100644 index 000000000..7493e5ffb --- /dev/null +++ b/src/yuzu/configuration/configure_cpu.cpp | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <QComboBox> | ||
| 6 | #include <QMessageBox> | ||
| 7 | |||
| 8 | #include "common/common_types.h" | ||
| 9 | #include "common/logging/log.h" | ||
| 10 | #include "core/core.h" | ||
| 11 | #include "core/settings.h" | ||
| 12 | #include "ui_configure_cpu.h" | ||
| 13 | #include "yuzu/configuration/configure_cpu.h" | ||
| 14 | |||
| 15 | ConfigureCpu::ConfigureCpu(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureCpu) { | ||
| 16 | ui->setupUi(this); | ||
| 17 | |||
| 18 | SetConfiguration(); | ||
| 19 | |||
| 20 | connect(ui->accuracy, qOverload<int>(&QComboBox::activated), this, | ||
| 21 | &ConfigureCpu::AccuracyUpdated); | ||
| 22 | } | ||
| 23 | |||
| 24 | ConfigureCpu::~ConfigureCpu() = default; | ||
| 25 | |||
| 26 | void ConfigureCpu::SetConfiguration() { | ||
| 27 | const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn(); | ||
| 28 | |||
| 29 | ui->accuracy->setEnabled(runtime_lock); | ||
| 30 | ui->accuracy->setCurrentIndex(static_cast<int>(Settings::values.cpu_accuracy)); | ||
| 31 | } | ||
| 32 | |||
| 33 | void ConfigureCpu::AccuracyUpdated(int index) { | ||
| 34 | if (static_cast<Settings::CPUAccuracy>(index) == Settings::CPUAccuracy::DebugMode) { | ||
| 35 | const auto result = QMessageBox::warning(this, tr("Setting CPU to Debug Mode"), | ||
| 36 | tr("CPU Debug Mode is only intended for developer " | ||
| 37 | "use. Are you sure you want to enable this?"), | ||
| 38 | QMessageBox::Yes | QMessageBox::No); | ||
| 39 | if (result == QMessageBox::No) { | ||
| 40 | ui->accuracy->setCurrentIndex(static_cast<int>(Settings::CPUAccuracy::Accurate)); | ||
| 41 | return; | ||
| 42 | } | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | void ConfigureCpu::ApplyConfiguration() { | ||
| 47 | Settings::values.cpu_accuracy = | ||
| 48 | static_cast<Settings::CPUAccuracy>(ui->accuracy->currentIndex()); | ||
| 49 | } | ||
| 50 | |||
| 51 | void ConfigureCpu::changeEvent(QEvent* event) { | ||
| 52 | if (event->type() == QEvent::LanguageChange) { | ||
| 53 | RetranslateUI(); | ||
| 54 | } | ||
| 55 | |||
| 56 | QWidget::changeEvent(event); | ||
| 57 | } | ||
| 58 | |||
| 59 | void ConfigureCpu::RetranslateUI() { | ||
| 60 | ui->retranslateUi(this); | ||
| 61 | } | ||
diff --git a/src/yuzu/configuration/configure_cpu.h b/src/yuzu/configuration/configure_cpu.h new file mode 100644 index 000000000..e4741d3a4 --- /dev/null +++ b/src/yuzu/configuration/configure_cpu.h | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <memory> | ||
| 8 | #include <QWidget> | ||
| 9 | #include "core/settings.h" | ||
| 10 | |||
| 11 | namespace Ui { | ||
| 12 | class ConfigureCpu; | ||
| 13 | } | ||
| 14 | |||
| 15 | class ConfigureCpu : public QWidget { | ||
| 16 | Q_OBJECT | ||
| 17 | |||
| 18 | public: | ||
| 19 | explicit ConfigureCpu(QWidget* parent = nullptr); | ||
| 20 | ~ConfigureCpu() override; | ||
| 21 | |||
| 22 | void ApplyConfiguration(); | ||
| 23 | |||
| 24 | private: | ||
| 25 | void changeEvent(QEvent* event) override; | ||
| 26 | void RetranslateUI(); | ||
| 27 | |||
| 28 | void AccuracyUpdated(int index); | ||
| 29 | |||
| 30 | void SetConfiguration(); | ||
| 31 | |||
| 32 | std::unique_ptr<Ui::ConfigureCpu> ui; | ||
| 33 | }; | ||
diff --git a/src/yuzu/configuration/configure_cpu.ui b/src/yuzu/configuration/configure_cpu.ui new file mode 100644 index 000000000..bf6ea79bb --- /dev/null +++ b/src/yuzu/configuration/configure_cpu.ui | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <ui version="4.0"> | ||
| 3 | <class>ConfigureCpu</class> | ||
| 4 | <widget class="QWidget" name="ConfigureCpu"> | ||
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>400</width> | ||
| 10 | <height>321</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="windowTitle"> | ||
| 14 | <string>Form</string> | ||
| 15 | </property> | ||
| 16 | <layout class="QVBoxLayout"> | ||
| 17 | <item> | ||
| 18 | <layout class="QVBoxLayout"> | ||
| 19 | <item> | ||
| 20 | <widget class="QGroupBox"> | ||
| 21 | <property name="title"> | ||
| 22 | <string>General</string> | ||
| 23 | </property> | ||
| 24 | <layout class="QVBoxLayout"> | ||
| 25 | <item> | ||
| 26 | <layout class="QHBoxLayout"> | ||
| 27 | <item> | ||
| 28 | <widget class="QLabel"> | ||
| 29 | <property name="text"> | ||
| 30 | <string>Accuracy:</string> | ||
| 31 | </property> | ||
| 32 | </widget> | ||
| 33 | </item> | ||
| 34 | <item> | ||
| 35 | <widget class="QComboBox" name="accuracy"> | ||
| 36 | <item> | ||
| 37 | <property name="text"> | ||
| 38 | <string>Accurate</string> | ||
| 39 | </property> | ||
| 40 | </item> | ||
| 41 | <item> | ||
| 42 | <property name="text"> | ||
| 43 | <string>Enable Debug Mode</string> | ||
| 44 | </property> | ||
| 45 | </item> | ||
| 46 | </widget> | ||
| 47 | </item> | ||
| 48 | </layout> | ||
| 49 | </item> | ||
| 50 | <item> | ||
| 51 | <widget class="QLabel"> | ||
| 52 | <property name="wordWrap"> | ||
| 53 | <bool>1</bool> | ||
| 54 | </property> | ||
| 55 | <property name="text"> | ||
| 56 | <string>We recommend setting accuracy to "Accurate".</string> | ||
| 57 | </property> | ||
| 58 | </widget> | ||
| 59 | </item> | ||
| 60 | </layout> | ||
| 61 | </widget> | ||
| 62 | </item> | ||
| 63 | </layout> | ||
| 64 | </item> | ||
| 65 | <item> | ||
| 66 | <spacer name="verticalSpacer"> | ||
| 67 | <property name="orientation"> | ||
| 68 | <enum>Qt::Vertical</enum> | ||
| 69 | </property> | ||
| 70 | <property name="sizeHint" stdset="0"> | ||
| 71 | <size> | ||
| 72 | <width>20</width> | ||
| 73 | <height>40</height> | ||
| 74 | </size> | ||
| 75 | </property> | ||
| 76 | </spacer> | ||
| 77 | </item> | ||
| 78 | <item> | ||
| 79 | <widget class="QLabel" name="label_disable_info"> | ||
| 80 | <property name="text"> | ||
| 81 | <string>CPU settings are available only when game is not running.</string> | ||
| 82 | </property> | ||
| 83 | <property name="wordWrap"> | ||
| 84 | <bool>true</bool> | ||
| 85 | </property> | ||
| 86 | </widget> | ||
| 87 | </item> | ||
| 88 | </layout> | ||
| 89 | </widget> | ||
| 90 | <resources/> | ||
| 91 | <connections/> | ||
| 92 | </ui> | ||
diff --git a/src/yuzu/configuration/configure_cpu_debug.cpp b/src/yuzu/configuration/configure_cpu_debug.cpp new file mode 100644 index 000000000..3385b2cf6 --- /dev/null +++ b/src/yuzu/configuration/configure_cpu_debug.cpp | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <QComboBox> | ||
| 6 | |||
| 7 | #include "common/common_types.h" | ||
| 8 | #include "common/logging/log.h" | ||
| 9 | #include "core/core.h" | ||
| 10 | #include "core/settings.h" | ||
| 11 | #include "ui_configure_cpu_debug.h" | ||
| 12 | #include "yuzu/configuration/configure_cpu_debug.h" | ||
| 13 | |||
| 14 | ConfigureCpuDebug::ConfigureCpuDebug(QWidget* parent) | ||
| 15 | : QWidget(parent), ui(new Ui::ConfigureCpuDebug) { | ||
| 16 | ui->setupUi(this); | ||
| 17 | |||
| 18 | SetConfiguration(); | ||
| 19 | } | ||
| 20 | |||
| 21 | ConfigureCpuDebug::~ConfigureCpuDebug() = default; | ||
| 22 | |||
| 23 | void ConfigureCpuDebug::SetConfiguration() { | ||
| 24 | const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn(); | ||
| 25 | |||
| 26 | ui->cpuopt_page_tables->setEnabled(runtime_lock); | ||
| 27 | ui->cpuopt_page_tables->setChecked(Settings::values.cpuopt_page_tables); | ||
| 28 | ui->cpuopt_block_linking->setEnabled(runtime_lock); | ||
| 29 | ui->cpuopt_block_linking->setChecked(Settings::values.cpuopt_block_linking); | ||
| 30 | ui->cpuopt_return_stack_buffer->setEnabled(runtime_lock); | ||
| 31 | ui->cpuopt_return_stack_buffer->setChecked(Settings::values.cpuopt_return_stack_buffer); | ||
| 32 | ui->cpuopt_fast_dispatcher->setEnabled(runtime_lock); | ||
| 33 | ui->cpuopt_fast_dispatcher->setChecked(Settings::values.cpuopt_fast_dispatcher); | ||
| 34 | ui->cpuopt_context_elimination->setEnabled(runtime_lock); | ||
| 35 | ui->cpuopt_context_elimination->setChecked(Settings::values.cpuopt_context_elimination); | ||
| 36 | ui->cpuopt_const_prop->setEnabled(runtime_lock); | ||
| 37 | ui->cpuopt_const_prop->setChecked(Settings::values.cpuopt_const_prop); | ||
| 38 | ui->cpuopt_misc_ir->setEnabled(runtime_lock); | ||
| 39 | ui->cpuopt_misc_ir->setChecked(Settings::values.cpuopt_misc_ir); | ||
| 40 | ui->cpuopt_reduce_misalign_checks->setEnabled(runtime_lock); | ||
| 41 | ui->cpuopt_reduce_misalign_checks->setChecked(Settings::values.cpuopt_reduce_misalign_checks); | ||
| 42 | } | ||
| 43 | |||
| 44 | void ConfigureCpuDebug::ApplyConfiguration() { | ||
| 45 | Settings::values.cpuopt_page_tables = ui->cpuopt_page_tables->isChecked(); | ||
| 46 | Settings::values.cpuopt_block_linking = ui->cpuopt_block_linking->isChecked(); | ||
| 47 | Settings::values.cpuopt_return_stack_buffer = ui->cpuopt_return_stack_buffer->isChecked(); | ||
| 48 | Settings::values.cpuopt_fast_dispatcher = ui->cpuopt_fast_dispatcher->isChecked(); | ||
| 49 | Settings::values.cpuopt_context_elimination = ui->cpuopt_context_elimination->isChecked(); | ||
| 50 | Settings::values.cpuopt_const_prop = ui->cpuopt_const_prop->isChecked(); | ||
| 51 | Settings::values.cpuopt_misc_ir = ui->cpuopt_misc_ir->isChecked(); | ||
| 52 | Settings::values.cpuopt_reduce_misalign_checks = ui->cpuopt_reduce_misalign_checks->isChecked(); | ||
| 53 | } | ||
| 54 | |||
| 55 | void ConfigureCpuDebug::changeEvent(QEvent* event) { | ||
| 56 | if (event->type() == QEvent::LanguageChange) { | ||
| 57 | RetranslateUI(); | ||
| 58 | } | ||
| 59 | |||
| 60 | QWidget::changeEvent(event); | ||
| 61 | } | ||
| 62 | |||
| 63 | void ConfigureCpuDebug::RetranslateUI() { | ||
| 64 | ui->retranslateUi(this); | ||
| 65 | } | ||
diff --git a/src/yuzu/configuration/configure_cpu_debug.h b/src/yuzu/configuration/configure_cpu_debug.h new file mode 100644 index 000000000..c9941ef3b --- /dev/null +++ b/src/yuzu/configuration/configure_cpu_debug.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <memory> | ||
| 8 | #include <QWidget> | ||
| 9 | #include "core/settings.h" | ||
| 10 | |||
| 11 | namespace Ui { | ||
| 12 | class ConfigureCpuDebug; | ||
| 13 | } | ||
| 14 | |||
| 15 | class ConfigureCpuDebug : public QWidget { | ||
| 16 | Q_OBJECT | ||
| 17 | |||
| 18 | public: | ||
| 19 | explicit ConfigureCpuDebug(QWidget* parent = nullptr); | ||
| 20 | ~ConfigureCpuDebug() override; | ||
| 21 | |||
| 22 | void ApplyConfiguration(); | ||
| 23 | |||
| 24 | private: | ||
| 25 | void changeEvent(QEvent* event) override; | ||
| 26 | void RetranslateUI(); | ||
| 27 | |||
| 28 | void SetConfiguration(); | ||
| 29 | |||
| 30 | std::unique_ptr<Ui::ConfigureCpuDebug> ui; | ||
| 31 | }; | ||
diff --git a/src/yuzu/configuration/configure_cpu_debug.ui b/src/yuzu/configuration/configure_cpu_debug.ui new file mode 100644 index 000000000..a90dc64fe --- /dev/null +++ b/src/yuzu/configuration/configure_cpu_debug.ui | |||
| @@ -0,0 +1,174 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <ui version="4.0"> | ||
| 3 | <class>ConfigureCpuDebug</class> | ||
| 4 | <widget class="QWidget" name="ConfigureCpuDebug"> | ||
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>400</width> | ||
| 10 | <height>321</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="windowTitle"> | ||
| 14 | <string>Form</string> | ||
| 15 | </property> | ||
| 16 | <layout class="QVBoxLayout"> | ||
| 17 | <item> | ||
| 18 | <layout class="QVBoxLayout"> | ||
| 19 | <item> | ||
| 20 | <widget class="QGroupBox"> | ||
| 21 | <property name="title"> | ||
| 22 | <string>Toggle CPU Optimizations</string> | ||
| 23 | </property> | ||
| 24 | <layout class="QVBoxLayout"> | ||
| 25 | <item> | ||
| 26 | <widget class="QLabel"> | ||
| 27 | <property name="wordWrap"> | ||
| 28 | <bool>1</bool> | ||
| 29 | </property> | ||
| 30 | <property name="text"> | ||
| 31 | <string> | ||
| 32 | <div> | ||
| 33 | <b>For debugging only.</b> | ||
| 34 | <br> | ||
| 35 | If you're not sure what these do, keep all of these enabled. | ||
| 36 | <br> | ||
| 37 | These settings only take effect when CPU Accuracy is "Debug Mode". | ||
| 38 | </div> | ||
| 39 | </string> | ||
| 40 | </property> | ||
| 41 | </widget> | ||
| 42 | </item> | ||
| 43 | <item> | ||
| 44 | <widget class="QCheckBox" name="cpuopt_page_tables"> | ||
| 45 | <property name="text"> | ||
| 46 | <string>Enable inline page tables</string> | ||
| 47 | </property> | ||
| 48 | <property name="toolTip"> | ||
| 49 | <string> | ||
| 50 | <div style="white-space: nowrap">This optimization speeds up memory accesses by the guest program.</div> | ||
| 51 | <div style="white-space: nowrap">Enabling it inlines accesses to PageTable::pointers into emitted code.</div> | ||
| 52 | <div style="white-space: nowrap">Disabling this forces all memory accesses to go through the Memory::Read/Memory::Write functions.</div> | ||
| 53 | </string> | ||
| 54 | </property> | ||
| 55 | </widget> | ||
| 56 | </item> | ||
| 57 | <item> | ||
| 58 | <widget class="QCheckBox" name="cpuopt_block_linking"> | ||
| 59 | <property name="text"> | ||
| 60 | <string>Enable block linking</string> | ||
| 61 | </property> | ||
| 62 | <property name="toolTip"> | ||
| 63 | <string> | ||
| 64 | <div>This optimization avoids dispatcher lookups by allowing emitted basic blocks to jump directly to other basic blocks if the destination PC is static.</div> | ||
| 65 | </string> | ||
| 66 | </property> | ||
| 67 | </widget> | ||
| 68 | </item> | ||
| 69 | <item> | ||
| 70 | <widget class="QCheckBox" name="cpuopt_return_stack_buffer"> | ||
| 71 | <property name="text"> | ||
| 72 | <string>Enable return stack buffer</string> | ||
| 73 | </property> | ||
| 74 | <property name="toolTip"> | ||
| 75 | <string> | ||
| 76 | <div>This optimization avoids dispatcher lookups by keeping track potential return addresses of BL instructions. This approximates what happens with a return stack buffer on a real CPU.</div> | ||
| 77 | </string> | ||
| 78 | </property> | ||
| 79 | </widget> | ||
| 80 | </item> | ||
| 81 | <item> | ||
| 82 | <widget class="QCheckBox" name="cpuopt_fast_dispatcher"> | ||
| 83 | <property name="text"> | ||
| 84 | <string>Enable fast dispatcher</string> | ||
| 85 | </property> | ||
| 86 | <property name="toolTip"> | ||
| 87 | <string> | ||
| 88 | <div>Enable a two-tiered dispatch system. A faster dispatcher written in assembly has a small MRU cache of jump destinations is used first. If that fails, dispatch falls back to the slower C++ dispatcher.</div> | ||
| 89 | </string> | ||
| 90 | </property> | ||
| 91 | </widget> | ||
| 92 | </item> | ||
| 93 | <item> | ||
| 94 | <widget class="QCheckBox" name="cpuopt_context_elimination"> | ||
| 95 | <property name="text"> | ||
| 96 | <string>Enable context elimination</string> | ||
| 97 | </property> | ||
| 98 | <property name="toolTip"> | ||
| 99 | <string> | ||
| 100 | <div>Enables an IR optimization that reduces unnecessary accesses to the CPU context structure.</div> | ||
| 101 | </string> | ||
| 102 | </property> | ||
| 103 | </widget> | ||
| 104 | </item> | ||
| 105 | <item> | ||
| 106 | <widget class="QCheckBox" name="cpuopt_const_prop"> | ||
| 107 | <property name="text"> | ||
| 108 | <string>Enable constant propagation</string> | ||
| 109 | </property> | ||
| 110 | <property name="toolTip"> | ||
| 111 | <string> | ||
| 112 | <div>Enables IR optimizations that involve constant propagation.</div> | ||
| 113 | </string> | ||
| 114 | </property> | ||
| 115 | </widget> | ||
| 116 | </item> | ||
| 117 | <item> | ||
| 118 | <widget class="QCheckBox" name="cpuopt_misc_ir"> | ||
| 119 | <property name="text"> | ||
| 120 | <string>Enable miscellaneous optimizations</string> | ||
| 121 | </property> | ||
| 122 | <property name="toolTip"> | ||
| 123 | <string> | ||
| 124 | <div>Enables miscellaneous IR optimizations.</div> | ||
| 125 | </string> | ||
| 126 | </property> | ||
| 127 | </widget> | ||
| 128 | </item> | ||
| 129 | <item> | ||
| 130 | <widget class="QCheckBox" name="cpuopt_reduce_misalign_checks"> | ||
| 131 | <property name="text"> | ||
| 132 | <string>Enable misalignment check reduction</string> | ||
| 133 | </property> | ||
| 134 | <property name="toolTip"> | ||
| 135 | <string> | ||
| 136 | <div style="white-space: nowrap">When enabled, a misalignment is only triggered when an access crosses a page boundary.</div> | ||
| 137 | <div style="white-space: nowrap">When disabled, a misalignment is triggered on all misaligned accesses.</div> | ||
| 138 | </string> | ||
| 139 | </property> | ||
| 140 | </widget> | ||
| 141 | </item> | ||
| 142 | </layout> | ||
| 143 | </widget> | ||
| 144 | </item> | ||
| 145 | </layout> | ||
| 146 | </item> | ||
| 147 | <item> | ||
| 148 | <spacer name="verticalSpacer"> | ||
| 149 | <property name="orientation"> | ||
| 150 | <enum>Qt::Vertical</enum> | ||
| 151 | </property> | ||
| 152 | <property name="sizeHint" stdset="0"> | ||
| 153 | <size> | ||
| 154 | <width>20</width> | ||
| 155 | <height>40</height> | ||
| 156 | </size> | ||
| 157 | </property> | ||
| 158 | </spacer> | ||
| 159 | </item> | ||
| 160 | <item> | ||
| 161 | <widget class="QLabel" name="label_disable_info"> | ||
| 162 | <property name="text"> | ||
| 163 | <string>CPU settings are available only when game is not running.</string> | ||
| 164 | </property> | ||
| 165 | <property name="wordWrap"> | ||
| 166 | <bool>true</bool> | ||
| 167 | </property> | ||
| 168 | </widget> | ||
| 169 | </item> | ||
| 170 | </layout> | ||
| 171 | </widget> | ||
| 172 | <resources/> | ||
| 173 | <connections/> | ||
| 174 | </ui> | ||
diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index 2c77441fd..d0e71dd60 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp | |||
| @@ -36,7 +36,6 @@ void ConfigureDebug::SetConfiguration() { | |||
| 36 | ui->homebrew_args_edit->setText(QString::fromStdString(Settings::values.program_args)); | 36 | ui->homebrew_args_edit->setText(QString::fromStdString(Settings::values.program_args)); |
| 37 | ui->reporting_services->setChecked(Settings::values.reporting_services); | 37 | ui->reporting_services->setChecked(Settings::values.reporting_services); |
| 38 | ui->quest_flag->setChecked(Settings::values.quest_flag); | 38 | ui->quest_flag->setChecked(Settings::values.quest_flag); |
| 39 | ui->disable_cpu_opt->setChecked(Settings::values.disable_cpu_opt); | ||
| 40 | ui->enable_graphics_debugging->setEnabled(!Core::System::GetInstance().IsPoweredOn()); | 39 | ui->enable_graphics_debugging->setEnabled(!Core::System::GetInstance().IsPoweredOn()); |
| 41 | ui->enable_graphics_debugging->setChecked(Settings::values.renderer_debug); | 40 | ui->enable_graphics_debugging->setChecked(Settings::values.renderer_debug); |
| 42 | ui->disable_macro_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn()); | 41 | ui->disable_macro_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn()); |
| @@ -51,7 +50,6 @@ void ConfigureDebug::ApplyConfiguration() { | |||
| 51 | Settings::values.program_args = ui->homebrew_args_edit->text().toStdString(); | 50 | Settings::values.program_args = ui->homebrew_args_edit->text().toStdString(); |
| 52 | Settings::values.reporting_services = ui->reporting_services->isChecked(); | 51 | Settings::values.reporting_services = ui->reporting_services->isChecked(); |
| 53 | Settings::values.quest_flag = ui->quest_flag->isChecked(); | 52 | Settings::values.quest_flag = ui->quest_flag->isChecked(); |
| 54 | Settings::values.disable_cpu_opt = ui->disable_cpu_opt->isChecked(); | ||
| 55 | Settings::values.renderer_debug = ui->enable_graphics_debugging->isChecked(); | 53 | Settings::values.renderer_debug = ui->enable_graphics_debugging->isChecked(); |
| 56 | Settings::values.disable_macro_jit = ui->disable_macro_jit->isChecked(); | 54 | Settings::values.disable_macro_jit = ui->disable_macro_jit->isChecked(); |
| 57 | Debugger::ToggleConsole(); | 55 | Debugger::ToggleConsole(); |
diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui index 46f0208c6..272bdd6b8 100644 --- a/src/yuzu/configuration/configure_debug.ui +++ b/src/yuzu/configuration/configure_debug.ui | |||
| @@ -228,13 +228,6 @@ | |||
| 228 | </property> | 228 | </property> |
| 229 | </widget> | 229 | </widget> |
| 230 | </item> | 230 | </item> |
| 231 | <item> | ||
| 232 | <widget class="QCheckBox" name="disable_cpu_opt"> | ||
| 233 | <property name="text"> | ||
| 234 | <string>Disable CPU JIT optimizations</string> | ||
| 235 | </property> | ||
| 236 | </widget> | ||
| 237 | </item> | ||
| 238 | </layout> | 231 | </layout> |
| 239 | </widget> | 232 | </widget> |
| 240 | </item> | 233 | </item> |
diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index 5918e9972..a5afb354f 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp | |||
| @@ -42,6 +42,8 @@ void ConfigureDialog::ApplyConfiguration() { | |||
| 42 | ui->filesystemTab->applyConfiguration(); | 42 | ui->filesystemTab->applyConfiguration(); |
| 43 | ui->inputTab->ApplyConfiguration(); | 43 | ui->inputTab->ApplyConfiguration(); |
| 44 | ui->hotkeysTab->ApplyConfiguration(registry); | 44 | ui->hotkeysTab->ApplyConfiguration(registry); |
| 45 | ui->cpuTab->ApplyConfiguration(); | ||
| 46 | ui->cpuDebugTab->ApplyConfiguration(); | ||
| 45 | ui->graphicsTab->ApplyConfiguration(); | 47 | ui->graphicsTab->ApplyConfiguration(); |
| 46 | ui->graphicsAdvancedTab->ApplyConfiguration(); | 48 | ui->graphicsAdvancedTab->ApplyConfiguration(); |
| 47 | ui->audioTab->ApplyConfiguration(); | 49 | ui->audioTab->ApplyConfiguration(); |
| @@ -76,9 +78,10 @@ void ConfigureDialog::RetranslateUI() { | |||
| 76 | Q_DECLARE_METATYPE(QList<QWidget*>); | 78 | Q_DECLARE_METATYPE(QList<QWidget*>); |
| 77 | 79 | ||
| 78 | void ConfigureDialog::PopulateSelectionList() { | 80 | void ConfigureDialog::PopulateSelectionList() { |
| 79 | const std::array<std::pair<QString, QList<QWidget*>>, 5> items{ | 81 | const std::array<std::pair<QString, QList<QWidget*>>, 6> items{ |
| 80 | {{tr("General"), {ui->generalTab, ui->webTab, ui->debugTab, ui->uiTab}}, | 82 | {{tr("General"), {ui->generalTab, ui->webTab, ui->debugTab, ui->uiTab}}, |
| 81 | {tr("System"), {ui->systemTab, ui->profileManagerTab, ui->serviceTab, ui->filesystemTab}}, | 83 | {tr("System"), {ui->systemTab, ui->profileManagerTab, ui->serviceTab, ui->filesystemTab}}, |
| 84 | {tr("CPU"), {ui->cpuTab, ui->cpuDebugTab}}, | ||
| 82 | {tr("Graphics"), {ui->graphicsTab, ui->graphicsAdvancedTab}}, | 85 | {tr("Graphics"), {ui->graphicsTab, ui->graphicsAdvancedTab}}, |
| 83 | {tr("Audio"), {ui->audioTab}}, | 86 | {tr("Audio"), {ui->audioTab}}, |
| 84 | {tr("Controls"), {ui->inputTab, ui->hotkeysTab}}}, | 87 | {tr("Controls"), {ui->inputTab, ui->hotkeysTab}}}, |
| @@ -107,6 +110,8 @@ void ConfigureDialog::UpdateVisibleTabs() { | |||
| 107 | {ui->profileManagerTab, tr("Profiles")}, | 110 | {ui->profileManagerTab, tr("Profiles")}, |
| 108 | {ui->inputTab, tr("Input")}, | 111 | {ui->inputTab, tr("Input")}, |
| 109 | {ui->hotkeysTab, tr("Hotkeys")}, | 112 | {ui->hotkeysTab, tr("Hotkeys")}, |
| 113 | {ui->cpuTab, tr("CPU")}, | ||
| 114 | {ui->cpuDebugTab, tr("Debug")}, | ||
| 110 | {ui->graphicsTab, tr("Graphics")}, | 115 | {ui->graphicsTab, tr("Graphics")}, |
| 111 | {ui->graphicsAdvancedTab, tr("Advanced")}, | 116 | {ui->graphicsAdvancedTab, tr("Advanced")}, |
| 112 | {ui->audioTab, tr("Audio")}, | 117 | {ui->audioTab, tr("Audio")}, |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index dce70a1e0..7773228c8 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -428,8 +428,6 @@ void Config::ReadValues() { | |||
| 428 | Settings::values.reporting_services = | 428 | Settings::values.reporting_services = |
| 429 | sdl2_config->GetBoolean("Debugging", "reporting_services", false); | 429 | sdl2_config->GetBoolean("Debugging", "reporting_services", false); |
| 430 | Settings::values.quest_flag = sdl2_config->GetBoolean("Debugging", "quest_flag", false); | 430 | Settings::values.quest_flag = sdl2_config->GetBoolean("Debugging", "quest_flag", false); |
| 431 | Settings::values.disable_cpu_opt = | ||
| 432 | sdl2_config->GetBoolean("Debugging", "disable_cpu_opt", false); | ||
| 433 | Settings::values.disable_macro_jit = | 431 | Settings::values.disable_macro_jit = |
| 434 | sdl2_config->GetBoolean("Debugging", "disable_macro_jit", false); | 432 | sdl2_config->GetBoolean("Debugging", "disable_macro_jit", false); |
| 435 | 433 | ||
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 45c07ed5d..5bed47fd7 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -97,6 +97,39 @@ udp_pad_index= | |||
| 97 | # 0 (default): Disabled, 1: Enabled | 97 | # 0 (default): Disabled, 1: Enabled |
| 98 | use_multi_core= | 98 | use_multi_core= |
| 99 | 99 | ||
| 100 | [Cpu] | ||
| 101 | # Enable inline page tables optimization (faster guest memory access) | ||
| 102 | # 0: Disabled, 1 (default): Enabled | ||
| 103 | cpuopt_page_tables = | ||
| 104 | |||
| 105 | # Enable block linking CPU optimization (reduce block dispatcher use during predictable jumps) | ||
| 106 | # 0: Disabled, 1 (default): Enabled | ||
| 107 | cpuopt_block_linking = | ||
| 108 | |||
| 109 | # Enable return stack buffer CPU optimization (reduce block dispatcher use during predictable returns) | ||
| 110 | # 0: Disabled, 1 (default): Enabled | ||
| 111 | cpuopt_return_stack_buffer = | ||
| 112 | |||
| 113 | # Enable fast dispatcher CPU optimization (use a two-tiered dispatcher architecture) | ||
| 114 | # 0: Disabled, 1 (default): Enabled | ||
| 115 | cpuopt_fast_dispatcher = | ||
| 116 | |||
| 117 | # Enable context elimination CPU Optimization (reduce host memory use for guest context) | ||
| 118 | # 0: Disabled, 1 (default): Enabled | ||
| 119 | cpuopt_context_elimination = | ||
| 120 | |||
| 121 | # Enable constant propagation CPU optimization (basic IR optimization) | ||
| 122 | # 0: Disabled, 1 (default): Enabled | ||
| 123 | cpuopt_const_prop = | ||
| 124 | |||
| 125 | # Enable miscellaneous CPU optimizations (basic IR optimization) | ||
| 126 | # 0: Disabled, 1 (default): Enabled | ||
| 127 | cpuopt_misc_ir = | ||
| 128 | |||
| 129 | # Enable reduction of memory misalignment checks (reduce memory fallbacks for misaligned access) | ||
| 130 | # 0: Disabled, 1 (default): Enabled | ||
| 131 | cpuopt_reduce_misalign_checks = | ||
| 132 | |||
| 100 | [Renderer] | 133 | [Renderer] |
| 101 | # Which backend API to use. | 134 | # Which backend API to use. |
| 102 | # 0 (default): OpenGL, 1: Vulkan | 135 | # 0 (default): OpenGL, 1: Vulkan |
| @@ -283,9 +316,6 @@ dump_nso=false | |||
| 283 | # Determines whether or not yuzu will report to the game that the emulated console is in Kiosk Mode | 316 | # Determines whether or not yuzu will report to the game that the emulated console is in Kiosk Mode |
| 284 | # false: Retail/Normal Mode (default), true: Kiosk Mode | 317 | # false: Retail/Normal Mode (default), true: Kiosk Mode |
| 285 | quest_flag = | 318 | quest_flag = |
| 286 | # Determines whether or not JIT CPU optimizations are enabled | ||
| 287 | # false: Optimizations Enabled, true: Optimizations Disabled | ||
| 288 | disable_cpu_opt = | ||
| 289 | # Enables/Disables the macro JIT compiler | 319 | # Enables/Disables the macro JIT compiler |
| 290 | disable_macro_jit=false | 320 | disable_macro_jit=false |
| 291 | 321 | ||
diff --git a/src/yuzu_tester/default_ini.h b/src/yuzu_tester/default_ini.h index 41bbbbf60..3eb64e9d7 100644 --- a/src/yuzu_tester/default_ini.h +++ b/src/yuzu_tester/default_ini.h | |||
| @@ -12,6 +12,39 @@ const char* sdl2_config_file = R"( | |||
| 12 | # 0 (default): Disabled, 1: Enabled | 12 | # 0 (default): Disabled, 1: Enabled |
| 13 | use_multi_core= | 13 | use_multi_core= |
| 14 | 14 | ||
| 15 | [Cpu] | ||
| 16 | # Enable inline page tables optimization (faster guest memory access) | ||
| 17 | # 0: Disabled, 1 (default): Enabled | ||
| 18 | cpuopt_page_tables = | ||
| 19 | |||
| 20 | # Enable block linking CPU optimization (reduce block dispatcher use during predictable jumps) | ||
| 21 | # 0: Disabled, 1 (default): Enabled | ||
| 22 | cpuopt_block_linking = | ||
| 23 | |||
| 24 | # Enable return stack buffer CPU optimization (reduce block dispatcher use during predictable returns) | ||
| 25 | # 0: Disabled, 1 (default): Enabled | ||
| 26 | cpuopt_return_stack_buffer = | ||
| 27 | |||
| 28 | # Enable fast dispatcher CPU optimization (use a two-tiered dispatcher architecture) | ||
| 29 | # 0: Disabled, 1 (default): Enabled | ||
| 30 | cpuopt_fast_dispatcher = | ||
| 31 | |||
| 32 | # Enable context elimination CPU Optimization (reduce host memory use for guest context) | ||
| 33 | # 0: Disabled, 1 (default): Enabled | ||
| 34 | cpuopt_context_elimination = | ||
| 35 | |||
| 36 | # Enable constant propagation CPU optimization (basic IR optimization) | ||
| 37 | # 0: Disabled, 1 (default): Enabled | ||
| 38 | cpuopt_const_prop = | ||
| 39 | |||
| 40 | # Enable miscellaneous CPU optimizations (basic IR optimization) | ||
| 41 | # 0: Disabled, 1 (default): Enabled | ||
| 42 | cpuopt_misc_ir = | ||
| 43 | |||
| 44 | # Enable reduction of memory misalignment checks (reduce memory fallbacks for misaligned access) | ||
| 45 | # 0: Disabled, 1 (default): Enabled | ||
| 46 | cpuopt_reduce_misalign_checks = | ||
| 47 | |||
| 15 | [Renderer] | 48 | [Renderer] |
| 16 | # Whether to use software or hardware rendering. | 49 | # Whether to use software or hardware rendering. |
| 17 | # 0: Software, 1 (default): Hardware | 50 | # 0: Software, 1 (default): Hardware |