From fa3d72ab3e5ba8b3e8dccdb1d3bd9b976dbc28e2 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 18 Dec 2014 23:35:24 -0500 Subject: CFG: Implemented the GetConfigInfoBlk2 function. Added a "config" file to the CFG process service (CFG:U), and added a few default blocks to it. Implemented GetSystemModel and GetModelNintendo2DS --- src/core/file_sys/archive_backend.h | 5 +++++ src/core/file_sys/archive_systemsavedata.cpp | 5 +++-- src/core/file_sys/archive_systemsavedata.h | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/core/file_sys') diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index eb1fdaa1f..e2979be17 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h @@ -45,6 +45,11 @@ public: { } + Path(const char* path): + type(Char), string(path) + { + } + Path(LowPathType type, u32 size, u32 pointer): type(type) { diff --git a/src/core/file_sys/archive_systemsavedata.cpp b/src/core/file_sys/archive_systemsavedata.cpp index 5da1ec946..392c3cd39 100644 --- a/src/core/file_sys/archive_systemsavedata.cpp +++ b/src/core/file_sys/archive_systemsavedata.cpp @@ -16,8 +16,9 @@ namespace FileSys { -Archive_SystemSaveData::Archive_SystemSaveData(const std::string& mount_point) - : DiskArchive(mount_point) { +Archive_SystemSaveData::Archive_SystemSaveData(const std::string& mount_point, u64 save_id) + : DiskArchive(Common::StringFromFormat("%s%08X/%08X/", mount_point.c_str(), + static_cast(save_id & 0xFFFFFFFF), static_cast((save_id >> 31) & 0xFFFFFFFF))) { LOG_INFO(Service_FS, "Directory %s set as SystemSaveData.", this->mount_point.c_str()); } diff --git a/src/core/file_sys/archive_systemsavedata.h b/src/core/file_sys/archive_systemsavedata.h index c3ebb7c99..443e27091 100644 --- a/src/core/file_sys/archive_systemsavedata.h +++ b/src/core/file_sys/archive_systemsavedata.h @@ -19,7 +19,7 @@ namespace FileSys { /// specifically nand:/data//sysdata// class Archive_SystemSaveData final : public DiskArchive { public: - Archive_SystemSaveData(const std::string& mount_point); + Archive_SystemSaveData(const std::string& mount_point, u64 save_id); /** * Initialize the archive. -- cgit v1.2.3 From 4cd21b43c1e28933898c4a2e829555efe22ff12e Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 19 Dec 2014 15:30:25 -0500 Subject: CFG: Refactored how the config file works. It is now kept in memory as per 3dbrew, all updates happen on memory, then they can be saved using UpdateConfigNANDSavegame. --- src/core/file_sys/archive_systemsavedata.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/file_sys') diff --git a/src/core/file_sys/archive_systemsavedata.cpp b/src/core/file_sys/archive_systemsavedata.cpp index 392c3cd39..b942864b2 100644 --- a/src/core/file_sys/archive_systemsavedata.cpp +++ b/src/core/file_sys/archive_systemsavedata.cpp @@ -18,7 +18,7 @@ namespace FileSys { Archive_SystemSaveData::Archive_SystemSaveData(const std::string& mount_point, u64 save_id) : DiskArchive(Common::StringFromFormat("%s%08X/%08X/", mount_point.c_str(), - static_cast(save_id & 0xFFFFFFFF), static_cast((save_id >> 31) & 0xFFFFFFFF))) { + static_cast(save_id & 0xFFFFFFFF), static_cast((save_id >> 32) & 0xFFFFFFFF))) { LOG_INFO(Service_FS, "Directory %s set as SystemSaveData.", this->mount_point.c_str()); } -- cgit v1.2.3 From a1b9b80a55121320fa543fa40fcde0addb205d24 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 20 Dec 2014 23:33:33 -0500 Subject: Style: Addressed some comments --- src/core/file_sys/archive_systemsavedata.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/core/file_sys') diff --git a/src/core/file_sys/archive_systemsavedata.cpp b/src/core/file_sys/archive_systemsavedata.cpp index b942864b2..0da32d510 100644 --- a/src/core/file_sys/archive_systemsavedata.cpp +++ b/src/core/file_sys/archive_systemsavedata.cpp @@ -16,9 +16,14 @@ namespace FileSys { +static std::string GetSystemSaveDataPath(const std::string& mount_point, u64 save_id) { + u32 save_high = static_cast((save_id >> 32) & 0xFFFFFFFF); + u32 save_low = static_cast(save_id & 0xFFFFFFFF); + return Common::StringFromFormat("%s%08X/%08X/", mount_point.c_str(), save_low, save_high); +} + Archive_SystemSaveData::Archive_SystemSaveData(const std::string& mount_point, u64 save_id) - : DiskArchive(Common::StringFromFormat("%s%08X/%08X/", mount_point.c_str(), - static_cast(save_id & 0xFFFFFFFF), static_cast((save_id >> 32) & 0xFFFFFFFF))) { + : DiskArchive(GetSystemSaveDataPath(mount_point, save_id)) { LOG_INFO(Service_FS, "Directory %s set as SystemSaveData.", this->mount_point.c_str()); } -- cgit v1.2.3 From 6115f013a9df6faf66c9799ab25ecb106182b8c2 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 21 Dec 2014 16:36:18 -0500 Subject: CFG: Create a new subfolder cfg inside service to handle cfg Moved most of the shared CFG code there, implemented a few CFG:I functions --- src/core/file_sys/disk_archive.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/core/file_sys') diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index c1784e870..6c9b689e0 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h @@ -5,6 +5,7 @@ #pragma once #include "common/common_types.h" +#include "common/file_util.h" #include "core/file_sys/archive_backend.h" #include "core/loader/loader.h" -- cgit v1.2.3