Settings: Save DMA timing hacks to ini

This commit is contained in:
Connor McLaughlin 2020-05-17 14:12:23 +10:00
parent 2185bbec73
commit 8fd3a83ea8
3 changed files with 28 additions and 4 deletions

View file

@ -58,10 +58,10 @@ void Settings::Load(SettingsInterface& si)
audio_sync_enabled = si.GetBoolValue("Audio", "Sync", true);
audio_dump_on_boot = si.GetBoolValue("Audio", "DumpOnBoot", false);
dma_max_slice_ticks = si.GetIntValue("Hacks", "DMAMaxSliceTicks", 1000);
dma_halt_ticks = si.GetIntValue("Hacks", "DMAHaltTicks", 100);
gpu_fifo_size = static_cast<u32>(si.GetIntValue("Hacks", "GPUFIFOSize", 128));
gpu_max_run_ahead = si.GetIntValue("Hacks", "GPUMaxRunAhead", 128);
dma_max_slice_ticks = si.GetIntValue("Hacks", "DMAMaxSliceTicks", DEFAULT_DMA_MAX_SLICE_TICKS);
dma_halt_ticks = si.GetIntValue("Hacks", "DMAHaltTicks", DEFAULT_DMA_HALT_TICKS);
gpu_fifo_size = static_cast<u32>(si.GetIntValue("Hacks", "GPUFIFOSize", DEFAULT_GPU_FIFO_SIZE));
gpu_max_run_ahead = si.GetIntValue("Hacks", "GPUMaxRunAhead", DEFAULT_GPU_MAX_RUN_AHEAD);
bios_path = si.GetStringValue("BIOS", "Path", "bios/scph1001.bin");
bios_patch_tty_enable = si.GetBoolValue("BIOS", "PatchTTYEnable", true);
@ -147,6 +147,11 @@ void Settings::Save(SettingsInterface& si) const
si.SetBoolValue("Audio", "Sync", audio_sync_enabled);
si.SetBoolValue("Audio", "DumpOnBoot", audio_dump_on_boot);
si.SetIntValue("Hacks", "DMAMaxSliceTicks", dma_max_slice_ticks);
si.SetIntValue("Hacks", "DMAHaltTicks", dma_halt_ticks);
si.SetIntValue("Hacks", "GPUFIFOSize", gpu_fifo_size);
si.SetIntValue("Hacks", "GPUMaxRunAhead", gpu_max_run_ahead);
si.SetStringValue("BIOS", "Path", bios_path.c_str());
si.SetBoolValue("BIOS", "PatchTTYEnable", bios_patch_tty_enable);
si.SetBoolValue("BIOS", "PatchFastBoot", bios_patch_fast_boot);

View file

@ -117,6 +117,14 @@ struct Settings
return (memory_card_types[0] == MemoryCardType::PerGame || memory_card_types[1] == MemoryCardType::PerGame);
}
enum : u32
{
DEFAULT_DMA_MAX_SLICE_TICKS = 1000,
DEFAULT_DMA_HALT_TICKS = 100,
DEFAULT_GPU_FIFO_SIZE = 128,
DEFAULT_GPU_MAX_RUN_AHEAD = 128
};
void Load(SettingsInterface& si);
void Save(SettingsInterface& si) const;

View file

@ -1260,6 +1260,17 @@ void SDLHostInterface::DrawSettingsWindow()
m_settings_copy.gpu_max_run_ahead = gpu_max_run_ahead;
settings_changed = true;
}
if (ImGui::Button("Reset"))
{
m_settings_copy.dma_max_slice_ticks = static_cast<TickCount>(Settings::DEFAULT_DMA_MAX_SLICE_TICKS);
m_settings_copy.dma_halt_ticks = static_cast<TickCount>(Settings::DEFAULT_DMA_HALT_TICKS);
m_settings_copy.gpu_fifo_size = Settings::DEFAULT_GPU_FIFO_SIZE;
m_settings_copy.gpu_max_run_ahead = static_cast<TickCount>(Settings::DEFAULT_GPU_MAX_RUN_AHEAD);
settings_changed = true;
}
ImGui::EndTabItem();
}
ImGui::EndTabBar();