summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorGravatar wwylele2016-10-21 22:10:55 +0800
committerGravatar wwylele2016-11-19 18:55:35 +0200
commitd7d6975af0971f5a07d489bdef522ca121bb30ec (patch)
tree561c62a130c719cd3e6ffe7051d6be8a54e30cb6 /src/core/file_sys
parentFileSys: remove unused DiskArchive (diff)
downloadyuzu-d7d6975af0971f5a07d489bdef522ca121bb30ec.tar.gz
yuzu-d7d6975af0971f5a07d489bdef522ca121bb30ec.tar.xz
yuzu-d7d6975af0971f5a07d489bdef522ca121bb30ec.zip
FileSys: rename SaveDataCheck archive to NCCH archive
According to the observation from game and 3dbrew "Used for accessing general NCCH data"
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/archive_ncch.cpp (renamed from src/core/file_sys/archive_savedatacheck.cpp)22
-rw-r--r--src/core/file_sys/archive_ncch.h (renamed from src/core/file_sys/archive_savedatacheck.h)8
2 files changed, 15 insertions, 15 deletions
diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_ncch.cpp
index 6c4542b7d..6f1aadfc3 100644
--- a/src/core/file_sys/archive_savedatacheck.cpp
+++ b/src/core/file_sys/archive_ncch.cpp
@@ -9,7 +9,7 @@
9#include "common/file_util.h" 9#include "common/file_util.h"
10#include "common/logging/log.h" 10#include "common/logging/log.h"
11#include "common/string_util.h" 11#include "common/string_util.h"
12#include "core/file_sys/archive_savedatacheck.h" 12#include "core/file_sys/archive_ncch.h"
13#include "core/file_sys/ivfc_archive.h" 13#include "core/file_sys/ivfc_archive.h"
14#include "core/hle/service/fs/archive.h" 14#include "core/hle/service/fs/archive.h"
15 15
@@ -18,22 +18,22 @@
18 18
19namespace FileSys { 19namespace FileSys {
20 20
21static std::string GetSaveDataCheckContainerPath(const std::string& nand_directory) { 21static std::string GetNCCHContainerPath(const std::string& nand_directory) {
22 return Common::StringFromFormat("%s%s/title/", nand_directory.c_str(), SYSTEM_ID.c_str()); 22 return Common::StringFromFormat("%s%s/title/", nand_directory.c_str(), SYSTEM_ID.c_str());
23} 23}
24 24
25static std::string GetSaveDataCheckPath(const std::string& mount_point, u32 high, u32 low) { 25static std::string GetNCCHPath(const std::string& mount_point, u32 high, u32 low) {
26 return Common::StringFromFormat("%s%08x/%08x/content/00000000.app.romfs", mount_point.c_str(), 26 return Common::StringFromFormat("%s%08x/%08x/content/00000000.app.romfs", mount_point.c_str(),
27 high, low); 27 high, low);
28} 28}
29 29
30ArchiveFactory_SaveDataCheck::ArchiveFactory_SaveDataCheck(const std::string& nand_directory) 30ArchiveFactory_NCCH::ArchiveFactory_NCCH(const std::string& nand_directory)
31 : mount_point(GetSaveDataCheckContainerPath(nand_directory)) {} 31 : mount_point(GetNCCHContainerPath(nand_directory)) {}
32 32
33ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SaveDataCheck::Open(const Path& path) { 33ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_NCCH::Open(const Path& path) {
34 auto vec = path.AsBinary(); 34 auto vec = path.AsBinary();
35 const u32* data = reinterpret_cast<u32*>(vec.data()); 35 const u32* data = reinterpret_cast<u32*>(vec.data());
36 std::string file_path = GetSaveDataCheckPath(mount_point, data[1], data[0]); 36 std::string file_path = GetNCCHPath(mount_point, data[1], data[0]);
37 auto file = std::make_shared<FileUtil::IOFile>(file_path, "rb"); 37 auto file = std::make_shared<FileUtil::IOFile>(file_path, "rb");
38 38
39 if (!file->IsOpen()) { 39 if (!file->IsOpen()) {
@@ -45,15 +45,15 @@ ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SaveDataCheck::Open(co
45 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive)); 45 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive));
46} 46}
47 47
48ResultCode ArchiveFactory_SaveDataCheck::Format(const Path& path, 48ResultCode ArchiveFactory_NCCH::Format(const Path& path,
49 const FileSys::ArchiveFormatInfo& format_info) { 49 const FileSys::ArchiveFormatInfo& format_info) {
50 LOG_ERROR(Service_FS, "Attempted to format a SaveDataCheck archive."); 50 LOG_ERROR(Service_FS, "Attempted to format a NCCH archive.");
51 // TODO: Verify error code 51 // TODO: Verify error code
52 return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::FS, ErrorSummary::NotSupported, 52 return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::FS, ErrorSummary::NotSupported,
53 ErrorLevel::Permanent); 53 ErrorLevel::Permanent);
54} 54}
55 55
56ResultVal<ArchiveFormatInfo> ArchiveFactory_SaveDataCheck::GetFormatInfo(const Path& path) const { 56ResultVal<ArchiveFormatInfo> ArchiveFactory_NCCH::GetFormatInfo(const Path& path) const {
57 // TODO(Subv): Implement 57 // TODO(Subv): Implement
58 LOG_ERROR(Service_FS, "Unimplemented GetFormatInfo archive %s", GetName().c_str()); 58 LOG_ERROR(Service_FS, "Unimplemented GetFormatInfo archive %s", GetName().c_str());
59 return ResultCode(-1); 59 return ResultCode(-1);
diff --git a/src/core/file_sys/archive_savedatacheck.h b/src/core/file_sys/archive_ncch.h
index e9cafbed9..66b8ce75d 100644
--- a/src/core/file_sys/archive_savedatacheck.h
+++ b/src/core/file_sys/archive_ncch.h
@@ -14,13 +14,13 @@
14 14
15namespace FileSys { 15namespace FileSys {
16 16
17/// File system interface to the SaveDataCheck archive 17/// File system interface to the NCCH archive
18class ArchiveFactory_SaveDataCheck final : public ArchiveFactory { 18class ArchiveFactory_NCCH final : public ArchiveFactory {
19public: 19public:
20 ArchiveFactory_SaveDataCheck(const std::string& mount_point); 20 ArchiveFactory_NCCH(const std::string& mount_point);
21 21
22 std::string GetName() const override { 22 std::string GetName() const override {
23 return "SaveDataCheck"; 23 return "NCCH";
24 } 24 }
25 25
26 ResultVal<std::unique_ptr<ArchiveBackend>> Open(const Path& path) override; 26 ResultVal<std::unique_ptr<ArchiveBackend>> Open(const Path& path) override;