summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/registered_cache.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-02 01:23:38 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-02 01:23:38 +0100
commit97d425c3047e67cc36e7dec95cbcbc9236c6573f (patch)
tree78dd30139846e0913cd1099bc60a9c07b77fe859 /src/core/file_sys/registered_cache.cpp
parentcontent_archive: Add optional KeyManager parameter to constructor (diff)
downloadyuzu-97d425c3047e67cc36e7dec95cbcbc9236c6573f.tar
yuzu-97d425c3047e67cc36e7dec95cbcbc9236c6573f.tar.gz
yuzu-97d425c3047e67cc36e7dec95cbcbc9236c6573f.tar.bz2
yuzu-97d425c3047e67cc36e7dec95cbcbc9236c6573f.tar.lz
yuzu-97d425c3047e67cc36e7dec95cbcbc9236c6573f.tar.xz
yuzu-97d425c3047e67cc36e7dec95cbcbc9236c6573f.tar.zst
yuzu-97d425c3047e67cc36e7dec95cbcbc9236c6573f.zip
Diffstat (limited to '')
-rw-r--r--src/core/file_sys/registered_cache.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp
index 96302a241..a3f8f2f73 100644
--- a/src/core/file_sys/registered_cache.cpp
+++ b/src/core/file_sys/registered_cache.cpp
@@ -106,9 +106,12 @@ static ContentRecordType GetCRTypeFromNCAType(NCAContentType type) {
VirtualFile RegisteredCache::OpenFileOrDirectoryConcat(const VirtualDir& dir,
std::string_view path) const {
- if (dir->GetFileRelative(path) != nullptr)
- return dir->GetFileRelative(path);
- if (dir->GetDirectoryRelative(path) != nullptr) {
+ const auto file = dir->GetFileRelative(path);
+ if (file != nullptr)
+ return file;
+
+ const auto nca_dir = dir->GetDirectoryRelative(path);
+ if (nca_dir != nullptr) {
const auto nca_dir = dir->GetDirectoryRelative(path);
VirtualFile file = nullptr;
@@ -225,7 +228,7 @@ void RegisteredCache::ProcessFiles(const std::vector<NcaID>& ids) {
if (file == nullptr)
continue;
- const auto nca = std::make_shared<NCA>(parser(file, id));
+ const auto nca = std::make_shared<NCA>(parser(file, id), nullptr, 0, keys);
if (nca->GetStatus() != Loader::ResultStatus::Success ||
nca->GetType() != NCAContentType::Meta) {
continue;
@@ -315,7 +318,7 @@ std::unique_ptr<NCA> RegisteredCache::GetEntry(u64 title_id, ContentRecordType t
const auto raw = GetEntryRaw(title_id, type);
if (raw == nullptr)
return nullptr;
- return std::make_unique<NCA>(raw);
+ return std::make_unique<NCA>(raw, nullptr, 0, keys);
}
std::unique_ptr<NCA> RegisteredCache::GetEntry(RegisteredCacheEntry entry) const {