Boot: Initialize Wii root before saving SYSCONF file

Fixes netplay and movie overrides of SYSCONF settings not applying.
This commit is contained in:
JosJuice
2021-03-06 19:14:18 +01:00
parent 359ed5348a
commit 46dbb455e1
7 changed files with 44 additions and 16 deletions

View File

@ -202,13 +202,18 @@ void InitializeWiiRoot(bool use_temporary)
void ShutdownWiiRoot()
{
if (!s_temp_wii_root.empty())
if (WiiRootIsTemporary())
{
File::DeleteDirRecursively(s_temp_wii_root);
s_temp_wii_root.clear();
}
}
bool WiiRootIsTemporary()
{
return !s_temp_wii_root.empty();
}
void BackupWiiSettings()
{
// Back up files which Dolphin can modify at boot, so that we can preserve the original contents.
@ -282,7 +287,7 @@ void InitializeWiiFileSystemContents()
if (!CopySysmenuFilesToFS(fs.get(), File::GetSysDirectory() + WII_USER_DIR, ""))
WARN_LOG_FMT(CORE, "Failed to copy initial System Menu files to the NAND");
if (s_temp_wii_root.empty())
if (!WiiRootIsTemporary())
return;
// Generate a SYSCONF with default settings for the temporary Wii NAND.
@ -294,7 +299,7 @@ void InitializeWiiFileSystemContents()
void CleanUpWiiFileSystemContents()
{
if (s_temp_wii_root.empty() || !SConfig::GetInstance().bEnableMemcardSdWriting ||
if (!WiiRootIsTemporary() || !SConfig::GetInstance().bEnableMemcardSdWriting ||
NetPlay::GetWiiSyncFS())
{
return;