diff options
| author | 2019-09-22 21:51:46 -0400 | |
|---|---|---|
| committer | 2019-09-22 21:51:46 -0400 | |
| commit | c4f3400bead6b666b803e3990a4aba625a2dfe70 (patch) | |
| tree | 2124be6fa0b5b06f85fedfe21e2d809ccc51261c | |
| parent | card_image: Lazily load partitions in XCI (diff) | |
| download | yuzu-c4f3400bead6b666b803e3990a4aba625a2dfe70.tar.gz yuzu-c4f3400bead6b666b803e3990a4aba625a2dfe70.tar.xz yuzu-c4f3400bead6b666b803e3990a4aba625a2dfe70.zip | |
card_image: Add accessors for raw partitions in XCI
Diffstat (limited to '')
| -rw-r--r-- | src/core/file_sys/card_image.cpp | 29 | ||||
| -rw-r--r-- | src/core/file_sys/card_image.h | 7 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index c79f0885e..a6a68b748 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp | |||
| @@ -139,6 +139,35 @@ VirtualDir XCI::GetLogoPartition() { | |||
| 139 | return GetPartition(XCIPartition::Logo); | 139 | return GetPartition(XCIPartition::Logo); |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | VirtualFile XCI::GetPartitionRaw(XCIPartition partition) const { | ||
| 143 | return partitions_raw[static_cast<std::size_t>(partition)]; | ||
| 144 | } | ||
| 145 | |||
| 146 | VirtualFile XCI::GetSecurePartitionRaw() const { | ||
| 147 | return GetPartitionRaw(XCIPartition::Secure); | ||
| 148 | } | ||
| 149 | |||
| 150 | VirtualFile XCI::GetStoragePartition0() const { | ||
| 151 | return std::make_shared<OffsetVfsFile>(file, update_normal_partition_end, 0, "partition0"); | ||
| 152 | } | ||
| 153 | |||
| 154 | VirtualFile XCI::GetStoragePartition1() const { | ||
| 155 | return std::make_shared<OffsetVfsFile>(file, file->GetSize() - update_normal_partition_end, | ||
| 156 | update_normal_partition_end, "partition1"); | ||
| 157 | } | ||
| 158 | |||
| 159 | VirtualFile XCI::GetNormalPartitionRaw() const { | ||
| 160 | return GetPartitionRaw(XCIPartition::Normal); | ||
| 161 | } | ||
| 162 | |||
| 163 | VirtualFile XCI::GetUpdatePartitionRaw() const { | ||
| 164 | return GetPartitionRaw(XCIPartition::Update); | ||
| 165 | } | ||
| 166 | |||
| 167 | VirtualFile XCI::GetLogoPartitionRaw() const { | ||
| 168 | return GetPartitionRaw(XCIPartition::Logo); | ||
| 169 | } | ||
| 170 | |||
| 142 | u64 XCI::GetProgramTitleID() const { | 171 | u64 XCI::GetProgramTitleID() const { |
| 143 | return secure_partition->GetProgramTitleID(); | 172 | return secure_partition->GetProgramTitleID(); |
| 144 | } | 173 | } |
diff --git a/src/core/file_sys/card_image.h b/src/core/file_sys/card_image.h index ea2ad7741..c2ee0ea99 100644 --- a/src/core/file_sys/card_image.h +++ b/src/core/file_sys/card_image.h | |||
| @@ -92,6 +92,13 @@ public: | |||
| 92 | VirtualDir GetUpdatePartition(); | 92 | VirtualDir GetUpdatePartition(); |
| 93 | VirtualDir GetLogoPartition(); | 93 | VirtualDir GetLogoPartition(); |
| 94 | 94 | ||
| 95 | VirtualFile GetPartitionRaw(XCIPartition partition) const; | ||
| 96 | VirtualFile GetSecurePartitionRaw() const; | ||
| 97 | VirtualFile GetStoragePartition0() const; | ||
| 98 | VirtualFile GetStoragePartition1() const; | ||
| 99 | VirtualFile GetNormalPartitionRaw() const; | ||
| 100 | VirtualFile GetUpdatePartitionRaw() const; | ||
| 101 | VirtualFile GetLogoPartitionRaw() const; | ||
| 95 | 102 | ||
| 96 | u64 GetProgramTitleID() const; | 103 | u64 GetProgramTitleID() const; |
| 97 | u32 GetSystemUpdateVersion(); | 104 | u32 GetSystemUpdateVersion(); |