Settings: Rename DMA slice and GPU run-ahead keys

Old settings files hold the previous defaults, and run-ahead is now counted
in CPU cycles.

Also has the helpful effect of resetting everyone's values.
This commit is contained in:
Stenzek committed 2026-11-07 19:10:23 +10:00
1 parent 389927b9ce
commit 4360c2c673
8 files changed
+43 -42

No files matched your search

+2 -2
View File
@@ -20,8 +20,8 @@ class DMAExecution : public ExecutionModeTest
TEST_P(DMAExecution, ChoppedManualDMARunsWhileGPUTransferIsSliced)
{
const Settings old_settings = g_settings;
g_settings.dma_max_slice_ticks = 32;
g_settings.dma_halt_ticks = 16;
g_settings.dma_max_slice_cycles = 32;
g_settings.dma_halt_cycles = 16;
DMA::Reset();
// An empty GPU linked list that loops back to itself keeps exhausting its DMA slice without sending GPU commands.
+5 -5
View File
@@ -249,7 +249,7 @@ struct fmt::formatter<DMA::Channel> : fmt::formatter<fmt::string_view>
void DMA::Initialize()
{
s_state.unhalt_event.SetInterval(g_settings.dma_halt_ticks);
s_state.unhalt_event.SetInterval(g_settings.dma_halt_cycles);
Reset();
}
@@ -612,7 +612,7 @@ bool DMA::TransferChannel()
const u8* const ram_ptr = g_bus.ram;
const u32 mask = g_bus.ram_mask;
const TickCount slice_ticks = GetMaxSliceTicks<channel>(g_settings.dma_max_slice_ticks);
const TickCount slice_ticks = GetMaxSliceTicks<channel>(g_settings.dma_max_slice_cycles);
TickCount remaining_ticks = slice_ticks;
while (cs.request && remaining_ticks > 0)
{
@@ -663,7 +663,7 @@ bool DMA::TransferChannel()
if (cs.request)
{
// stall the transfer for a bit if we ran for too long
HaltTransfer(g_settings.dma_halt_ticks);
HaltTransfer(g_settings.dma_halt_cycles);
return false;
}
else
@@ -682,7 +682,7 @@ bool DMA::TransferChannel()
const u32 block_size = cs.block_control.request.GetBlockSize();
u32 blocks_remaining = cs.block_control.request.GetBlockCount();
TickCount ticks_remaining = GetMaxSliceTicks<channel>(g_settings.dma_max_slice_ticks);
TickCount ticks_remaining = GetMaxSliceTicks<channel>(g_settings.dma_max_slice_cycles);
if (copy_to_device)
{
@@ -737,7 +737,7 @@ bool DMA::TransferChannel()
{
// we got halted
if (!s_state.unhalt_event.IsActive())
HaltTransfer(g_settings.dma_halt_ticks);
HaltTransfer(g_settings.dma_halt_cycles);
return false;
}
+6 -6
View File
@@ -521,15 +521,15 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
}
if (dma_max_slice_ticks.has_value(override_mask))
{
settings.dma_max_slice_ticks = dma_max_slice_ticks.value();
settings.dma_max_slice_cycles = dma_max_slice_ticks.value();
if (display_osd_messages)
INFO_LOG("GameDB: DMA max slice ticks set to {}.", settings.dma_max_slice_ticks);
INFO_LOG("GameDB: DMA max slice ticks set to {}.", settings.dma_max_slice_cycles);
}
if (dma_halt_ticks.has_value(override_mask))
{
settings.dma_halt_ticks = dma_halt_ticks.value();
settings.dma_halt_cycles = dma_halt_ticks.value();
if (display_osd_messages)
INFO_LOG("GameDB: DMA halt ticks set to {}.", settings.dma_halt_ticks);
INFO_LOG("GameDB: DMA halt ticks set to {}.", settings.dma_halt_cycles);
}
if (cdrom_max_seek_speedup_cycles.has_value(override_mask) && g_settings.cdrom_seek_speedup == 0)
{
@@ -545,9 +545,9 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
}
if (gpu_max_run_ahead.has_value(override_mask))
{
settings.gpu_max_run_ahead = gpu_max_run_ahead.value();
settings.gpu_max_run_ahead_cycles = gpu_max_run_ahead.value();
if (display_osd_messages)
INFO_LOG("GameDB: GPU max runahead set to {}.", settings.gpu_max_run_ahead);
INFO_LOG("GameDB: GPU max runahead set to {}.", settings.gpu_max_run_ahead_cycles);
}
if (gpu_pgxp_tolerance.has_value(override_mask))
{
+2 -2
View File
@@ -496,7 +496,7 @@ void GPU::Initialize()
s_locals.crtc_tick_event.Activate();
s_locals.force_progressive_scan = (g_settings.display_deinterlacing_mode == DisplayDeinterlacingMode::Progressive);
s_locals.max_run_ahead = g_settings.gpu_max_run_ahead;
s_locals.max_run_ahead = g_settings.gpu_max_run_ahead_cycles;
s_locals.console_is_pal = System::IsPALRegion();
s_locals.texture_enable_mask = !g_settings.gpu_disable_textures;
s_locals.force_raw_texture = g_settings.gpu_disable_vertex_lighting;
@@ -516,7 +516,7 @@ void GPU::Shutdown()
void GPU::UpdateSettings(const Settings& old_settings)
{
s_locals.force_progressive_scan = (g_settings.display_deinterlacing_mode == DisplayDeinterlacingMode::Progressive);
s_locals.max_run_ahead = g_settings.gpu_max_run_ahead;
s_locals.max_run_ahead = g_settings.gpu_max_run_ahead_cycles;
s_locals.texture_enable_mask = !g_settings.gpu_disable_textures;
s_locals.force_raw_texture = g_settings.gpu_disable_vertex_lighting;
+7 -6
View File
@@ -564,9 +564,10 @@ void Settings::Load(const SettingsInterface& si, const SettingsInterface& contro
achievements_indicator_scale =
si.GetSaturatedIntValue<s16>(ACHIEVEMENTS_SECTION_NAME, "IndicatorScale", ACHIEVEMENT_NOTIFICATION_SCALE_AUTO);
dma_max_slice_ticks = si.GetIntValue(HACKS_SECTION_NAME, "DMAMaxSliceTicks", DEFAULT_DMA_MAX_SLICE_TICKS);
dma_halt_ticks = si.GetIntValue(HACKS_SECTION_NAME, "DMAHaltTicks", DEFAULT_DMA_HALT_TICKS);
gpu_max_run_ahead = si.GetIntValue(HACKS_SECTION_NAME, "GPUMaxRunAhead", DEFAULT_GPU_MAX_RUN_AHEAD);
dma_max_slice_cycles = si.GetIntValue(HACKS_SECTION_NAME, "DMAMaxSliceCycles", DEFAULT_DMA_MAX_SLICE_CYCLES);
dma_halt_cycles = si.GetIntValue(HACKS_SECTION_NAME, "DMAHaltCycles", DEFAULT_DMA_HALT_CYCLES);
gpu_max_run_ahead_cycles =
si.GetIntValue(HACKS_SECTION_NAME, "GPUMaxRunAheadCycles", DEFAULT_GPU_MAX_RUN_AHEAD_CYCLES);
mdec_use_old_routines = si.GetBoolValue(HACKS_SECTION_NAME, "UseOldMDECRoutines", false);
export_shared_memory = si.GetBoolValue(HACKS_SECTION_NAME, "ExportSharedMemory", false);
@@ -1229,9 +1230,9 @@ void Settings::ApplySettingRestrictions()
pio_device_type = PIODeviceType::None;
pcdrv_enable = false;
pcsx_expansion_region_enable = false;
dma_max_slice_ticks = DEFAULT_DMA_MAX_SLICE_TICKS;
dma_halt_ticks = DEFAULT_DMA_HALT_TICKS;
gpu_max_run_ahead = DEFAULT_GPU_MAX_RUN_AHEAD;
dma_max_slice_cycles = DEFAULT_DMA_MAX_SLICE_CYCLES;
dma_halt_cycles = DEFAULT_DMA_HALT_CYCLES;
gpu_max_run_ahead_cycles = DEFAULT_GPU_MAX_RUN_AHEAD_CYCLES;
}
// if challenge mode is enabled, disable things like rewind since they use save states
+6 -6
View File
@@ -277,9 +277,9 @@ struct Settings : public GPUSettings
u32 cpu_overclock_numerator = 1;
u32 cpu_overclock_denominator = 1;
TickCount dma_max_slice_ticks = DEFAULT_DMA_MAX_SLICE_TICKS;
TickCount dma_halt_ticks = DEFAULT_DMA_HALT_TICKS;
TickCount gpu_max_run_ahead = DEFAULT_GPU_MAX_RUN_AHEAD;
TickCount dma_max_slice_cycles = DEFAULT_DMA_MAX_SLICE_CYCLES;
TickCount dma_halt_cycles = DEFAULT_DMA_HALT_CYCLES;
TickCount gpu_max_run_ahead_cycles = DEFAULT_GPU_MAX_RUN_AHEAD_CYCLES;
ConsoleRegion region = DEFAULT_CONSOLE_REGION;
ForceVideoTimingMode gpu_force_video_timing = DEFAULT_FORCE_VIDEO_TIMING_MODE;
@@ -447,9 +447,9 @@ struct Settings : public GPUSettings
enum : u32
{
DEFAULT_DMA_MAX_SLICE_TICKS = 200,
DEFAULT_DMA_HALT_TICKS = 100,
DEFAULT_GPU_MAX_RUN_AHEAD = 512, // Next power of 2 above the longest polygon setup, so setups need no event.
DEFAULT_DMA_MAX_SLICE_CYCLES = 200,
DEFAULT_DMA_HALT_CYCLES = 100,
DEFAULT_GPU_MAX_RUN_AHEAD_CYCLES = 512, // Next power of 2 above the longest polygon setup, so setups need no event.
};
void Load(const SettingsInterface& si, const SettingsInterface& controller_si);
+1 -1
View File
@@ -4954,7 +4954,7 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
// CPU side GPU settings
if (g_settings.display_deinterlacing_mode != old_settings.display_deinterlacing_mode ||
g_settings.gpu_max_run_ahead != old_settings.gpu_max_run_ahead ||
g_settings.gpu_max_run_ahead_cycles != old_settings.gpu_max_run_ahead_cycles ||
g_settings.gpu_force_video_timing != old_settings.gpu_force_video_timing ||
g_settings.gpu_disable_textures != old_settings.gpu_disable_textures ||
g_settings.gpu_disable_vertex_lighting != old_settings.gpu_disable_vertex_lighting ||
+14 -14
View File
@@ -210,12 +210,12 @@ void DebuggingSettingsWidget::addTweakOptions()
Settings::DISPLAY_SECTION_NAME, "LineEndOffset", -128, 127, 0);
}
addIntRangeTweakOption(m_dialog, m_ui.tweakOptionTable, tr("DMA Max Slice Ticks"), Settings::HACKS_SECTION_NAME,
"DMAMaxSliceTicks", 1, 10000, Settings::DEFAULT_DMA_MAX_SLICE_TICKS, tr(" cycles"));
addIntRangeTweakOption(m_dialog, m_ui.tweakOptionTable, tr("DMA Halt Ticks"), Settings::HACKS_SECTION_NAME,
"DMAHaltTicks", 1, 10000, Settings::DEFAULT_DMA_HALT_TICKS, tr(" cycles"));
addIntRangeTweakOption(m_dialog, m_ui.tweakOptionTable, tr("GPU Max Runahead"), Settings::HACKS_SECTION_NAME,
"GPUMaxRunAhead", 0, 1000, Settings::DEFAULT_GPU_MAX_RUN_AHEAD, tr(" cycles"));
addIntRangeTweakOption(m_dialog, m_ui.tweakOptionTable, tr("DMA Max Slice Cycles"), Settings::HACKS_SECTION_NAME,
"DMAMaxSliceCycles", 1, 10000, Settings::DEFAULT_DMA_MAX_SLICE_CYCLES, tr(" cycles"));
addIntRangeTweakOption(m_dialog, m_ui.tweakOptionTable, tr("DMA Halt Cycles"), Settings::HACKS_SECTION_NAME,
"DMAHaltCycles", 1, 10000, Settings::DEFAULT_DMA_HALT_CYCLES, tr(" cycles"));
addIntRangeTweakOption(m_dialog, m_ui.tweakOptionTable, tr("GPU Max Runahead Cycles"), Settings::HACKS_SECTION_NAME,
"GPUMaxRunAheadCycles", 0, 1000, Settings::DEFAULT_GPU_MAX_RUN_AHEAD_CYCLES, tr(" cycles"));
addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Enable Recompiler Memory Exceptions"),
Settings::CPU_SECTION_NAME, "RecompilerMemoryExceptions", false);
@@ -278,13 +278,13 @@ void DebuggingSettingsWidget::onResetToDefaultClicked()
setChoiceTweakOption(m_ui.tweakOptionTable, i++,
Settings::DEFAULT_SAVE_STATE_COMPRESSION_MODE); // Save State Compression
setIntRangeTweakOption(m_ui.tweakOptionTable, i++,
static_cast<int>(Settings::DEFAULT_DMA_MAX_SLICE_TICKS)); // DMA max slice ticks
static_cast<int>(Settings::DEFAULT_DMA_MAX_SLICE_CYCLES)); // DMA max slice ticks
setIntRangeTweakOption(m_ui.tweakOptionTable, i++,
static_cast<int>(Settings::DEFAULT_DMA_HALT_TICKS)); // DMA halt ticks
static_cast<int>(Settings::DEFAULT_DMA_HALT_CYCLES)); // DMA halt ticks
setIntRangeTweakOption(m_ui.tweakOptionTable, i++,
static_cast<int>(Settings::DEFAULT_GPU_MAX_RUN_AHEAD)); // GPU max runahead
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Recompiler memory exceptions
setBooleanTweakOption(m_ui.tweakOptionTable, i++, true); // Recompiler block linking
static_cast<int>(Settings::DEFAULT_GPU_MAX_RUN_AHEAD_CYCLES)); // GPU max runahead
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Recompiler memory exceptions
setBooleanTweakOption(m_ui.tweakOptionTable, i++, true); // Recompiler block linking
setChoiceTweakOption(m_ui.tweakOptionTable, i++,
Settings::DEFAULT_CPU_FASTMEM_MODE); // Recompiler fastmem mode
setChoiceTweakOption(m_ui.tweakOptionTable, i++,
@@ -321,9 +321,9 @@ void DebuggingSettingsWidget::onResetToDefaultClicked()
sif->DeleteValue(Settings::DISPLAY_SECTION_NAME, "ActiveEndOffset");
sif->DeleteValue(Settings::DISPLAY_SECTION_NAME, "LineStartOffset");
sif->DeleteValue(Settings::DISPLAY_SECTION_NAME, "LineEndOffset");
sif->DeleteValue(Settings::HACKS_SECTION_NAME, "DMAMaxSliceTicks");
sif->DeleteValue(Settings::HACKS_SECTION_NAME, "DMAHaltTicks");
sif->DeleteValue(Settings::HACKS_SECTION_NAME, "GPUMaxRunAhead");
sif->DeleteValue(Settings::HACKS_SECTION_NAME, "DMAMaxSliceCycles");
sif->DeleteValue(Settings::HACKS_SECTION_NAME, "DMAHaltCycles");
sif->DeleteValue(Settings::HACKS_SECTION_NAME, "GPUMaxRunAheadCycles");
sif->DeleteValue(Settings::HACKS_SECTION_NAME, "ExportSharedMemory");
sif->DeleteValue(Settings::CPU_SECTION_NAME, "RecompilerMemoryExceptions");
sif->DeleteValue(Settings::CPU_SECTION_NAME, "RecompilerBlockLinking");