summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/romfs.h
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-07-28 00:14:03 +0200
committerZach Hilman <zachhilman@gmail.com>2018-07-28 00:14:03 +0200
commit906d785c73cb3644e8984fbfcbf5fcb8a1ebbc6f (patch)
treebeff5b868534a8bfb4eea7992553fa5fb5db5287 /src/core/file_sys/romfs.h
parentMerge pull request #845 from lioncash/nfc (diff)
downloadyuzu-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/romfs.h')
-rw-r--r--src/core/file_sys/romfs.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/core/file_sys/romfs.h b/src/core/file_sys/romfs.h
new file mode 100644
index 000000000..03a876d22
--- /dev/null
+++ b/src/core/file_sys/romfs.h
@@ -0,0 +1,35 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include <array>
+#include "common/common_funcs.h"
+#include "common/swap.h"
+#include "core/file_sys/vfs.h"
+
+namespace FileSys {
+
+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 IVFCHeader {
+ u32_le magic;
+ u32_le magic_number;
+ INSERT_PADDING_BYTES(8);
+ std::array<IVFCLevel, 6> levels;
+ INSERT_PADDING_BYTES(64);
+};
+static_assert(sizeof(IVFCHeader) == 0xE0, "IVFCHeader has incorrect size.");
+
+// Converts a RomFS binary blob to VFS Filesystem
+// Returns nullptr on failure
+VirtualDir ExtractRomFS(VirtualFile file);
+
+} // namespace FileSys