diff options
| author | 2016-10-21 22:10:55 +0800 | |
|---|---|---|
| committer | 2016-11-19 18:55:35 +0200 | |
| commit | d7d6975af0971f5a07d489bdef522ca121bb30ec (patch) | |
| tree | 561c62a130c719cd3e6ffe7051d6be8a54e30cb6 /src/core/file_sys | |
| parent | FileSys: remove unused DiskArchive (diff) | |
| download | yuzu-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 | ||
| 19 | namespace FileSys { | 19 | namespace FileSys { |
| 20 | 20 | ||
| 21 | static std::string GetSaveDataCheckContainerPath(const std::string& nand_directory) { | 21 | static 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 | ||
| 25 | static std::string GetSaveDataCheckPath(const std::string& mount_point, u32 high, u32 low) { | 25 | static 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 | ||
| 30 | ArchiveFactory_SaveDataCheck::ArchiveFactory_SaveDataCheck(const std::string& nand_directory) | 30 | ArchiveFactory_NCCH::ArchiveFactory_NCCH(const std::string& nand_directory) |
| 31 | : mount_point(GetSaveDataCheckContainerPath(nand_directory)) {} | 31 | : mount_point(GetNCCHContainerPath(nand_directory)) {} |
| 32 | 32 | ||
| 33 | ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SaveDataCheck::Open(const Path& path) { | 33 | ResultVal<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 | ||
| 48 | ResultCode ArchiveFactory_SaveDataCheck::Format(const Path& path, | 48 | ResultCode 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 | ||
| 56 | ResultVal<ArchiveFormatInfo> ArchiveFactory_SaveDataCheck::GetFormatInfo(const Path& path) const { | 56 | ResultVal<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 | ||
| 15 | namespace FileSys { | 15 | namespace FileSys { |
| 16 | 16 | ||
| 17 | /// File system interface to the SaveDataCheck archive | 17 | /// File system interface to the NCCH archive |
| 18 | class ArchiveFactory_SaveDataCheck final : public ArchiveFactory { | 18 | class ArchiveFactory_NCCH final : public ArchiveFactory { |
| 19 | public: | 19 | public: |
| 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; |