diff options
| author | 2021-06-06 09:57:24 +0200 | |
|---|---|---|
| committer | 2021-06-11 17:27:17 +0200 | |
| commit | 5ba28325b262d44fcd7721aa00074955bd794015 (patch) | |
| tree | 1c388684ccc0ef52b124145cf3dfe98d5d427980 | |
| parent | common/host_memory: Optimize for huge tables. (diff) | |
| download | yuzu-5ba28325b262d44fcd7721aa00074955bd794015.tar.gz yuzu-5ba28325b262d44fcd7721aa00074955bd794015.tar.xz yuzu-5ba28325b262d44fcd7721aa00074955bd794015.zip | |
General: Add settings for fastmem and disabling adress space check.
Diffstat (limited to '')
| -rw-r--r-- | src/common/settings.cpp | 8 | ||||
| -rw-r--r-- | src/common/settings.h | 4 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_32.cpp | 5 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.cpp | 8 | ||||
| -rw-r--r-- | src/core/memory.cpp | 14 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 7 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.cpp | 9 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.h | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.ui | 12 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu_debug.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu_debug.ui | 14 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 4 |
12 files changed, 83 insertions, 6 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index bcb4e4be1..360e878d6 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -90,6 +90,13 @@ bool IsGPULevelHigh() { | |||
| 90 | values.gpu_accuracy.GetValue() == GPUAccuracy::High; | 90 | values.gpu_accuracy.GetValue() == GPUAccuracy::High; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | bool IsFastmemEnabled() { | ||
| 94 | if (values.cpu_accuracy.GetValue() == CPUAccuracy::DebugMode) { | ||
| 95 | return values.cpuopt_fastmem; | ||
| 96 | } | ||
| 97 | return true; | ||
| 98 | } | ||
| 99 | |||
| 93 | float Volume() { | 100 | float Volume() { |
| 94 | if (values.audio_muted) { | 101 | if (values.audio_muted) { |
| 95 | return 0.0f; | 102 | return 0.0f; |
| @@ -115,6 +122,7 @@ void RestoreGlobalState(bool is_powered_on) { | |||
| 115 | values.cpuopt_unsafe_unfuse_fma.SetGlobal(true); | 122 | values.cpuopt_unsafe_unfuse_fma.SetGlobal(true); |
| 116 | values.cpuopt_unsafe_reduce_fp_error.SetGlobal(true); | 123 | values.cpuopt_unsafe_reduce_fp_error.SetGlobal(true); |
| 117 | values.cpuopt_unsafe_inaccurate_nan.SetGlobal(true); | 124 | values.cpuopt_unsafe_inaccurate_nan.SetGlobal(true); |
| 125 | values.cpuopt_unsafe_fastmem_check.SetGlobal(true); | ||
| 118 | 126 | ||
| 119 | // Renderer | 127 | // Renderer |
| 120 | values.renderer_backend.SetGlobal(true); | 128 | values.renderer_backend.SetGlobal(true); |
diff --git a/src/common/settings.h b/src/common/settings.h index 48085b9a9..1af8c5ac2 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -125,10 +125,12 @@ struct Values { | |||
| 125 | bool cpuopt_const_prop; | 125 | bool cpuopt_const_prop; |
| 126 | bool cpuopt_misc_ir; | 126 | bool cpuopt_misc_ir; |
| 127 | bool cpuopt_reduce_misalign_checks; | 127 | bool cpuopt_reduce_misalign_checks; |
| 128 | bool cpuopt_fastmem; | ||
| 128 | 129 | ||
| 129 | Setting<bool> cpuopt_unsafe_unfuse_fma; | 130 | Setting<bool> cpuopt_unsafe_unfuse_fma; |
| 130 | Setting<bool> cpuopt_unsafe_reduce_fp_error; | 131 | Setting<bool> cpuopt_unsafe_reduce_fp_error; |
| 131 | Setting<bool> cpuopt_unsafe_inaccurate_nan; | 132 | Setting<bool> cpuopt_unsafe_inaccurate_nan; |
| 133 | Setting<bool> cpuopt_unsafe_fastmem_check; | ||
| 132 | 134 | ||
| 133 | // Renderer | 135 | // Renderer |
| 134 | Setting<RendererBackend> renderer_backend; | 136 | Setting<RendererBackend> renderer_backend; |
| @@ -249,6 +251,8 @@ void SetConfiguringGlobal(bool is_global); | |||
| 249 | bool IsGPULevelExtreme(); | 251 | bool IsGPULevelExtreme(); |
| 250 | bool IsGPULevelHigh(); | 252 | bool IsGPULevelHigh(); |
| 251 | 253 | ||
| 254 | bool IsFastmemEnabled(); | ||
| 255 | |||
| 252 | float Volume(); | 256 | float Volume(); |
| 253 | 257 | ||
| 254 | std::string GetTimeZoneString(); | 258 | std::string GetTimeZoneString(); |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index fb128f735..c8f6dc765 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp | |||
| @@ -144,7 +144,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* | |||
| 144 | 144 | ||
| 145 | // Code cache size | 145 | // Code cache size |
| 146 | config.code_cache_size = 512 * 1024 * 1024; | 146 | config.code_cache_size = 512 * 1024 * 1024; |
| 147 | config.far_code_offset = 256 * 1024 * 1024; | 147 | config.far_code_offset = 400 * 1024 * 1024; |
| 148 | 148 | ||
| 149 | // Safe optimizations | 149 | // Safe optimizations |
| 150 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::DebugMode) { | 150 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::DebugMode) { |
| @@ -172,6 +172,9 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* | |||
| 172 | if (!Settings::values.cpuopt_reduce_misalign_checks) { | 172 | if (!Settings::values.cpuopt_reduce_misalign_checks) { |
| 173 | config.only_detect_misalignment_via_page_table_on_page_boundary = false; | 173 | config.only_detect_misalignment_via_page_table_on_page_boundary = false; |
| 174 | } | 174 | } |
| 175 | if (!Settings::values.cpuopt_fastmem) { | ||
| 176 | config.fastmem_pointer = nullptr; | ||
| 177 | } | ||
| 175 | } | 178 | } |
| 176 | 179 | ||
| 177 | // Unsafe optimizations | 180 | // Unsafe optimizations |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index b0ac8cf8a..ba524cd05 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp | |||
| @@ -185,7 +185,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* | |||
| 185 | 185 | ||
| 186 | // Code cache size | 186 | // Code cache size |
| 187 | config.code_cache_size = 512 * 1024 * 1024; | 187 | config.code_cache_size = 512 * 1024 * 1024; |
| 188 | config.far_code_offset = 256 * 1024 * 1024; | 188 | config.far_code_offset = 400 * 1024 * 1024; |
| 189 | 189 | ||
| 190 | // Safe optimizations | 190 | // Safe optimizations |
| 191 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::DebugMode) { | 191 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::DebugMode) { |
| @@ -213,6 +213,9 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* | |||
| 213 | if (!Settings::values.cpuopt_reduce_misalign_checks) { | 213 | if (!Settings::values.cpuopt_reduce_misalign_checks) { |
| 214 | config.only_detect_misalignment_via_page_table_on_page_boundary = false; | 214 | config.only_detect_misalignment_via_page_table_on_page_boundary = false; |
| 215 | } | 215 | } |
| 216 | if (!Settings::values.cpuopt_fastmem) { | ||
| 217 | config.fastmem_pointer = nullptr; | ||
| 218 | } | ||
| 216 | } | 219 | } |
| 217 | 220 | ||
| 218 | // Unsafe optimizations | 221 | // Unsafe optimizations |
| @@ -227,6 +230,9 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* | |||
| 227 | if (Settings::values.cpuopt_unsafe_inaccurate_nan.GetValue()) { | 230 | if (Settings::values.cpuopt_unsafe_inaccurate_nan.GetValue()) { |
| 228 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_InaccurateNaN; | 231 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_InaccurateNaN; |
| 229 | } | 232 | } |
| 233 | if (Settings::values.cpuopt_unsafe_fastmem_check.GetValue()) { | ||
| 234 | config.fastmem_address_space_bits = 64; | ||
| 235 | } | ||
| 230 | } | 236 | } |
| 231 | 237 | ||
| 232 | return std::make_shared<Dynarmic::A64::Jit>(config); | 238 | return std::make_shared<Dynarmic::A64::Jit>(config); |
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 79468e4dc..f285c6f63 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp | |||
| @@ -47,7 +47,9 @@ struct Memory::Impl { | |||
| 47 | "Out of bounds target: {:016X}", target); | 47 | "Out of bounds target: {:016X}", target); |
| 48 | MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, Common::PageType::Memory); | 48 | MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, Common::PageType::Memory); |
| 49 | 49 | ||
| 50 | system.DeviceMemory().buffer.Map(base, target - DramMemoryMap::Base, size); | 50 | if (Settings::IsFastmemEnabled()) { |
| 51 | system.DeviceMemory().buffer.Map(base, target - DramMemoryMap::Base, size); | ||
| 52 | } | ||
| 51 | } | 53 | } |
| 52 | 54 | ||
| 53 | void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) { | 55 | void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) { |
| @@ -55,7 +57,9 @@ struct Memory::Impl { | |||
| 55 | ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:016X}", base); | 57 | ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:016X}", base); |
| 56 | MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, 0, Common::PageType::Unmapped); | 58 | MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, 0, Common::PageType::Unmapped); |
| 57 | 59 | ||
| 58 | system.DeviceMemory().buffer.Unmap(base, size); | 60 | if (Settings::IsFastmemEnabled()) { |
| 61 | system.DeviceMemory().buffer.Unmap(base, size); | ||
| 62 | } | ||
| 59 | } | 63 | } |
| 60 | 64 | ||
| 61 | bool IsValidVirtualAddress(const Kernel::KProcess& process, const VAddr vaddr) const { | 65 | bool IsValidVirtualAddress(const Kernel::KProcess& process, const VAddr vaddr) const { |
| @@ -475,8 +479,10 @@ struct Memory::Impl { | |||
| 475 | return; | 479 | return; |
| 476 | } | 480 | } |
| 477 | 481 | ||
| 478 | const bool is_read_enable = Settings::IsGPULevelHigh() || !cached; | 482 | if (Settings::IsFastmemEnabled()) { |
| 479 | system.DeviceMemory().buffer.Protect(vaddr, size, is_read_enable, !cached); | 483 | const bool is_read_enable = Settings::IsGPULevelHigh() || !cached; |
| 484 | system.DeviceMemory().buffer.Protect(vaddr, size, is_read_enable, !cached); | ||
| 485 | } | ||
| 480 | 486 | ||
| 481 | // Iterate over a contiguous CPU address space, which corresponds to the specified GPU | 487 | // Iterate over a contiguous CPU address space, which corresponds to the specified GPU |
| 482 | // address space, marking the region as un/cached. The region is marked un/cached at a | 488 | // address space, marking the region as un/cached. The region is marked un/cached at a |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index e9d4bef60..a59b36e13 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -756,6 +756,8 @@ void Config::ReadCpuValues() { | |||
| 756 | QStringLiteral("cpuopt_unsafe_reduce_fp_error"), true); | 756 | QStringLiteral("cpuopt_unsafe_reduce_fp_error"), true); |
| 757 | ReadSettingGlobal(Settings::values.cpuopt_unsafe_inaccurate_nan, | 757 | ReadSettingGlobal(Settings::values.cpuopt_unsafe_inaccurate_nan, |
| 758 | QStringLiteral("cpuopt_unsafe_inaccurate_nan"), true); | 758 | QStringLiteral("cpuopt_unsafe_inaccurate_nan"), true); |
| 759 | ReadSettingGlobal(Settings::values.cpuopt_unsafe_fastmem_check, | ||
| 760 | QStringLiteral("cpuopt_unsafe_fastmem_check"), true); | ||
| 759 | 761 | ||
| 760 | if (global) { | 762 | if (global) { |
| 761 | Settings::values.cpuopt_page_tables = | 763 | Settings::values.cpuopt_page_tables = |
| @@ -774,6 +776,8 @@ void Config::ReadCpuValues() { | |||
| 774 | ReadSetting(QStringLiteral("cpuopt_misc_ir"), true).toBool(); | 776 | ReadSetting(QStringLiteral("cpuopt_misc_ir"), true).toBool(); |
| 775 | Settings::values.cpuopt_reduce_misalign_checks = | 777 | Settings::values.cpuopt_reduce_misalign_checks = |
| 776 | ReadSetting(QStringLiteral("cpuopt_reduce_misalign_checks"), true).toBool(); | 778 | ReadSetting(QStringLiteral("cpuopt_reduce_misalign_checks"), true).toBool(); |
| 779 | Settings::values.cpuopt_fastmem = | ||
| 780 | ReadSetting(QStringLiteral("cpuopt_fastmem"), true).toBool(); | ||
| 777 | } | 781 | } |
| 778 | 782 | ||
| 779 | qt_config->endGroup(); | 783 | qt_config->endGroup(); |
| @@ -1332,6 +1336,8 @@ void Config::SaveCpuValues() { | |||
| 1332 | Settings::values.cpuopt_unsafe_reduce_fp_error, true); | 1336 | Settings::values.cpuopt_unsafe_reduce_fp_error, true); |
| 1333 | WriteSettingGlobal(QStringLiteral("cpuopt_unsafe_inaccurate_nan"), | 1337 | WriteSettingGlobal(QStringLiteral("cpuopt_unsafe_inaccurate_nan"), |
| 1334 | Settings::values.cpuopt_unsafe_inaccurate_nan, true); | 1338 | Settings::values.cpuopt_unsafe_inaccurate_nan, true); |
| 1339 | WriteSettingGlobal(QStringLiteral("cpuopt_unsafe_fastmem_check"), | ||
| 1340 | Settings::values.cpuopt_unsafe_fastmem_check, true); | ||
| 1335 | 1341 | ||
| 1336 | if (global) { | 1342 | if (global) { |
| 1337 | WriteSetting(QStringLiteral("cpuopt_page_tables"), Settings::values.cpuopt_page_tables, | 1343 | WriteSetting(QStringLiteral("cpuopt_page_tables"), Settings::values.cpuopt_page_tables, |
| @@ -1348,6 +1354,7 @@ void Config::SaveCpuValues() { | |||
| 1348 | WriteSetting(QStringLiteral("cpuopt_misc_ir"), Settings::values.cpuopt_misc_ir, true); | 1354 | WriteSetting(QStringLiteral("cpuopt_misc_ir"), Settings::values.cpuopt_misc_ir, true); |
| 1349 | WriteSetting(QStringLiteral("cpuopt_reduce_misalign_checks"), | 1355 | WriteSetting(QStringLiteral("cpuopt_reduce_misalign_checks"), |
| 1350 | Settings::values.cpuopt_reduce_misalign_checks, true); | 1356 | Settings::values.cpuopt_reduce_misalign_checks, true); |
| 1357 | WriteSetting(QStringLiteral("cpuopt_fastmem"), Settings::values.cpuopt_fastmem, true); | ||
| 1351 | } | 1358 | } |
| 1352 | 1359 | ||
| 1353 | qt_config->endGroup(); | 1360 | qt_config->endGroup(); |
diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cpp index 525c42ff0..22219cbad 100644 --- a/src/yuzu/configuration/configure_cpu.cpp +++ b/src/yuzu/configuration/configure_cpu.cpp | |||
| @@ -35,12 +35,15 @@ void ConfigureCpu::SetConfiguration() { | |||
| 35 | ui->cpuopt_unsafe_unfuse_fma->setEnabled(runtime_lock); | 35 | ui->cpuopt_unsafe_unfuse_fma->setEnabled(runtime_lock); |
| 36 | ui->cpuopt_unsafe_reduce_fp_error->setEnabled(runtime_lock); | 36 | ui->cpuopt_unsafe_reduce_fp_error->setEnabled(runtime_lock); |
| 37 | ui->cpuopt_unsafe_inaccurate_nan->setEnabled(runtime_lock); | 37 | ui->cpuopt_unsafe_inaccurate_nan->setEnabled(runtime_lock); |
| 38 | ui->cpuopt_unsafe_fastmem_check->setEnabled(runtime_lock); | ||
| 38 | 39 | ||
| 39 | ui->cpuopt_unsafe_unfuse_fma->setChecked(Settings::values.cpuopt_unsafe_unfuse_fma.GetValue()); | 40 | ui->cpuopt_unsafe_unfuse_fma->setChecked(Settings::values.cpuopt_unsafe_unfuse_fma.GetValue()); |
| 40 | ui->cpuopt_unsafe_reduce_fp_error->setChecked( | 41 | ui->cpuopt_unsafe_reduce_fp_error->setChecked( |
| 41 | Settings::values.cpuopt_unsafe_reduce_fp_error.GetValue()); | 42 | Settings::values.cpuopt_unsafe_reduce_fp_error.GetValue()); |
| 42 | ui->cpuopt_unsafe_inaccurate_nan->setChecked( | 43 | ui->cpuopt_unsafe_inaccurate_nan->setChecked( |
| 43 | Settings::values.cpuopt_unsafe_inaccurate_nan.GetValue()); | 44 | Settings::values.cpuopt_unsafe_inaccurate_nan.GetValue()); |
| 45 | ui->cpuopt_unsafe_fastmem_check->setChecked( | ||
| 46 | Settings::values.cpuopt_unsafe_fastmem_check.GetValue()); | ||
| 44 | 47 | ||
| 45 | if (Settings::IsConfiguringGlobal()) { | 48 | if (Settings::IsConfiguringGlobal()) { |
| 46 | ui->accuracy->setCurrentIndex(static_cast<int>(Settings::values.cpu_accuracy.GetValue())); | 49 | ui->accuracy->setCurrentIndex(static_cast<int>(Settings::values.cpu_accuracy.GetValue())); |
| @@ -84,6 +87,9 @@ void ConfigureCpu::ApplyConfiguration() { | |||
| 84 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.cpuopt_unsafe_inaccurate_nan, | 87 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.cpuopt_unsafe_inaccurate_nan, |
| 85 | ui->cpuopt_unsafe_inaccurate_nan, | 88 | ui->cpuopt_unsafe_inaccurate_nan, |
| 86 | cpuopt_unsafe_inaccurate_nan); | 89 | cpuopt_unsafe_inaccurate_nan); |
| 90 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.cpuopt_unsafe_fastmem_check, | ||
| 91 | ui->cpuopt_unsafe_fastmem_check, | ||
| 92 | cpuopt_unsafe_fastmem_check); | ||
| 87 | 93 | ||
| 88 | if (Settings::IsConfiguringGlobal()) { | 94 | if (Settings::IsConfiguringGlobal()) { |
| 89 | // Guard if during game and set to game-specific value | 95 | // Guard if during game and set to game-specific value |
| @@ -134,4 +140,7 @@ void ConfigureCpu::SetupPerGameUI() { | |||
| 134 | ConfigurationShared::SetColoredTristate(ui->cpuopt_unsafe_inaccurate_nan, | 140 | ConfigurationShared::SetColoredTristate(ui->cpuopt_unsafe_inaccurate_nan, |
| 135 | Settings::values.cpuopt_unsafe_inaccurate_nan, | 141 | Settings::values.cpuopt_unsafe_inaccurate_nan, |
| 136 | cpuopt_unsafe_inaccurate_nan); | 142 | cpuopt_unsafe_inaccurate_nan); |
| 143 | ConfigurationShared::SetColoredTristate(ui->cpuopt_unsafe_fastmem_check, | ||
| 144 | Settings::values.cpuopt_unsafe_fastmem_check, | ||
| 145 | cpuopt_unsafe_fastmem_check); | ||
| 137 | } | 146 | } |
diff --git a/src/yuzu/configuration/configure_cpu.h b/src/yuzu/configuration/configure_cpu.h index 8e2eeb7a6..57ff2772a 100644 --- a/src/yuzu/configuration/configure_cpu.h +++ b/src/yuzu/configuration/configure_cpu.h | |||
| @@ -41,4 +41,5 @@ private: | |||
| 41 | ConfigurationShared::CheckState cpuopt_unsafe_unfuse_fma; | 41 | ConfigurationShared::CheckState cpuopt_unsafe_unfuse_fma; |
| 42 | ConfigurationShared::CheckState cpuopt_unsafe_reduce_fp_error; | 42 | ConfigurationShared::CheckState cpuopt_unsafe_reduce_fp_error; |
| 43 | ConfigurationShared::CheckState cpuopt_unsafe_inaccurate_nan; | 43 | ConfigurationShared::CheckState cpuopt_unsafe_inaccurate_nan; |
| 44 | ConfigurationShared::CheckState cpuopt_unsafe_fastmem_check; | ||
| 44 | }; | 45 | }; |
diff --git a/src/yuzu/configuration/configure_cpu.ui b/src/yuzu/configuration/configure_cpu.ui index 99b573640..31ef9e3f5 100644 --- a/src/yuzu/configuration/configure_cpu.ui +++ b/src/yuzu/configuration/configure_cpu.ui | |||
| @@ -123,6 +123,18 @@ | |||
| 123 | </property> | 123 | </property> |
| 124 | </widget> | 124 | </widget> |
| 125 | </item> | 125 | </item> |
| 126 | <item> | ||
| 127 | <widget class="QCheckBox" name="cpuopt_unsafe_fastmem_check"> | ||
| 128 | <property name="toolTip"> | ||
| 129 | <string> | ||
| 130 | <div>This option improves speed by eliminating a safety check before every memory read/write in guest. Disabling it may allow a game to read/write the emulator's memory.</div> | ||
| 131 | </string> | ||
| 132 | </property> | ||
| 133 | <property name="text"> | ||
| 134 | <string>Disable address space checks</string> | ||
| 135 | </property> | ||
| 136 | </widget> | ||
| 137 | </item> | ||
| 126 | </layout> | 138 | </layout> |
| 127 | </widget> | 139 | </widget> |
| 128 | </item> | 140 | </item> |
diff --git a/src/yuzu/configuration/configure_cpu_debug.cpp b/src/yuzu/configuration/configure_cpu_debug.cpp index c925c023c..e25c52baf 100644 --- a/src/yuzu/configuration/configure_cpu_debug.cpp +++ b/src/yuzu/configuration/configure_cpu_debug.cpp | |||
| @@ -39,6 +39,8 @@ void ConfigureCpuDebug::SetConfiguration() { | |||
| 39 | ui->cpuopt_misc_ir->setChecked(Settings::values.cpuopt_misc_ir); | 39 | ui->cpuopt_misc_ir->setChecked(Settings::values.cpuopt_misc_ir); |
| 40 | ui->cpuopt_reduce_misalign_checks->setEnabled(runtime_lock); | 40 | ui->cpuopt_reduce_misalign_checks->setEnabled(runtime_lock); |
| 41 | ui->cpuopt_reduce_misalign_checks->setChecked(Settings::values.cpuopt_reduce_misalign_checks); | 41 | ui->cpuopt_reduce_misalign_checks->setChecked(Settings::values.cpuopt_reduce_misalign_checks); |
| 42 | ui->cpuopt_fastmem->setEnabled(runtime_lock); | ||
| 43 | ui->cpuopt_fastmem->setChecked(Settings::values.cpuopt_fastmem); | ||
| 42 | } | 44 | } |
| 43 | 45 | ||
| 44 | void ConfigureCpuDebug::ApplyConfiguration() { | 46 | void ConfigureCpuDebug::ApplyConfiguration() { |
| @@ -50,6 +52,7 @@ void ConfigureCpuDebug::ApplyConfiguration() { | |||
| 50 | Settings::values.cpuopt_const_prop = ui->cpuopt_const_prop->isChecked(); | 52 | Settings::values.cpuopt_const_prop = ui->cpuopt_const_prop->isChecked(); |
| 51 | Settings::values.cpuopt_misc_ir = ui->cpuopt_misc_ir->isChecked(); | 53 | Settings::values.cpuopt_misc_ir = ui->cpuopt_misc_ir->isChecked(); |
| 52 | Settings::values.cpuopt_reduce_misalign_checks = ui->cpuopt_reduce_misalign_checks->isChecked(); | 54 | Settings::values.cpuopt_reduce_misalign_checks = ui->cpuopt_reduce_misalign_checks->isChecked(); |
| 55 | Settings::values.cpuopt_fastmem = ui->cpuopt_fastmem->isChecked(); | ||
| 53 | } | 56 | } |
| 54 | 57 | ||
| 55 | void ConfigureCpuDebug::changeEvent(QEvent* event) { | 58 | void ConfigureCpuDebug::changeEvent(QEvent* event) { |
diff --git a/src/yuzu/configuration/configure_cpu_debug.ui b/src/yuzu/configuration/configure_cpu_debug.ui index a90dc64fe..11ee19a12 100644 --- a/src/yuzu/configuration/configure_cpu_debug.ui +++ b/src/yuzu/configuration/configure_cpu_debug.ui | |||
| @@ -139,6 +139,20 @@ | |||
| 139 | </property> | 139 | </property> |
| 140 | </widget> | 140 | </widget> |
| 141 | </item> | 141 | </item> |
| 142 | <item> | ||
| 143 | <widget class="QCheckBox" name="cpuopt_fastmem"> | ||
| 144 | <property name="text"> | ||
| 145 | <string>Enable Host MMU Emulation</string> | ||
| 146 | </property> | ||
| 147 | <property name="toolTip"> | ||
| 148 | <string> | ||
| 149 | <div style="white-space: nowrap">This optimization speeds up memory accesses by the guest program.</div> | ||
| 150 | <div style="white-space: nowrap">Enabling it causes guest memory reads/writes to be done directly into memory and make use of Host's MMU.</div> | ||
| 151 | <div style="white-space: nowrap">Disabling this forces all memory accesses to use Software MMU Emulation.</div> | ||
| 152 | </string> | ||
| 153 | </property> | ||
| 154 | </widget> | ||
| 155 | </item> | ||
| 142 | </layout> | 156 | </layout> |
| 143 | </widget> | 157 | </widget> |
| 144 | </item> | 158 | </item> |
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 8ce2967ac..f48d935a1 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -150,6 +150,10 @@ cpuopt_misc_ir = | |||
| 150 | # 0: Disabled, 1 (default): Enabled | 150 | # 0: Disabled, 1 (default): Enabled |
| 151 | cpuopt_reduce_misalign_checks = | 151 | cpuopt_reduce_misalign_checks = |
| 152 | 152 | ||
| 153 | # Enable Host MMU Emulation (faster guest memory access) | ||
| 154 | # 0: Disabled, 1 (default): Enabled | ||
| 155 | cpuopt_fastmem = | ||
| 156 | |||
| 153 | [Renderer] | 157 | [Renderer] |
| 154 | # Which backend API to use. | 158 | # Which backend API to use. |
| 155 | # 0 (default): OpenGL, 1: Vulkan | 159 | # 0 (default): OpenGL, 1: Vulkan |