Skip to content

Commit

Permalink
Boot: Preserve MODEL value in setting.txt
Browse files Browse the repository at this point in the history
It doesn't necessarily start with RVL-001.
  • Loading branch information
JosJuice committed Mar 16, 2020
1 parent b3fe93f commit 126cf35
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/Core/Core/Boot/Boot_BS2Emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ bool CBoot::SetupWiiMemory(IOS::HLE::IOSC::ConsoleType console_type)

Common::SettingsHandler gen;
std::string serno;
std::string model = "RVL-001(" + region_setting.area + ")";
CreateSystemMenuTitleDirs();
const std::string settings_file_path(Common::GetTitleDataPath(Titles::SYSTEM_MENU) +
"/" WII_SETTING);
Expand All @@ -289,6 +290,7 @@ bool CBoot::SetupWiiMemory(IOS::HLE::IOSC::ConsoleType console_type)
{
gen.SetBytes(std::move(data));
serno = gen.GetValue("SERNO");
model = gen.GetValue("MODEL");
if (SConfig::GetInstance().bOverrideRegionSettings)
{
region_setting = RegionSetting{gen.GetValue("AREA"), gen.GetValue("VIDEO"),
Expand All @@ -299,6 +301,10 @@ bool CBoot::SetupWiiMemory(IOS::HLE::IOSC::ConsoleType console_type)
const std::string code = gen.GetValue("CODE");
if (code.size() >= 2 && CodeRegion(code[1]) == SConfig::GetInstance().m_region)
region_setting.code = code;

const size_t parenthesis_pos = model.find('(');
if (parenthesis_pos != std::string::npos)
model = model.substr(0, parenthesis_pos) + '(' + region_setting.area + ')';
}
gen.Reset();
}
Expand All @@ -318,7 +324,6 @@ bool CBoot::SetupWiiMemory(IOS::HLE::IOSC::ConsoleType console_type)
INFO_LOG(BOOT, "Using serial number: %s", serno.c_str());
}

std::string model = "RVL-001(" + region_setting.area + ")";
gen.AddSetting("AREA", region_setting.area);
gen.AddSetting("MODEL", model);
gen.AddSetting("DVD", "0");
Expand Down

0 comments on commit 126cf35

Please sign in to comment.