aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/file_sys/archive_extsavedata.cpp
diff options
context:
space:
mode:
authorGravatar Subv <subv2112@gmail.com>2015-01-03 20:46:05 -0500
committerGravatar Subv <subv2112@gmail.com>2015-01-03 20:46:05 -0500
commit71a063f45cba961ee07730f4ab79f2bcc3ff9b5b (patch)
tree3c134bc71fd404b33a6d6fcaed743457d7fb7e66 /src/core/file_sys/archive_extsavedata.cpp
parentcfd7b219f6ad9116057fbe64bbb5dfd0afbbe29c (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_extsavedata.cpp')
-rw-r--r--src/core/file_sys/archive_extsavedata.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp
index 2f00bf06..5de2aae4 100644
--- a/src/core/file_sys/archive_extsavedata.cpp
+++ b/src/core/file_sys/archive_extsavedata.cpp
@@ -9,6 +9,7 @@
#include "core/file_sys/archive_extsavedata.h"
#include "core/file_sys/disk_archive.h"
+#include "core/hle/service/fs/archive.h"
#include "core/settings.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -24,9 +25,16 @@ static std::string GetExtSaveDataPath(const std::string& mount_point, const Path
return Common::StringFromFormat("%s%08X/%08X/", mount_point.c_str(), save_high, save_low);
}
-Archive_ExtSaveData::Archive_ExtSaveData(const std::string& mount_point)
- : DiskArchive(mount_point), concrete_mount_point(mount_point) {
- LOG_INFO(Service_FS, "Directory %s set as base for ExtSaveData.", this->mount_point.c_str());
+static std::string GetExtDataContainerPath(const std::string& mount_point, bool shared) {
+ if (shared)
+ return Common::StringFromFormat("%sdata/%32x/extdata/", mount_point.c_str(), ID0);
+
+ return Common::StringFromFormat("%sNintendo 3DS/%32x/%32x/extdata/", mount_point.c_str(), ID0, ID1);
+}
+
+Archive_ExtSaveData::Archive_ExtSaveData(const std::string& mount_location, bool shared)
+ : DiskArchive(GetExtDataContainerPath(mount_location, shared)), concrete_mount_point(mount_point) {
+ LOG_INFO(Service_FS, "Directory %s set as base for ExtSaveData.", mount_point.c_str());
}
bool Archive_ExtSaveData::Initialize() {