Add option to configure to download system files from Nintendo Update Service (#6269)

Co-authored-by: B3n30 <benediktthomas@gmail.com>
This commit is contained in:
Steveice10 2023-02-09 11:58:08 -08:00 committed by GitHub
parent 691cb43871
commit 6bef34852c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 1076 additions and 10 deletions

View file

@ -16,8 +16,6 @@
namespace FileSys {
constexpr u32 CIA_SECTION_ALIGNMENT = 0x40;
Loader::ResultStatus CIAContainer::Load(const FileBackend& backend) {
std::vector<u8> header_data(sizeof(Header));

View file

@ -29,6 +29,7 @@ constexpr std::size_t CIA_CONTENT_BITS_SIZE = (CIA_CONTENT_MAX_COUNT / 8);
constexpr std::size_t CIA_HEADER_SIZE = 0x2020;
constexpr std::size_t CIA_DEPENDENCY_SIZE = 0x300;
constexpr std::size_t CIA_METADATA_SIZE = 0x400;
constexpr u32 CIA_SECTION_ALIGNMENT = 0x40;
/**
* Helper which implements an interface to read and write CTR Installable Archive (CIA) files.
@ -69,7 +70,6 @@ public:
void Print() const;
private:
struct Header {
u32_le header_size;
u16_le type;
@ -87,10 +87,14 @@ private:
// The bits in the content index are arranged w/ index 0 as the MSB, 7 as the LSB, etc.
return (content_present[index >> 3] & (0x80 >> (index & 7))) != 0;
}
void SetContentPresent(u16 index) {
content_present[index >> 3] |= (0x80 >> (index & 7));
}
};
static_assert(sizeof(Header) == CIA_HEADER_SIZE, "CIA Header structure size is wrong");
private:
struct Metadata {
std::array<u64_le, 0x30> dependencies;
std::array<u8, 0x180> reserved;