From c4f3400bead6b666b803e3990a4aba625a2dfe70 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sun, 22 Sep 2019 21:51:46 -0400 Subject: card_image: Add accessors for raw partitions in XCI --- src/core/file_sys/card_image.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/core/file_sys/card_image.cpp') 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(partition)]; +} + +VirtualFile XCI::GetSecurePartitionRaw() const { + return GetPartitionRaw(XCIPartition::Secure); +} + +VirtualFile XCI::GetStoragePartition0() const { + return std::make_shared(file, update_normal_partition_end, 0, "partition0"); +} + +VirtualFile XCI::GetStoragePartition1() const { + return std::make_shared(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(); } -- cgit v1.2.3