summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorTechjar <tecknojar@gmail.com>2019-04-07 02:11:24 -0400
committerTechjar <tecknojar@gmail.com>2019-04-26 23:33:35 -0400
commit20530c2a9698a0fcc444c975ed24e2f12e69012c (patch)
tree7f8c14d9e9b711db5a02046f7ac8200428740239 /Source/Core
parent664cfb2ca5e55f0c8969966a98bfedeeed268213 (diff)
Core/WiiRoot: Fix NetPlay full Wii save sync not copying all the saves back to main NAND
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/WiiRoot.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/Source/Core/Core/WiiRoot.cpp b/Source/Core/Core/WiiRoot.cpp
index c849b5530d..78f73950a0 100644
--- a/Source/Core/Core/WiiRoot.cpp
+++ b/Source/Core/Core/WiiRoot.cpp
@@ -252,27 +252,28 @@ void CleanUpWiiFileSystemContents()
WARN_LOG(CORE, "Failed to copy Mii database to the NAND");
}
- const u64 title_id = SConfig::GetInstance().GetTitleID();
-
- const auto session_save = WiiSave::MakeNandStorage(ios->GetFS().get(), title_id);
-
- // FS won't write the save if the directory doesn't exist
- const std::string title_path = Common::GetTitleDataPath(title_id);
- if (!configured_fs->GetMetadata(IOS::PID_KERNEL, IOS::PID_KERNEL, title_path))
+ for (const u64 title_id : ios->GetES()->GetInstalledTitles())
{
- configured_fs->CreateDirectory(IOS::PID_KERNEL, IOS::PID_KERNEL, title_path, 0,
- {IOS::HLE::FS::Mode::ReadWrite, IOS::HLE::FS::Mode::ReadWrite,
- IOS::HLE::FS::Mode::ReadWrite});
- }
+ const auto session_save = WiiSave::MakeNandStorage(ios->GetFS().get(), title_id);
- const auto user_save = WiiSave::MakeNandStorage(configured_fs.get(), title_id);
+ // FS won't write the save if the directory doesn't exist
+ const std::string title_path = Common::GetTitleDataPath(title_id);
+ if (!configured_fs->GetMetadata(IOS::PID_KERNEL, IOS::PID_KERNEL, title_path))
+ {
+ configured_fs->CreateDirectory(IOS::PID_KERNEL, IOS::PID_KERNEL, title_path, 0,
+ {IOS::HLE::FS::Mode::ReadWrite, IOS::HLE::FS::Mode::ReadWrite,
+ IOS::HLE::FS::Mode::ReadWrite});
+ }
- const std::string backup_path =
- File::GetUserPath(D_BACKUP_IDX) + StringFromFormat("/%016" PRIx64 ".bin", title_id);
- const auto backup_save = WiiSave::MakeDataBinStorage(&ios->GetIOSC(), backup_path, "w+b");
+ const auto user_save = WiiSave::MakeNandStorage(configured_fs.get(), title_id);
- // Backup the existing save just in case it's still needed.
- WiiSave::Copy(user_save.get(), backup_save.get());
- WiiSave::Copy(session_save.get(), user_save.get());
+ const std::string backup_path =
+ File::GetUserPath(D_BACKUP_IDX) + StringFromFormat("/%016" PRIx64 ".bin", title_id);
+ const auto backup_save = WiiSave::MakeDataBinStorage(&ios->GetIOSC(), backup_path, "w+b");
+
+ // Backup the existing save just in case it's still needed.
+ WiiSave::Copy(user_save.get(), backup_save.get());
+ WiiSave::Copy(session_save.get(), user_save.get());
+ }
}
} // namespace Core