settings; Don't make CPU settings dependant on cpu debugging flag

When CPU debugging is disabled, none of the Debug options in the CPU tab get applied without a clear indication. The CPU debugging option is not even in the same tab.
This is incredibly bad UX and lead to me believing I had fastmem disabled, while in fact it was still on.
This commit is contained in:
FearlessTobi 2024-02-27 01:42:04 +01:00
parent 4a7c4f1a71
commit 8d5a8ce42f
5 changed files with 84 additions and 86 deletions

View File

@ -151,10 +151,7 @@ bool IsGPULevelHigh() {
} }
bool IsFastmemEnabled() { bool IsFastmemEnabled() {
if (values.cpu_debug_mode) { return static_cast<bool>(values.cpuopt_fastmem);
return static_cast<bool>(values.cpuopt_fastmem);
}
return true;
} }
static bool is_nce_enabled = false; static bool is_nce_enabled = false;

View File

@ -371,7 +371,8 @@ struct Values {
AstcDecodeMode::CpuAsynchronous, AstcDecodeMode::CpuAsynchronous,
"accelerate_astc", "accelerate_astc",
Category::RendererAdvanced}; Category::RendererAdvanced};
SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::Gpu, "nvdec_emulation", Category::RendererAdvanced}; SwitchableSetting<NvdecEmulation> nvdec_emulation{
linkage, NvdecEmulation::Gpu, "nvdec_emulation", Category::RendererAdvanced};
SwitchableSetting<AstcRecompression, true> astc_recompression{linkage, SwitchableSetting<AstcRecompression, true> astc_recompression{linkage,
AstcRecompression::Uncompressed, AstcRecompression::Uncompressed,
AstcRecompression::Uncompressed, AstcRecompression::Uncompressed,

View File

@ -225,45 +225,45 @@ std::shared_ptr<Dynarmic::A32::Jit> ArmDynarmic32::MakeJit(Common::PageTable* pa
} }
// Safe optimizations // Safe optimizations
if (Settings::values.cpu_debug_mode) { if (!Settings::values.cpuopt_page_tables) {
if (!Settings::values.cpuopt_page_tables) { config.page_table = nullptr;
config.page_table = nullptr; }
} if (!Settings::values.cpuopt_block_linking) {
if (!Settings::values.cpuopt_block_linking) { config.optimizations &= ~Dynarmic::OptimizationFlag::BlockLinking;
config.optimizations &= ~Dynarmic::OptimizationFlag::BlockLinking; }
} if (!Settings::values.cpuopt_return_stack_buffer) {
if (!Settings::values.cpuopt_return_stack_buffer) { config.optimizations &= ~Dynarmic::OptimizationFlag::ReturnStackBuffer;
config.optimizations &= ~Dynarmic::OptimizationFlag::ReturnStackBuffer; }
} if (!Settings::values.cpuopt_fast_dispatcher) {
if (!Settings::values.cpuopt_fast_dispatcher) { config.optimizations &= ~Dynarmic::OptimizationFlag::FastDispatch;
config.optimizations &= ~Dynarmic::OptimizationFlag::FastDispatch; }
} if (!Settings::values.cpuopt_context_elimination) {
if (!Settings::values.cpuopt_context_elimination) { config.optimizations &= ~Dynarmic::OptimizationFlag::GetSetElimination;
config.optimizations &= ~Dynarmic::OptimizationFlag::GetSetElimination; }
} if (!Settings::values.cpuopt_const_prop) {
if (!Settings::values.cpuopt_const_prop) { config.optimizations &= ~Dynarmic::OptimizationFlag::ConstProp;
config.optimizations &= ~Dynarmic::OptimizationFlag::ConstProp; }
} if (!Settings::values.cpuopt_misc_ir) {
if (!Settings::values.cpuopt_misc_ir) { config.optimizations &= ~Dynarmic::OptimizationFlag::MiscIROpt;
config.optimizations &= ~Dynarmic::OptimizationFlag::MiscIROpt; }
} if (!Settings::values.cpuopt_reduce_misalign_checks) {
if (!Settings::values.cpuopt_reduce_misalign_checks) { config.only_detect_misalignment_via_page_table_on_page_boundary = false;
config.only_detect_misalignment_via_page_table_on_page_boundary = false; }
} if (!Settings::values.cpuopt_fastmem) {
if (!Settings::values.cpuopt_fastmem) { config.fastmem_pointer = nullptr;
config.fastmem_pointer = nullptr; config.fastmem_exclusive_access = false;
config.fastmem_exclusive_access = false; }
} if (!Settings::values.cpuopt_fastmem_exclusives) {
if (!Settings::values.cpuopt_fastmem_exclusives) { config.fastmem_exclusive_access = false;
config.fastmem_exclusive_access = false; }
} if (!Settings::values.cpuopt_recompile_exclusives) {
if (!Settings::values.cpuopt_recompile_exclusives) { config.recompile_on_exclusive_fastmem_failure = false;
config.recompile_on_exclusive_fastmem_failure = false; }
} if (!Settings::values.cpuopt_ignore_memory_aborts) {
if (!Settings::values.cpuopt_ignore_memory_aborts) { config.check_halt_on_memory_access = true;
config.check_halt_on_memory_access = true; }
}
} else { if (!Settings::values.cpu_debug_mode) {
// Unsafe optimizations // Unsafe optimizations
if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Unsafe) { if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Unsafe) {
config.unsafe_optimizations = true; config.unsafe_optimizations = true;

View File

@ -284,45 +284,45 @@ std::shared_ptr<Dynarmic::A64::Jit> ArmDynarmic64::MakeJit(Common::PageTable* pa
} }
// Safe optimizations // Safe optimizations
if (Settings::values.cpu_debug_mode) { if (!Settings::values.cpuopt_page_tables) {
if (!Settings::values.cpuopt_page_tables) { config.page_table = nullptr;
config.page_table = nullptr; }
} if (!Settings::values.cpuopt_block_linking) {
if (!Settings::values.cpuopt_block_linking) { config.optimizations &= ~Dynarmic::OptimizationFlag::BlockLinking;
config.optimizations &= ~Dynarmic::OptimizationFlag::BlockLinking; }
} if (!Settings::values.cpuopt_return_stack_buffer) {
if (!Settings::values.cpuopt_return_stack_buffer) { config.optimizations &= ~Dynarmic::OptimizationFlag::ReturnStackBuffer;
config.optimizations &= ~Dynarmic::OptimizationFlag::ReturnStackBuffer; }
} if (!Settings::values.cpuopt_fast_dispatcher) {
if (!Settings::values.cpuopt_fast_dispatcher) { config.optimizations &= ~Dynarmic::OptimizationFlag::FastDispatch;
config.optimizations &= ~Dynarmic::OptimizationFlag::FastDispatch; }
} if (!Settings::values.cpuopt_context_elimination) {
if (!Settings::values.cpuopt_context_elimination) { config.optimizations &= ~Dynarmic::OptimizationFlag::GetSetElimination;
config.optimizations &= ~Dynarmic::OptimizationFlag::GetSetElimination; }
} if (!Settings::values.cpuopt_const_prop) {
if (!Settings::values.cpuopt_const_prop) { config.optimizations &= ~Dynarmic::OptimizationFlag::ConstProp;
config.optimizations &= ~Dynarmic::OptimizationFlag::ConstProp; }
} if (!Settings::values.cpuopt_misc_ir) {
if (!Settings::values.cpuopt_misc_ir) { config.optimizations &= ~Dynarmic::OptimizationFlag::MiscIROpt;
config.optimizations &= ~Dynarmic::OptimizationFlag::MiscIROpt; }
} if (!Settings::values.cpuopt_reduce_misalign_checks) {
if (!Settings::values.cpuopt_reduce_misalign_checks) { config.only_detect_misalignment_via_page_table_on_page_boundary = false;
config.only_detect_misalignment_via_page_table_on_page_boundary = false; }
} if (!Settings::values.cpuopt_fastmem) {
if (!Settings::values.cpuopt_fastmem) { config.fastmem_pointer = nullptr;
config.fastmem_pointer = nullptr; config.fastmem_exclusive_access = false;
config.fastmem_exclusive_access = false; }
} if (!Settings::values.cpuopt_fastmem_exclusives) {
if (!Settings::values.cpuopt_fastmem_exclusives) { config.fastmem_exclusive_access = false;
config.fastmem_exclusive_access = false; }
} if (!Settings::values.cpuopt_recompile_exclusives) {
if (!Settings::values.cpuopt_recompile_exclusives) { config.recompile_on_exclusive_fastmem_failure = false;
config.recompile_on_exclusive_fastmem_failure = false; }
} if (!Settings::values.cpuopt_ignore_memory_aborts) {
if (!Settings::values.cpuopt_ignore_memory_aborts) { config.check_halt_on_memory_access = true;
config.check_halt_on_memory_access = true; }
}
} else { if (!Settings::values.cpu_debug_mode) {
// Unsafe optimizations // Unsafe optimizations
if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Unsafe) { if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Unsafe) {
config.unsafe_optimizations = true; config.unsafe_optimizations = true;

View File

@ -28,7 +28,7 @@
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;For debugging only.&lt;/span&gt;&lt;br/&gt;If you're not sure what these do, keep all of these enabled. &lt;br/&gt;These settings, when disabled, only take effect when CPU Debugging is enabled. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;For debugging only.&lt;/span&gt;&lt;br/&gt;If you're not sure what these do, keep all of these enabled.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>false</bool> <bool>false</bool>
@ -144,7 +144,7 @@
</string> </string>
</property> </property>
<property name="text"> <property name="text">
<string>Enable Host MMU Emulation (general memory instructions)</string> <string>Enable Host MMU Emulation (Fastmem) - General memory instructions</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -158,7 +158,7 @@
</string> </string>
</property> </property>
<property name="text"> <property name="text">
<string>Enable Host MMU Emulation (exclusive memory instructions)</string> <string>Enable Host MMU Emulation (Fastmem) - Exclusive memory instructions</string>
</property> </property>
</widget> </widget>
</item> </item>