diff options
| author | 2021-04-13 18:38:10 -0700 | |
|---|---|---|
| committer | 2021-04-14 16:24:02 -0700 | |
| commit | c6c0771b12ff7e59ec03b1a25c11233847ef0cc6 (patch) | |
| tree | 053762f2eb49d0b2dc236a141756d2c59cdb0910 /src | |
| parent | Merge pull request #6190 from lioncash/constfn2 (diff) | |
| download | yuzu-c6c0771b12ff7e59ec03b1a25c11233847ef0cc6.tar.gz yuzu-c6c0771b12ff7e59ec03b1a25c11233847ef0cc6.tar.xz yuzu-c6c0771b12ff7e59ec03b1a25c11233847ef0cc6.zip | |
core: settings: Add setting for debug assertions and disable by default.
- This is a developer-only setting and no longer needs to be enabled by default.
- Also adds "use_auto_stub" setting to SDL frontend while we are here.
- Supersedes #1340.
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/assert.cpp | 7 | ||||
| -rw-r--r-- | src/core/settings.h | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 3 | ||||
| -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_cmd/config.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 6 |
7 files changed, 28 insertions, 2 deletions
diff --git a/src/common/assert.cpp b/src/common/assert.cpp index d7d91b96b..4f599af55 100644 --- a/src/common/assert.cpp +++ b/src/common/assert.cpp | |||
| @@ -3,9 +3,12 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/assert.h" | 5 | #include "common/assert.h" |
| 6 | |||
| 7 | #include "common/common_funcs.h" | 6 | #include "common/common_funcs.h" |
| 8 | 7 | ||
| 8 | #include "core/settings.h" | ||
| 9 | |||
| 9 | void assert_handle_failure() { | 10 | void assert_handle_failure() { |
| 10 | Crash(); | 11 | if (Settings::values.use_debug_asserts) { |
| 12 | Crash(); | ||
| 13 | } | ||
| 11 | } | 14 | } |
diff --git a/src/core/settings.h b/src/core/settings.h index 6c03a6ea9..0b7d28421 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -223,6 +223,7 @@ struct Values { | |||
| 223 | bool quest_flag; | 223 | bool quest_flag; |
| 224 | bool disable_macro_jit; | 224 | bool disable_macro_jit; |
| 225 | bool extended_logging; | 225 | bool extended_logging; |
| 226 | bool use_debug_asserts; | ||
| 226 | bool use_auto_stub; | 227 | bool use_auto_stub; |
| 227 | 228 | ||
| 228 | // Miscellaneous | 229 | // Miscellaneous |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 50ea15e2a..16ea2b5f5 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -641,6 +641,8 @@ void Config::ReadDebuggingValues() { | |||
| 641 | ReadSetting(QStringLiteral("disable_macro_jit"), false).toBool(); | 641 | ReadSetting(QStringLiteral("disable_macro_jit"), false).toBool(); |
| 642 | Settings::values.extended_logging = | 642 | Settings::values.extended_logging = |
| 643 | ReadSetting(QStringLiteral("extended_logging"), false).toBool(); | 643 | ReadSetting(QStringLiteral("extended_logging"), false).toBool(); |
| 644 | Settings::values.use_debug_asserts = | ||
| 645 | ReadSetting(QStringLiteral("use_debug_asserts"), false).toBool(); | ||
| 644 | Settings::values.use_auto_stub = ReadSetting(QStringLiteral("use_auto_stub"), false).toBool(); | 646 | Settings::values.use_auto_stub = ReadSetting(QStringLiteral("use_auto_stub"), false).toBool(); |
| 645 | 647 | ||
| 646 | qt_config->endGroup(); | 648 | qt_config->endGroup(); |
| @@ -1238,6 +1240,7 @@ void Config::SaveDebuggingValues() { | |||
| 1238 | WriteSetting(QStringLiteral("dump_exefs"), Settings::values.dump_exefs, false); | 1240 | WriteSetting(QStringLiteral("dump_exefs"), Settings::values.dump_exefs, false); |
| 1239 | WriteSetting(QStringLiteral("dump_nso"), Settings::values.dump_nso, false); | 1241 | WriteSetting(QStringLiteral("dump_nso"), Settings::values.dump_nso, false); |
| 1240 | WriteSetting(QStringLiteral("quest_flag"), Settings::values.quest_flag, false); | 1242 | WriteSetting(QStringLiteral("quest_flag"), Settings::values.quest_flag, false); |
| 1243 | WriteSetting(QStringLiteral("use_debug_asserts"), Settings::values.use_debug_asserts, false); | ||
| 1241 | WriteSetting(QStringLiteral("disable_macro_jit"), Settings::values.disable_macro_jit, false); | 1244 | WriteSetting(QStringLiteral("disable_macro_jit"), Settings::values.disable_macro_jit, false); |
| 1242 | 1245 | ||
| 1243 | qt_config->endGroup(); | 1246 | qt_config->endGroup(); |
diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index 2a5b3f5e7..db8fdc595 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp | |||
| @@ -34,6 +34,7 @@ void ConfigureDebug::SetConfiguration() { | |||
| 34 | ui->homebrew_args_edit->setText(QString::fromStdString(Settings::values.program_args)); | 34 | ui->homebrew_args_edit->setText(QString::fromStdString(Settings::values.program_args)); |
| 35 | ui->reporting_services->setChecked(Settings::values.reporting_services); | 35 | ui->reporting_services->setChecked(Settings::values.reporting_services); |
| 36 | ui->quest_flag->setChecked(Settings::values.quest_flag); | 36 | ui->quest_flag->setChecked(Settings::values.quest_flag); |
| 37 | ui->use_debug_asserts->setChecked(Settings::values.use_debug_asserts); | ||
| 37 | ui->use_auto_stub->setChecked(Settings::values.use_auto_stub); | 38 | ui->use_auto_stub->setChecked(Settings::values.use_auto_stub); |
| 38 | ui->enable_graphics_debugging->setEnabled(!Core::System::GetInstance().IsPoweredOn()); | 39 | ui->enable_graphics_debugging->setEnabled(!Core::System::GetInstance().IsPoweredOn()); |
| 39 | ui->enable_graphics_debugging->setChecked(Settings::values.renderer_debug); | 40 | ui->enable_graphics_debugging->setChecked(Settings::values.renderer_debug); |
| @@ -48,6 +49,7 @@ void ConfigureDebug::ApplyConfiguration() { | |||
| 48 | Settings::values.program_args = ui->homebrew_args_edit->text().toStdString(); | 49 | Settings::values.program_args = ui->homebrew_args_edit->text().toStdString(); |
| 49 | Settings::values.reporting_services = ui->reporting_services->isChecked(); | 50 | Settings::values.reporting_services = ui->reporting_services->isChecked(); |
| 50 | Settings::values.quest_flag = ui->quest_flag->isChecked(); | 51 | Settings::values.quest_flag = ui->quest_flag->isChecked(); |
| 52 | Settings::values.use_debug_asserts = ui->use_debug_asserts->isChecked(); | ||
| 51 | Settings::values.use_auto_stub = ui->use_auto_stub->isChecked(); | 53 | Settings::values.use_auto_stub = ui->use_auto_stub->isChecked(); |
| 52 | Settings::values.renderer_debug = ui->enable_graphics_debugging->isChecked(); | 54 | Settings::values.renderer_debug = ui->enable_graphics_debugging->isChecked(); |
| 53 | Settings::values.disable_macro_jit = ui->disable_macro_jit->isChecked(); | 55 | Settings::values.disable_macro_jit = ui->disable_macro_jit->isChecked(); |
diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui index ae48b728c..d812858b6 100644 --- a/src/yuzu/configuration/configure_debug.ui +++ b/src/yuzu/configuration/configure_debug.ui | |||
| @@ -186,6 +186,13 @@ | |||
| 186 | </widget> | 186 | </widget> |
| 187 | </item> | 187 | </item> |
| 188 | <item> | 188 | <item> |
| 189 | <widget class="QCheckBox" name="use_debug_asserts"> | ||
| 190 | <property name="text"> | ||
| 191 | <string>Enable Debug Asserts</string> | ||
| 192 | </property> | ||
| 193 | </widget> | ||
| 194 | </item> | ||
| 195 | <item> | ||
| 189 | <widget class="QCheckBox" name="use_auto_stub"> | 196 | <widget class="QCheckBox" name="use_auto_stub"> |
| 190 | <property name="text"> | 197 | <property name="text"> |
| 191 | <string>Enable Auto-Stub</string> | 198 | <string>Enable Auto-Stub</string> |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 43877fc98..69732ee51 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -428,6 +428,10 @@ 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.use_debug_asserts = | ||
| 432 | sdl2_config->GetBoolean("Debugging", "use_debug_asserts", false); | ||
| 433 | Settings::values.use_auto_stub = sdl2_config->GetBoolean("Debugging", "use_auto_stub", false); | ||
| 434 | |||
| 431 | Settings::values.disable_macro_jit = | 435 | Settings::values.disable_macro_jit = |
| 432 | sdl2_config->GetBoolean("Debugging", "disable_macro_jit", false); | 436 | sdl2_config->GetBoolean("Debugging", "disable_macro_jit", false); |
| 433 | 437 | ||
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 3ee0e037d..4ce8e08e4 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -325,6 +325,12 @@ dump_nso=false | |||
| 325 | # Determines whether or not yuzu will report to the game that the emulated console is in Kiosk Mode | 325 | # Determines whether or not yuzu will report to the game that the emulated console is in Kiosk Mode |
| 326 | # false: Retail/Normal Mode (default), true: Kiosk Mode | 326 | # false: Retail/Normal Mode (default), true: Kiosk Mode |
| 327 | quest_flag = | 327 | quest_flag = |
| 328 | # Determines whether debug asserts should be enabled, which will throw an exception on asserts. | ||
| 329 | # false: Disabled (default), true: Enabled | ||
| 330 | use_debug_asserts = | ||
| 331 | # Determines whether unimplemented HLE service calls should be automatically stubbed. | ||
| 332 | # false: Disabled (default), true: Enabled | ||
| 333 | use_auto_stub = | ||
| 328 | # Enables/Disables the macro JIT compiler | 334 | # Enables/Disables the macro JIT compiler |
| 329 | disable_macro_jit=false | 335 | disable_macro_jit=false |
| 330 | 336 | ||