diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure.ui | 11 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.cpp | 51 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.ui | 124 | ||||
| -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_dialog.cpp | 4 |
9 files changed, 302 insertions, 163 deletions
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 39efa962b..5f175b989 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt | |||
| @@ -33,6 +33,9 @@ add_executable(yuzu | |||
| 33 | configuration/configure_cpu.cpp | 33 | configuration/configure_cpu.cpp |
| 34 | configuration/configure_cpu.h | 34 | configuration/configure_cpu.h |
| 35 | configuration/configure_cpu.ui | 35 | configuration/configure_cpu.ui |
| 36 | configuration/configure_cpu_debug.cpp | ||
| 37 | configuration/configure_cpu_debug.h | ||
| 38 | configuration/configure_cpu_debug.ui | ||
| 36 | configuration/configure_debug.cpp | 39 | configuration/configure_debug.cpp |
| 37 | configuration/configure_debug.h | 40 | configuration/configure_debug.h |
| 38 | configuration/configure_debug.ui | 41 | configuration/configure_debug.ui |
diff --git a/src/yuzu/configuration/configure.ui b/src/yuzu/configuration/configure.ui index a23fd9435..5f5d8e571 100644 --- a/src/yuzu/configuration/configure.ui +++ b/src/yuzu/configuration/configure.ui | |||
| @@ -83,6 +83,11 @@ | |||
| 83 | <string>CPU</string> | 83 | <string>CPU</string> |
| 84 | </attribute> | 84 | </attribute> |
| 85 | </widget> | 85 | </widget> |
| 86 | <widget class="ConfigureCpuDebug" name="cpuDebugTab"> | ||
| 87 | <attribute name="title"> | ||
| 88 | <string>Debug</string> | ||
| 89 | </attribute> | ||
| 90 | </widget> | ||
| 86 | <widget class="ConfigureGraphics" name="graphicsTab"> | 91 | <widget class="ConfigureGraphics" name="graphicsTab"> |
| 87 | <attribute name="title"> | 92 | <attribute name="title"> |
| 88 | <string>Graphics</string> | 93 | <string>Graphics</string> |
| @@ -170,6 +175,12 @@ | |||
| 170 | <container>1</container> | 175 | <container>1</container> |
| 171 | </customwidget> | 176 | </customwidget> |
| 172 | <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> | ||
| 173 | <class>ConfigureGraphics</class> | 184 | <class>ConfigureGraphics</class> |
| 174 | <extends>QWidget</extends> | 185 | <extends>QWidget</extends> |
| 175 | <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 index 4fc392a7e..7493e5ffb 100644 --- a/src/yuzu/configuration/configure_cpu.cpp +++ b/src/yuzu/configuration/configure_cpu.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <QComboBox> | 5 | #include <QComboBox> |
| 6 | #include <QMessageBox> | ||
| 6 | 7 | ||
| 7 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 8 | #include "common/logging/log.h" | 9 | #include "common/logging/log.h" |
| @@ -16,8 +17,8 @@ ConfigureCpu::ConfigureCpu(QWidget* parent) : QWidget(parent), ui(new Ui::Config | |||
| 16 | 17 | ||
| 17 | SetConfiguration(); | 18 | SetConfiguration(); |
| 18 | 19 | ||
| 19 | connect(ui->accuracy, qOverload<int>(&QComboBox::currentIndexChanged), this, | 20 | connect(ui->accuracy, qOverload<int>(&QComboBox::activated), this, |
| 20 | &ConfigureCpu::UpdateGroups); | 21 | &ConfigureCpu::AccuracyUpdated); |
| 21 | } | 22 | } |
| 22 | 23 | ||
| 23 | ConfigureCpu::~ConfigureCpu() = default; | 24 | ConfigureCpu::~ConfigureCpu() = default; |
| @@ -27,50 +28,24 @@ void ConfigureCpu::SetConfiguration() { | |||
| 27 | 28 | ||
| 28 | ui->accuracy->setEnabled(runtime_lock); | 29 | ui->accuracy->setEnabled(runtime_lock); |
| 29 | ui->accuracy->setCurrentIndex(static_cast<int>(Settings::values.cpu_accuracy)); | 30 | ui->accuracy->setCurrentIndex(static_cast<int>(Settings::values.cpu_accuracy)); |
| 30 | UpdateGroups(static_cast<int>(Settings::values.cpu_accuracy)); | ||
| 31 | |||
| 32 | ui->cpuopt_page_tables->setEnabled(runtime_lock); | ||
| 33 | ui->cpuopt_page_tables->setChecked(Settings::values.cpuopt_page_tables); | ||
| 34 | ui->cpuopt_block_linking->setEnabled(runtime_lock); | ||
| 35 | ui->cpuopt_block_linking->setChecked(Settings::values.cpuopt_block_linking); | ||
| 36 | ui->cpuopt_return_stack_buffer->setEnabled(runtime_lock); | ||
| 37 | ui->cpuopt_return_stack_buffer->setChecked(Settings::values.cpuopt_return_stack_buffer); | ||
| 38 | ui->cpuopt_fast_dispatcher->setEnabled(runtime_lock); | ||
| 39 | ui->cpuopt_fast_dispatcher->setChecked(Settings::values.cpuopt_fast_dispatcher); | ||
| 40 | ui->cpuopt_context_elimination->setEnabled(runtime_lock); | ||
| 41 | ui->cpuopt_context_elimination->setChecked(Settings::values.cpuopt_context_elimination); | ||
| 42 | ui->cpuopt_const_prop->setEnabled(runtime_lock); | ||
| 43 | ui->cpuopt_const_prop->setChecked(Settings::values.cpuopt_const_prop); | ||
| 44 | ui->cpuopt_misc_ir->setEnabled(runtime_lock); | ||
| 45 | ui->cpuopt_misc_ir->setChecked(Settings::values.cpuopt_misc_ir); | ||
| 46 | ui->cpuopt_reduce_misalign_checks->setEnabled(runtime_lock); | ||
| 47 | ui->cpuopt_reduce_misalign_checks->setChecked(Settings::values.cpuopt_reduce_misalign_checks); | ||
| 48 | } | 31 | } |
| 49 | 32 | ||
| 50 | void ConfigureCpu::UpdateGroups(int index) { | 33 | void ConfigureCpu::AccuracyUpdated(int index) { |
| 51 | switch (index) { | 34 | if (static_cast<Settings::CPUAccuracy>(index) == Settings::CPUAccuracy::DebugMode) { |
| 52 | case 0: | 35 | const auto result = QMessageBox::warning(this, tr("Setting CPU to Debug Mode"), |
| 53 | default: | 36 | tr("CPU Debug Mode is only intended for developer " |
| 54 | ui->group_safe->setVisible(false); | 37 | "use. Are you sure you want to enable this?"), |
| 55 | break; | 38 | QMessageBox::Yes | QMessageBox::No); |
| 56 | case 1: | 39 | if (result == QMessageBox::No) { |
| 57 | ui->group_safe->setVisible(true); | 40 | ui->accuracy->setCurrentIndex(static_cast<int>(Settings::CPUAccuracy::Accurate)); |
| 58 | break; | 41 | return; |
| 42 | } | ||
| 59 | } | 43 | } |
| 60 | } | 44 | } |
| 61 | 45 | ||
| 62 | void ConfigureCpu::ApplyConfiguration() { | 46 | void ConfigureCpu::ApplyConfiguration() { |
| 63 | Settings::values.cpu_accuracy = | 47 | Settings::values.cpu_accuracy = |
| 64 | static_cast<Settings::CPUAccuracy>(ui->accuracy->currentIndex()); | 48 | static_cast<Settings::CPUAccuracy>(ui->accuracy->currentIndex()); |
| 65 | |||
| 66 | Settings::values.cpuopt_page_tables = ui->cpuopt_page_tables->isChecked(); | ||
| 67 | Settings::values.cpuopt_block_linking = ui->cpuopt_block_linking->isChecked(); | ||
| 68 | Settings::values.cpuopt_return_stack_buffer = ui->cpuopt_return_stack_buffer->isChecked(); | ||
| 69 | Settings::values.cpuopt_fast_dispatcher = ui->cpuopt_fast_dispatcher->isChecked(); | ||
| 70 | Settings::values.cpuopt_context_elimination = ui->cpuopt_context_elimination->isChecked(); | ||
| 71 | Settings::values.cpuopt_const_prop = ui->cpuopt_const_prop->isChecked(); | ||
| 72 | Settings::values.cpuopt_misc_ir = ui->cpuopt_misc_ir->isChecked(); | ||
| 73 | Settings::values.cpuopt_reduce_misalign_checks = ui->cpuopt_reduce_misalign_checks->isChecked(); | ||
| 74 | } | 49 | } |
| 75 | 50 | ||
| 76 | void ConfigureCpu::changeEvent(QEvent* event) { | 51 | void ConfigureCpu::changeEvent(QEvent* event) { |
diff --git a/src/yuzu/configuration/configure_cpu.h b/src/yuzu/configuration/configure_cpu.h index cf55980b0..e4741d3a4 100644 --- a/src/yuzu/configuration/configure_cpu.h +++ b/src/yuzu/configuration/configure_cpu.h | |||
| @@ -25,7 +25,7 @@ private: | |||
| 25 | void changeEvent(QEvent* event) override; | 25 | void changeEvent(QEvent* event) override; |
| 26 | void RetranslateUI(); | 26 | void RetranslateUI(); |
| 27 | 27 | ||
| 28 | void UpdateGroups(int index); | 28 | void AccuracyUpdated(int index); |
| 29 | 29 | ||
| 30 | void SetConfiguration(); | 30 | void SetConfiguration(); |
| 31 | 31 | ||
diff --git a/src/yuzu/configuration/configure_cpu.ui b/src/yuzu/configuration/configure_cpu.ui index 308e70356..bf6ea79bb 100644 --- a/src/yuzu/configuration/configure_cpu.ui +++ b/src/yuzu/configuration/configure_cpu.ui | |||
| @@ -40,7 +40,7 @@ | |||
| 40 | </item> | 40 | </item> |
| 41 | <item> | 41 | <item> |
| 42 | <property name="text"> | 42 | <property name="text"> |
| 43 | <string>Debugging Mode (Debugging ONLY)</string> | 43 | <string>Enable Debug Mode</string> |
| 44 | </property> | 44 | </property> |
| 45 | </item> | 45 | </item> |
| 46 | </widget> | 46 | </widget> |
| @@ -63,128 +63,6 @@ | |||
| 63 | </layout> | 63 | </layout> |
| 64 | </item> | 64 | </item> |
| 65 | <item> | 65 | <item> |
| 66 | <layout class="QVBoxLayout"> | ||
| 67 | <item> | ||
| 68 | <widget class="QGroupBox" name="group_safe"> | ||
| 69 | <property name="title"> | ||
| 70 | <string>Safe CPU Optimizations</string> | ||
| 71 | </property> | ||
| 72 | <layout class="QVBoxLayout"> | ||
| 73 | <item> | ||
| 74 | <widget class="QLabel"> | ||
| 75 | <property name="wordWrap"> | ||
| 76 | <bool>1</bool> | ||
| 77 | </property> | ||
| 78 | <property name="text"> | ||
| 79 | <string>Keep all of these enabled. For debugging only.</string> | ||
| 80 | </property> | ||
| 81 | </widget> | ||
| 82 | </item> | ||
| 83 | <item> | ||
| 84 | <widget class="QCheckBox" name="cpuopt_page_tables"> | ||
| 85 | <property name="text"> | ||
| 86 | <string>Enable inline page tables</string> | ||
| 87 | </property> | ||
| 88 | <property name="toolTip"> | ||
| 89 | <string> | ||
| 90 | <div style="white-space: nowrap">This optimization speeds up memory accesses by the guest program.</div> | ||
| 91 | <div style="white-space: nowrap">Enabling it inlines accesses to PageTable::pointers into emitted code.</div> | ||
| 92 | <div style="white-space: nowrap">Disabling this forces all memory accesses to go through the Memory::Read/Memory::Write functions.</div> | ||
| 93 | </string> | ||
| 94 | </property> | ||
| 95 | </widget> | ||
| 96 | </item> | ||
| 97 | <item> | ||
| 98 | <widget class="QCheckBox" name="cpuopt_block_linking"> | ||
| 99 | <property name="text"> | ||
| 100 | <string>Enable block linking</string> | ||
| 101 | </property> | ||
| 102 | <property name="toolTip"> | ||
| 103 | <string> | ||
| 104 | <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> | ||
| 105 | </string> | ||
| 106 | </property> | ||
| 107 | </widget> | ||
| 108 | </item> | ||
| 109 | <item> | ||
| 110 | <widget class="QCheckBox" name="cpuopt_return_stack_buffer"> | ||
| 111 | <property name="text"> | ||
| 112 | <string>Enable return stack buffer</string> | ||
| 113 | </property> | ||
| 114 | <property name="toolTip"> | ||
| 115 | <string> | ||
| 116 | <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> | ||
| 117 | </string> | ||
| 118 | </property> | ||
| 119 | </widget> | ||
| 120 | </item> | ||
| 121 | <item> | ||
| 122 | <widget class="QCheckBox" name="cpuopt_fast_dispatcher"> | ||
| 123 | <property name="text"> | ||
| 124 | <string>Enable fast dispatcher</string> | ||
| 125 | </property> | ||
| 126 | <property name="toolTip"> | ||
| 127 | <string> | ||
| 128 | <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> | ||
| 129 | </string> | ||
| 130 | </property> | ||
| 131 | </widget> | ||
| 132 | </item> | ||
| 133 | <item> | ||
| 134 | <widget class="QCheckBox" name="cpuopt_context_elimination"> | ||
| 135 | <property name="text"> | ||
| 136 | <string>Enable context elimination</string> | ||
| 137 | </property> | ||
| 138 | <property name="toolTip"> | ||
| 139 | <string> | ||
| 140 | <div>Enables an IR optimization that reduces unnecessary accesses to the CPU context structure.</div> | ||
| 141 | </string> | ||
| 142 | </property> | ||
| 143 | </widget> | ||
| 144 | </item> | ||
| 145 | <item> | ||
| 146 | <widget class="QCheckBox" name="cpuopt_const_prop"> | ||
| 147 | <property name="text"> | ||
| 148 | <string>Enable constant propagation</string> | ||
| 149 | </property> | ||
| 150 | <property name="toolTip"> | ||
| 151 | <string> | ||
| 152 | <div>Enables IR optimizations that involve constant propagation.</div> | ||
| 153 | </string> | ||
| 154 | </property> | ||
| 155 | </widget> | ||
| 156 | </item> | ||
| 157 | <item> | ||
| 158 | <widget class="QCheckBox" name="cpuopt_misc_ir"> | ||
| 159 | <property name="text"> | ||
| 160 | <string>Enable miscellaneous optimizations</string> | ||
| 161 | </property> | ||
| 162 | <property name="toolTip"> | ||
| 163 | <string> | ||
| 164 | <div>Enables miscellaneous IR optimizations.</div> | ||
| 165 | </string> | ||
| 166 | </property> | ||
| 167 | </widget> | ||
| 168 | </item> | ||
| 169 | <item> | ||
| 170 | <widget class="QCheckBox" name="cpuopt_reduce_misalign_checks"> | ||
| 171 | <property name="text"> | ||
| 172 | <string>Enable misalignment check reduction</string> | ||
| 173 | </property> | ||
| 174 | <property name="toolTip"> | ||
| 175 | <string> | ||
| 176 | <div style="white-space: nowrap">When enabled, a misalignment is only triggered when an access crosses a page boundary.</div> | ||
| 177 | <div style="white-space: nowrap">When disabled, a misalignment is triggered on all misaligned accesses.</div> | ||
| 178 | </string> | ||
| 179 | </property> | ||
| 180 | </widget> | ||
| 181 | </item> | ||
| 182 | </layout> | ||
| 183 | </widget> | ||
| 184 | </item> | ||
| 185 | </layout> | ||
| 186 | </item> | ||
| 187 | <item> | ||
| 188 | <spacer name="verticalSpacer"> | 66 | <spacer name="verticalSpacer"> |
| 189 | <property name="orientation"> | 67 | <property name="orientation"> |
| 190 | <enum>Qt::Vertical</enum> | 68 | <enum>Qt::Vertical</enum> |
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_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index a0f49c282..a5afb354f 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp | |||
| @@ -43,6 +43,7 @@ void ConfigureDialog::ApplyConfiguration() { | |||
| 43 | ui->inputTab->ApplyConfiguration(); | 43 | ui->inputTab->ApplyConfiguration(); |
| 44 | ui->hotkeysTab->ApplyConfiguration(registry); | 44 | ui->hotkeysTab->ApplyConfiguration(registry); |
| 45 | ui->cpuTab->ApplyConfiguration(); | 45 | ui->cpuTab->ApplyConfiguration(); |
| 46 | ui->cpuDebugTab->ApplyConfiguration(); | ||
| 46 | ui->graphicsTab->ApplyConfiguration(); | 47 | ui->graphicsTab->ApplyConfiguration(); |
| 47 | ui->graphicsAdvancedTab->ApplyConfiguration(); | 48 | ui->graphicsAdvancedTab->ApplyConfiguration(); |
| 48 | ui->audioTab->ApplyConfiguration(); | 49 | ui->audioTab->ApplyConfiguration(); |
| @@ -80,7 +81,7 @@ void ConfigureDialog::PopulateSelectionList() { | |||
| 80 | const std::array<std::pair<QString, QList<QWidget*>>, 6> items{ | 81 | const std::array<std::pair<QString, QList<QWidget*>>, 6> items{ |
| 81 | {{tr("General"), {ui->generalTab, ui->webTab, ui->debugTab, ui->uiTab}}, | 82 | {{tr("General"), {ui->generalTab, ui->webTab, ui->debugTab, ui->uiTab}}, |
| 82 | {tr("System"), {ui->systemTab, ui->profileManagerTab, ui->serviceTab, ui->filesystemTab}}, | 83 | {tr("System"), {ui->systemTab, ui->profileManagerTab, ui->serviceTab, ui->filesystemTab}}, |
| 83 | {tr("CPU"), {ui->cpuTab}}, | 84 | {tr("CPU"), {ui->cpuTab, ui->cpuDebugTab}}, |
| 84 | {tr("Graphics"), {ui->graphicsTab, ui->graphicsAdvancedTab}}, | 85 | {tr("Graphics"), {ui->graphicsTab, ui->graphicsAdvancedTab}}, |
| 85 | {tr("Audio"), {ui->audioTab}}, | 86 | {tr("Audio"), {ui->audioTab}}, |
| 86 | {tr("Controls"), {ui->inputTab, ui->hotkeysTab}}}, | 87 | {tr("Controls"), {ui->inputTab, ui->hotkeysTab}}}, |
| @@ -110,6 +111,7 @@ void ConfigureDialog::UpdateVisibleTabs() { | |||
| 110 | {ui->inputTab, tr("Input")}, | 111 | {ui->inputTab, tr("Input")}, |
| 111 | {ui->hotkeysTab, tr("Hotkeys")}, | 112 | {ui->hotkeysTab, tr("Hotkeys")}, |
| 112 | {ui->cpuTab, tr("CPU")}, | 113 | {ui->cpuTab, tr("CPU")}, |
| 114 | {ui->cpuDebugTab, tr("Debug")}, | ||
| 113 | {ui->graphicsTab, tr("Graphics")}, | 115 | {ui->graphicsTab, tr("Graphics")}, |
| 114 | {ui->graphicsAdvancedTab, tr("Advanced")}, | 116 | {ui->graphicsAdvancedTab, tr("Advanced")}, |
| 115 | {ui->audioTab, tr("Audio")}, | 117 | {ui->audioTab, tr("Audio")}, |