summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/archive_extsavedata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/file_sys/archive_extsavedata.cpp')
-rw-r--r--src/core/file_sys/archive_extsavedata.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp
index 4759ef3ae..0805f42ae 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"
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -19,15 +20,22 @@ namespace FileSys {
static std::string GetExtSaveDataPath(const std::string& mount_point, const Path& path) {
std::vector<u8> vec_data = path.AsBinary();
const u32* data = reinterpret_cast<const u32*>(vec_data.data());
- u32 media_type = data[0];
u32 save_low = data[1];
u32 save_high = data[2];
- return Common::StringFromFormat("%s%s/%08X/%08X/", mount_point.c_str(), media_type == 0 ? "nand" : "sdmc", save_high, save_low);
+ 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/%s/extdata/", mount_point.c_str(), SYSTEM_ID.c_str());
+
+ return Common::StringFromFormat("%sNintendo 3DS/%s/%s/extdata/", mount_point.c_str(),
+ SYSTEM_ID.c_str(), SDCARD_ID.c_str());
+}
+
+Archive_ExtSaveData::Archive_ExtSaveData(const std::string& mount_location, bool shared)
+ : DiskArchive(GetExtDataContainerPath(mount_location, shared)) {
+ LOG_INFO(Service_FS, "Directory %s set as base for ExtSaveData.", mount_point.c_str());
}
bool Archive_ExtSaveData::Initialize() {