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 36c9229 commit 3614e9f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/Core/Core/Boot/Boot_BS2Emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,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 @@ -291,6 +292,7 @@ bool CBoot::SetupWiiMemory(IOS::HLE::IOSC::ConsoleType console_type)
{
gen.SetBytes(std::move(data));
serno = gen.GetValue("SERNO");
model = gen.GetValue("MODEL");

bool region_matches = false;
if (SConfig::GetInstance().bOverrideRegionSettings)
Expand All @@ -309,6 +311,12 @@ bool CBoot::SetupWiiMemory(IOS::HLE::IOSC::ConsoleType console_type)
region_setting = RegionSetting{gen.GetValue("AREA"), gen.GetValue("VIDEO"),
gen.GetValue("GAME"), gen.GetValue("CODE")};
}
else
{
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 @@ -328,7 +336,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 3614e9f

Please sign in to comment.