summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2018-05-13 21:27:18 +0200
committerLéo Lam <leo@innovatetechnologi.es>2018-05-13 21:28:35 +0200
commitb405a1fbb1d941b23060ed09f899f10abc22b930 (patch)
tree0d1b35e9321244ea06cdc9eb43094efaaf3e85b0 /Source
parenta2ffe010f3f6d5903400f6e09dbeec632c3f0c40 (diff)
WiiSave: Reuse ES::GetInstalledTitles
Same thing, less code, no manual FS access.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/HW/WiiSave.cpp30
1 files changed, 2 insertions, 28 deletions
diff --git a/Source/Core/Core/HW/WiiSave.cpp b/Source/Core/Core/HW/WiiSave.cpp
index c4fa5033be..bdb514997c 100644
--- a/Source/Core/Core/HW/WiiSave.cpp
+++ b/Source/Core/Core/HW/WiiSave.cpp
@@ -28,6 +28,7 @@
#include "Common/NandPaths.h"
#include "Common/StringUtil.h"
#include "Core/CommonTitles.h"
+#include "Core/IOS/ES/ES.h"
#include "Core/IOS/IOS.h"
#include "Core/IOS/IOSC.h"
#include "Core/IOS/Uids.h"
@@ -57,35 +58,8 @@ bool WiiSave::Export(u64 title_id, std::string export_path)
size_t WiiSave::ExportAll(std::string export_path)
{
IOS::HLE::Kernel ios;
-
- std::string title_folder = File::GetUserPath(D_WIIROOT_IDX) + "/title";
- std::vector<u64> titles;
- const u32 path_mask = 0x00010000;
- for (int i = 0; i < 8; ++i)
- {
- std::string folder = StringFromFormat("%s/%08x/", title_folder.c_str(), path_mask | i);
- File::FSTEntry fst_tmp = File::ScanDirectoryTree(folder, false);
-
- for (const File::FSTEntry& entry : fst_tmp.children)
- {
- if (entry.isDirectory)
- {
- u32 game_id;
- if (AsciiToHex(entry.virtualName, game_id))
- {
- std::string banner_path =
- StringFromFormat("%s%08x/data/banner.bin", folder.c_str(), game_id);
- if (File::Exists(banner_path))
- {
- u64 title_id = (((u64)path_mask | i) << 32) | game_id;
- titles.push_back(title_id);
- }
- }
- }
- }
- }
size_t exported_save_count = 0;
- for (const u64& title : titles)
+ for (const u64 title : ios.GetES()->GetInstalledTitles())
{
WiiSave export_save{ios, title, export_path};
if (export_save.Export())