diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-07-28 00:14:03 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-07-28 00:14:03 +0200 |
commit | 906d785c73cb3644e8984fbfcbf5fcb8a1ebbc6f (patch) | |
tree | beff5b868534a8bfb4eea7992553fa5fb5db5287 /src/core/file_sys/content_archive.cpp | |
parent | Merge pull request #845 from lioncash/nfc (diff) | |
download | yuzu-906d785c73cb3644e8984fbfcbf5fcb8a1ebbc6f.tar yuzu-906d785c73cb3644e8984fbfcbf5fcb8a1ebbc6f.tar.gz yuzu-906d785c73cb3644e8984fbfcbf5fcb8a1ebbc6f.tar.bz2 yuzu-906d785c73cb3644e8984fbfcbf5fcb8a1ebbc6f.tar.lz yuzu-906d785c73cb3644e8984fbfcbf5fcb8a1ebbc6f.tar.xz yuzu-906d785c73cb3644e8984fbfcbf5fcb8a1ebbc6f.tar.zst yuzu-906d785c73cb3644e8984fbfcbf5fcb8a1ebbc6f.zip |
Diffstat (limited to 'src/core/file_sys/content_archive.cpp')
-rw-r--r-- | src/core/file_sys/content_archive.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp index d6b20c047..61cb0bbe3 100644 --- a/src/core/file_sys/content_archive.cpp +++ b/src/core/file_sys/content_archive.cpp @@ -9,6 +9,7 @@ #include "core/file_sys/content_archive.h" #include "core/file_sys/vfs_offset.h" #include "core/loader/loader.h" +#include "romfs.h" namespace FileSys { @@ -46,21 +47,9 @@ struct PFS0Superblock { }; static_assert(sizeof(PFS0Superblock) == 0x200, "PFS0Superblock has incorrect size."); -struct IVFCLevel { - u64_le offset; - u64_le size; - u32_le block_size; - u32_le reserved; -}; -static_assert(sizeof(IVFCLevel) == 0x18, "IVFCLevel has incorrect size."); - struct RomFSSuperblock { NCASectionHeaderBlock header_block; - u32_le magic; - u32_le magic_number; - INSERT_PADDING_BYTES(8); - std::array<IVFCLevel, 6> levels; - INSERT_PADDING_BYTES(64); + IVFCHeader ivfc; }; static_assert(sizeof(RomFSSuperblock) == 0xE8, "RomFSSuperblock has incorrect size."); @@ -92,8 +81,8 @@ NCA::NCA(VirtualFile file_) : file(std::move(file_)) { const size_t romfs_offset = header.section_tables[i].media_offset * MEDIA_OFFSET_MULTIPLIER + - sb.levels[IVFC_MAX_LEVEL - 1].offset; - const size_t romfs_size = sb.levels[IVFC_MAX_LEVEL - 1].size; + sb.ivfc.levels[IVFC_MAX_LEVEL - 1].offset; + const size_t romfs_size = sb.ivfc.levels[IVFC_MAX_LEVEL - 1].size; files.emplace_back(std::make_shared<OffsetVfsFile>(file, romfs_size, romfs_offset)); romfs = files.back(); } else if (block.filesystem_type == NCASectionFilesystemType::PFS0) { |