fusee_cpp: add logic for loading mtc overlays

This commit is contained in:
Michael Scire 2021-08-23 21:15:51 -07:00 committed by SciresM
parent 4480e7a8a5
commit 3bcdd0c3c8
157 changed files with 2222 additions and 47 deletions

View file

@ -23,15 +23,57 @@ namespace ams::nxboot {
constexpr inline const size_t InitialProcessStorageSizeMax = 3_MB / 8;
struct SecondaryArchiveHeader {
/* TODO */
u8 data[1_MB];
struct SecondaryArchiveContentMeta {
u32 offset;
u32 size;
u8 type;
u8 flags[3];
u32 pad;
char name[0x10];
};
static_assert(sizeof(SecondaryArchiveContentMeta) == 0x20);
struct SecondaryArchiveKipMeta {
u64 program_id;
u32 offset;
u32 size;
};
static_assert(sizeof(SecondaryArchiveKipMeta) == 0x10);
struct SecondaryArchiveHeader {
static constexpr u32 Magic = util::FourCC<'F','S','S','0'>::Code;
u32 reserved0; /* Previously entrypoint. */
u32 metadata_offset;
u32 revision;
u32 num_kips;
u32 reserved1[4];
u32 magic;
u32 total_size;
u32 reserved2; /* Previously crt0 offset. */
u32 content_header_offset;
u32 num_content_headers;
u32 supported_hos_version;
u32 release_version;
u32 git_revision;
SecondaryArchiveContentMeta content_metas[(0x400 - 0x40) / sizeof(SecondaryArchiveContentMeta)];
SecondaryArchiveKipMeta emummc_meta;
SecondaryArchiveKipMeta kip_metas[8];
u8 reserved3[0x800 - 0x490];
};
static_assert(sizeof(SecondaryArchiveHeader) == 0x800);
struct SecondaryArchive {
SecondaryArchiveHeader header;
u8 kips[8][InitialProcessStorageSizeMax];
u8 splash_screen_framebuffer[FrameBufferSize];
SecondaryArchiveHeader header; /* 0x000000-0x000800 */
u8 warmboot[0x1800]; /* 0x000800-0x002000 */
u8 tsec_keygen[0x2000]; /* 0x002000-0x004000 */
u8 mariko_fatal[0x1C000]; /* 0x004000-0x020000 */
u8 ovl_mtc_erista[0x14000]; /* 0x020000-0x034000 */
u8 ovl_mtc_mariko[0x14000]; /* 0x034000-0x048000 */
u8 exosphere[0x10000]; /* 0x048000-0x058000 */
u8 mesosphere[0xA8000]; /* 0x058000-0x100000 */
u8 kips[3_MB]; /* 0x100000-0x400000 */
u8 splash_screen_fb[FrameBufferSize]; /* 0x400000-0x7C0000 */
};
static_assert(sizeof(SecondaryArchive) == SecondaryArchiveSize);