summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-09-23 03:51:46 +0200
committerZach Hilman <zachhilman@gmail.com>2019-09-23 03:51:46 +0200
commitc4f3400bead6b666b803e3990a4aba625a2dfe70 (patch)
tree2124be6fa0b5b06f85fedfe21e2d809ccc51261c
parentcard_image: Lazily load partitions in XCI (diff)
downloadyuzu-c4f3400bead6b666b803e3990a4aba625a2dfe70.tar
yuzu-c4f3400bead6b666b803e3990a4aba625a2dfe70.tar.gz
yuzu-c4f3400bead6b666b803e3990a4aba625a2dfe70.tar.bz2
yuzu-c4f3400bead6b666b803e3990a4aba625a2dfe70.tar.lz
yuzu-c4f3400bead6b666b803e3990a4aba625a2dfe70.tar.xz
yuzu-c4f3400bead6b666b803e3990a4aba625a2dfe70.tar.zst
yuzu-c4f3400bead6b666b803e3990a4aba625a2dfe70.zip
-rw-r--r--src/core/file_sys/card_image.cpp29
-rw-r--r--src/core/file_sys/card_image.h7
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() {
return GetPartition(XCIPartition::Logo);
}
+VirtualFile XCI::GetPartitionRaw(XCIPartition partition) const {
+ return partitions_raw[static_cast<std::size_t>(partition)];
+}
+
+VirtualFile XCI::GetSecurePartitionRaw() const {
+ return GetPartitionRaw(XCIPartition::Secure);
+}
+
+VirtualFile XCI::GetStoragePartition0() const {
+ return std::make_shared<OffsetVfsFile>(file, update_normal_partition_end, 0, "partition0");
+}
+
+VirtualFile XCI::GetStoragePartition1() const {
+ return std::make_shared<OffsetVfsFile>(file, file->GetSize() - update_normal_partition_end,
+ update_normal_partition_end, "partition1");
+}
+
+VirtualFile XCI::GetNormalPartitionRaw() const {
+ return GetPartitionRaw(XCIPartition::Normal);
+}
+
+VirtualFile XCI::GetUpdatePartitionRaw() const {
+ return GetPartitionRaw(XCIPartition::Update);
+}
+
+VirtualFile XCI::GetLogoPartitionRaw() const {
+ return GetPartitionRaw(XCIPartition::Logo);
+}
+
u64 XCI::GetProgramTitleID() const {
return secure_partition->GetProgramTitleID();
}
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:
VirtualDir GetUpdatePartition();
VirtualDir GetLogoPartition();
+ VirtualFile GetPartitionRaw(XCIPartition partition) const;
+ VirtualFile GetSecurePartitionRaw() const;
+ VirtualFile GetStoragePartition0() const;
+ VirtualFile GetStoragePartition1() const;
+ VirtualFile GetNormalPartitionRaw() const;
+ VirtualFile GetUpdatePartitionRaw() const;
+ VirtualFile GetLogoPartitionRaw() const;
u64 GetProgramTitleID() const;
u32 GetSystemUpdateVersion();