diff options
author | Lioncash <mathew1800@gmail.com> | 2020-08-23 16:26:18 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-08-23 16:26:20 +0200 |
commit | f83c6e1e0c14c587f2df63aa95eb97b9df7ea742 (patch) | |
tree | 90b072ad86f4dab5aa914c0d5e31589ef3624cc6 | |
parent | Merge pull request #4546 from lioncash/telemetry (diff) | |
download | yuzu-f83c6e1e0c14c587f2df63aa95eb97b9df7ea742.tar yuzu-f83c6e1e0c14c587f2df63aa95eb97b9df7ea742.tar.gz yuzu-f83c6e1e0c14c587f2df63aa95eb97b9df7ea742.tar.bz2 yuzu-f83c6e1e0c14c587f2df63aa95eb97b9df7ea742.tar.lz yuzu-f83c6e1e0c14c587f2df63aa95eb97b9df7ea742.tar.xz yuzu-f83c6e1e0c14c587f2df63aa95eb97b9df7ea742.tar.zst yuzu-f83c6e1e0c14c587f2df63aa95eb97b9df7ea742.zip |
-rw-r--r-- | src/core/file_sys/registered_cache.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index e42b677f7..a97f079c0 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -621,25 +621,25 @@ InstallResult RegisteredCache::InstallEntry(const NSP& nsp, bool overwrite_if_ex InstallResult RegisteredCache::InstallEntry(const NCA& nca, TitleType type, bool overwrite_if_exists, const VfsCopyFunction& copy) { - CNMTHeader header{ - nca.GetTitleId(), // Title ID - 0, // Ignore/Default title version - type, // Type - {}, // Padding - 0x10, // Default table offset - 1, // 1 Content Entry - 0, // No Meta Entries - {}, // Padding - {}, // Reserved 1 - 0, // Is committed - 0, // Required download system version - {}, // Reserved 2 + const CNMTHeader header{ + .title_id = nca.GetTitleId(), + .title_version = 0, + .type = type, + .reserved = {}, + .table_offset = 0x10, + .number_content_entries = 1, + .number_meta_entries = 0, + .attributes = 0, + .reserved2 = {}, + .is_committed = 0, + .required_download_system_version = 0, + .reserved3 = {}, }; - OptionalHeader opt_header{0, 0}; + const OptionalHeader opt_header{0, 0}; ContentRecord c_rec{{}, {}, {}, GetCRTypeFromNCAType(nca.GetType()), {}}; const auto& data = nca.GetBaseFile()->ReadBytes(0x100000); mbedtls_sha256_ret(data.data(), data.size(), c_rec.hash.data(), 0); - memcpy(&c_rec.nca_id, &c_rec.hash, 16); + std::memcpy(&c_rec.nca_id, &c_rec.hash, 16); const CNMT new_cnmt(header, opt_header, {c_rec}, {}); if (!RawInstallYuzuMeta(new_cnmt)) { return InstallResult::ErrorMetaFailed; |