From 417e1ef09cfcf9157e260721d3059e73f0eca73e Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Thu, 6 Dec 2018 20:25:55 -0500 Subject: control_metadata: Update NACP fields with latest Switchbrew data --- src/core/file_sys/control_metadata.cpp | 8 ++++++++ src/core/file_sys/control_metadata.h | 27 +++++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'src/core/file_sys') diff --git a/src/core/file_sys/control_metadata.cpp b/src/core/file_sys/control_metadata.cpp index fe2077f94..9624df054 100644 --- a/src/core/file_sys/control_metadata.cpp +++ b/src/core/file_sys/control_metadata.cpp @@ -79,6 +79,14 @@ std::string NACP::GetVersionString() const { raw.version_string.size()); } +u64 NACP::GetDefaultNormalSaveSize() const { + return raw.normal_save_data_size; +} + +u64 NACP::GetDefaultJournalSaveSize() const { + return raw.journal_sava_data_size; +} + std::vector NACP::GetRawBytes() const { std::vector out(sizeof(RawNACP)); std::memcpy(out.data(), &raw, sizeof(RawNACP)); diff --git a/src/core/file_sys/control_metadata.h b/src/core/file_sys/control_metadata.h index d5c2ed2b5..9bc2720c9 100644 --- a/src/core/file_sys/control_metadata.h +++ b/src/core/file_sys/control_metadata.h @@ -28,17 +28,30 @@ static_assert(sizeof(LanguageEntry) == 0x300, "LanguageEntry has incorrect size. // The raw file format of a NACP file. struct RawNACP { std::array language_entries; - INSERT_PADDING_BYTES(0x38); + std::array isbn; + u8 startup_user_account; + INSERT_PADDING_BYTES(2); + u32_le application_attribute; + u32_le supported_languages; + u32_le parental_control; + bool screenshot_enabled; + u8 video_capture_mode; + bool data_loss_confirmation; + INSERT_PADDING_BYTES(1); u64_le title_id; - INSERT_PADDING_BYTES(0x20); + std::array rating_age; std::array version_string; u64_le dlc_base_title_id; u64_le title_id_2; - INSERT_PADDING_BYTES(0x28); + u64_le normal_save_data_size; + u64_le journal_sava_data_size; + INSERT_PADDING_BYTES(0x18); u64_le product_code; - u64_le title_id_3; - std::array title_id_array; - INSERT_PADDING_BYTES(0x8); + std::array local_communication; + u8 logo_type; + u8 logo_handling; + bool runtime_add_on_content_install; + INSERT_PADDING_BYTES(5); u64_le title_id_update; std::array bcat_passphrase; INSERT_PADDING_BYTES(0xEC0); @@ -82,6 +95,8 @@ public: u64 GetTitleId() const; u64 GetDLCBaseTitleId() const; std::string GetVersionString() const; + u64 GetDefaultNormalSaveSize() const; + u64 GetDefaultJournalSaveSize() const; std::vector GetRawBytes() const; private: -- cgit v1.2.3