Simplify DMA options

This commit is contained in:
MaranBr 2025-09-16 09:04:29 -04:00
parent 80dfc3d76f
commit 9265c9dc4c
5 changed files with 19 additions and 22 deletions

View File

@ -154,11 +154,19 @@ bool IsGPULevelHigh() {
values.current_gpu_accuracy == GpuAccuracy::High;
}
bool IsDMALevelDefault() {
return values.dma_accuracy.GetValue() == Settings::DmaAccuracy::Default;
}
bool IsDMALevelSafe() {
return values.dma_accuracy.GetValue() == Settings::DmaAccuracy::Safe;
}
bool IsFastmemEnabled() {
if (values.cpu_debug_mode) {
return static_cast<bool>(values.cpuopt_fastmem);
}
if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Unsafe) {
if (values.cpu_accuracy.GetValue() == CpuAccuracy::Unsafe) {
return static_cast<bool>(values.cpuopt_unsafe_host_mmu);
}
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__sun__)

View File

@ -443,7 +443,7 @@ struct Values {
SwitchableSetting<DmaAccuracy, true> dma_accuracy{linkage,
DmaAccuracy::Default,
DmaAccuracy::Default,
DmaAccuracy::Extreme,
DmaAccuracy::Safe,
"dma_accuracy",
Category::RendererAdvanced,
Specialization::Default,
@ -783,6 +783,9 @@ void UpdateGPUAccuracy();
bool IsGPULevelExtreme();
bool IsGPULevelHigh();
bool IsDMALevelDefault();
bool IsDMALevelSafe();
bool IsFastmemEnabled();
void SetNceEnabled(bool is_64bit);
bool IsNceEnabled();

View File

@ -136,7 +136,7 @@ ENUM(ShaderBackend, Glsl, Glasm, SpirV);
ENUM(GpuAccuracy, Normal, High, Extreme);
ENUM(DmaAccuracy, Default, Normal, High, Extreme);
ENUM(DmaAccuracy, Default, Unsafe, Safe);
ENUM(CpuBackend, Dynarmic, Nce);

View File

@ -297,7 +297,7 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent)
INSERT(Settings,
dma_accuracy,
tr("DMA Level:"),
tr("Controls the DMA precision accuracy. Higher precision can fix issues in some games, but it can also impact performance in some cases.\nIf unsure, leave it at Default."));
tr("Controls the DMA precision accuracy. Safe precision can fix issues in some games, but it can also impact performance in some cases.\nIf unsure, leave this on Default."));
INSERT(Settings,
use_asynchronous_shaders,
tr("Use asynchronous shader building (Hack)"),
@ -529,9 +529,8 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QObject* parent)
translations->insert({Settings::EnumMetadata<Settings::DmaAccuracy>::Index(),
{
PAIR(DmaAccuracy, Default, tr("Default")),
PAIR(DmaAccuracy, Normal, tr("Normal")),
PAIR(DmaAccuracy, High, tr("High")),
PAIR(DmaAccuracy, Extreme, tr("Extreme")),
PAIR(DmaAccuracy, Unsafe, tr("Unsafe (fast)")),
PAIR(DmaAccuracy, Safe, tr("Safe (stable)")),
}});
translations->insert(
{Settings::EnumMetadata<Settings::CpuAccuracy>::Index(),

View File

@ -102,23 +102,10 @@ bool DmaPusher::Step() {
ProcessCommands(headers);
};
const Settings::DmaAccuracy accuracy = Settings::values.dma_accuracy.GetValue();
const bool use_gpu_accuracy = accuracy == Settings::DmaAccuracy::Default;
const bool use_safe = Settings::IsDMALevelDefault() ? Settings::IsGPULevelHigh() : Settings::IsDMALevelSafe();
// reduces eye bleeding but also macros are dumb so idk
#define CHECK_LEVEL(level) use_gpu_accuracy ? Settings::IsGPULevel##level() : accuracy == Settings::DmaAccuracy::level;
const bool force_safe = CHECK_LEVEL(Extreme)
const bool unsafe_compute = CHECK_LEVEL(High)
#undef CHECK_LEVEL
if (force_safe) {
if (use_safe) {
safe_process();
} else if (unsafe_compute) {
if (dma_state.method >= MacroRegistersStart) {
unsafe_process();
} else {
safe_process();
}
} else {
unsafe_process();
}