diff options
| author | 2019-01-15 15:56:32 -0500 | |
|---|---|---|
| committer | 2019-01-15 16:00:29 -0500 | |
| commit | 318bf7c8e3a31d444fa0308804b4c1cf0c2470be (patch) | |
| tree | 0a44dcb9aac9bdf6ee4552a44ace1ad1338f2e38 /src | |
| parent | Merge pull request #2020 from otaviopace/remove-spaces (diff) | |
| download | yuzu-318bf7c8e3a31d444fa0308804b4c1cf0c2470be.tar.gz yuzu-318bf7c8e3a31d444fa0308804b4c1cf0c2470be.tar.xz yuzu-318bf7c8e3a31d444fa0308804b4c1cf0c2470be.zip | |
content_archive: Add getter for logo section of NCA
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/content_archive.cpp | 6 | ||||
| -rw-r--r-- | src/core/file_sys/content_archive.h | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp index 19b6f8600..5aa3b600b 100644 --- a/src/core/file_sys/content_archive.cpp +++ b/src/core/file_sys/content_archive.cpp | |||
| @@ -359,6 +359,8 @@ bool NCA::ReadPFS0Section(const NCASectionHeader& section, const NCASectionTable | |||
| 359 | dirs.push_back(std::move(npfs)); | 359 | dirs.push_back(std::move(npfs)); |
| 360 | if (IsDirectoryExeFS(dirs.back())) | 360 | if (IsDirectoryExeFS(dirs.back())) |
| 361 | exefs = dirs.back(); | 361 | exefs = dirs.back(); |
| 362 | else if (IsDirectoryLogoPartition(dirs.back())) | ||
| 363 | logo = dirs.back(); | ||
| 362 | } else { | 364 | } else { |
| 363 | if (has_rights_id) | 365 | if (has_rights_id) |
| 364 | status = Loader::ResultStatus::ErrorIncorrectTitlekeyOrTitlekek; | 366 | status = Loader::ResultStatus::ErrorIncorrectTitlekeyOrTitlekek; |
| @@ -546,4 +548,8 @@ u64 NCA::GetBaseIVFCOffset() const { | |||
| 546 | return ivfc_offset; | 548 | return ivfc_offset; |
| 547 | } | 549 | } |
| 548 | 550 | ||
| 551 | VirtualDir NCA::GetLogoPartition() const { | ||
| 552 | return logo; | ||
| 553 | } | ||
| 554 | |||
| 549 | } // namespace FileSys | 555 | } // namespace FileSys |
diff --git a/src/core/file_sys/content_archive.h b/src/core/file_sys/content_archive.h index 99294cbb4..5d4d05c82 100644 --- a/src/core/file_sys/content_archive.h +++ b/src/core/file_sys/content_archive.h | |||
| @@ -74,6 +74,13 @@ inline bool IsDirectoryExeFS(const std::shared_ptr<VfsDirectory>& pfs) { | |||
| 74 | return pfs->GetFile("main") != nullptr && pfs->GetFile("main.npdm") != nullptr; | 74 | return pfs->GetFile("main") != nullptr && pfs->GetFile("main.npdm") != nullptr; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | inline bool IsDirectoryLogoPartition(const VirtualDir& pfs) { | ||
| 78 | // NintendoLogo is the static image in the top left corner while StartupMovie is the animation | ||
| 79 | // in the bottom right corner. | ||
| 80 | return pfs->GetFile("NintendoLogo.png") != nullptr && | ||
| 81 | pfs->GetFile("StartupMovie.gif") != nullptr; | ||
| 82 | } | ||
| 83 | |||
| 77 | // An implementation of VfsDirectory that represents a Nintendo Content Archive (NCA) conatiner. | 84 | // An implementation of VfsDirectory that represents a Nintendo Content Archive (NCA) conatiner. |
| 78 | // After construction, use GetStatus to determine if the file is valid and ready to be used. | 85 | // After construction, use GetStatus to determine if the file is valid and ready to be used. |
| 79 | class NCA : public ReadOnlyVfsDirectory { | 86 | class NCA : public ReadOnlyVfsDirectory { |
| @@ -102,6 +109,8 @@ public: | |||
| 102 | // Returns the base ivfc offset used in BKTR patching. | 109 | // Returns the base ivfc offset used in BKTR patching. |
| 103 | u64 GetBaseIVFCOffset() const; | 110 | u64 GetBaseIVFCOffset() const; |
| 104 | 111 | ||
| 112 | VirtualDir GetLogoPartition() const; | ||
| 113 | |||
| 105 | private: | 114 | private: |
| 106 | bool CheckSupportedNCA(const NCAHeader& header); | 115 | bool CheckSupportedNCA(const NCAHeader& header); |
| 107 | bool HandlePotentialHeaderDecryption(); | 116 | bool HandlePotentialHeaderDecryption(); |
| @@ -122,6 +131,7 @@ private: | |||
| 122 | 131 | ||
| 123 | VirtualFile romfs = nullptr; | 132 | VirtualFile romfs = nullptr; |
| 124 | VirtualDir exefs = nullptr; | 133 | VirtualDir exefs = nullptr; |
| 134 | VirtualDir logo = nullptr; | ||
| 125 | VirtualFile file; | 135 | VirtualFile file; |
| 126 | VirtualFile bktr_base_romfs; | 136 | VirtualFile bktr_base_romfs; |
| 127 | u64 ivfc_offset = 0; | 137 | u64 ivfc_offset = 0; |