diff options
author | Subv <subv2112@gmail.com> | 2015-01-03 20:46:05 -0500 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2015-01-03 20:46:05 -0500 |
commit | 71a063f45cba961ee07730f4ab79f2bcc3ff9b5b (patch) | |
tree | 3c134bc71fd404b33a6d6fcaed743457d7fb7e66 /src/core/file_sys/archive_savedatacheck.cpp | |
parent | cfd7b219f6ad9116057fbe64bbb5dfd0afbbe29c (diff) |
Archives: Changed the way paths are built for the archives.
Each archive now takes a mount point of either NAND or SDMC, and builds its own directory structure there, trying to simulate an HLE-friendly hardware layout
Diffstat (limited to 'src/core/file_sys/archive_savedatacheck.cpp')
-rw-r--r-- | src/core/file_sys/archive_savedatacheck.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_savedatacheck.cpp index 1b1e01c6..dcd56377 100644 --- a/src/core/file_sys/archive_savedatacheck.cpp +++ b/src/core/file_sys/archive_savedatacheck.cpp @@ -5,13 +5,24 @@ #include "common/file_util.h" #include "core/file_sys/archive_savedatacheck.h" +#include "core/hle/service/fs/archive.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace namespace FileSys { -Archive_SaveDataCheck::Archive_SaveDataCheck(const std::string& mount_loc) : mount_point(mount_loc) { +static std::string GetSaveDataCheckContainerPath(const std::string& mount_point) { + return Common::StringFromFormat("%stitle/", mount_point.c_str(), ID0); +} + +static std::string GetSaveDataCheckPath(const std::string& mount_point, u32 high, u32 low) { + return Common::StringFromFormat("%s%08x/%08x/content/00000000.app.romfs", + mount_point.c_str(), high, low); +} + +Archive_SaveDataCheck::Archive_SaveDataCheck(const std::string& mount_loc) : +mount_point(GetSaveDataCheckContainerPath(mount_loc)) { } ResultCode Archive_SaveDataCheck::Open(const Path& path) { @@ -23,8 +34,7 @@ ResultCode Archive_SaveDataCheck::Open(const Path& path) { // this archive again with a different path, will corrupt the previously open file. auto vec = path.AsBinary(); const u32* data = reinterpret_cast<u32*>(vec.data()); - std::string file_path = Common::StringFromFormat("%s%08x/%08x/content/00000000.app.romfs", - mount_point.c_str(), data[1], data[0]); + std::string file_path = GetSaveDataCheckPath(mount_point, data[1], data[0]); FileUtil::IOFile file(file_path, "rb"); std::fill(raw_data.begin(), raw_data.end(), 0); |