Settings: Hook up console region

This commit is contained in:
Connor McLaughlin
2019-11-16 20:27:30 +10:00
parent 613e4f4a2a
commit f1289d6161
3 changed files with 19 additions and 3 deletions

View File

@ -37,6 +37,8 @@ void Settings::Load(const char* filename)
return;
}
region = ParseConsoleRegionName(ini.GetValue("Console", "Region", "NTSC-U")).value_or(ConsoleRegion::NTSC_U);
gpu_renderer = ParseRendererName(ini.GetValue("GPU", "Renderer", "OpenGL")).value_or(GPURenderer::HardwareOpenGL);
gpu_resolution_scale = static_cast<u32>(ini.GetLongValue("GPU", "ResolutionScale", 1));
gpu_vsync = static_cast<u32>(ini.GetBoolValue("GPU", "VSync", true));
@ -60,6 +62,8 @@ bool Settings::Save(const char* filename) const
if (err != SI_OK)
ini.Reset();
ini.SetValue("Console", "Region", GetConsoleRegionName(region));
ini.SetValue("GPU", "Renderer", GetRendererName(gpu_renderer));
ini.SetLongValue("GPU", "ResolutionScale", static_cast<long>(gpu_resolution_scale));
ini.SetBoolValue("GPU", "VSync", gpu_vsync);

View File

@ -115,7 +115,7 @@ bool System::Boot(const char* filename)
std::optional<ConsoleRegion> detected_region = GetRegionForCDImage(media.get());
m_region = detected_region.value_or(ConsoleRegion::NTSC_U);
if (detected_region)
Log_InfoPrintf("Auto-detected %s region for '%s'", Settings::GetConsoleRegionName(m_region));
Log_InfoPrintf("Auto-detected %s region for '%s'", Settings::GetConsoleRegionName(m_region), filename);
else
Log_WarningPrintf("Could not determine region for CD. Defaulting to NTSC-U.");
}