summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-18 17:51:47 +0200
committerGitHub <noreply@github.com>2018-10-18 17:51:47 +0200
commitd4ff4152ad72c6b6111e234152285c94125b646b (patch)
tree088dc40401f64c33d5376c1dcf50d71a19eb7ab7 /src
parentMerge pull request #1505 from FernandoS27/tex-3d (diff)
parentXCI: Add function for checking the existence of the program NCA (diff)
downloadyuzu-d4ff4152ad72c6b6111e234152285c94125b646b.tar
yuzu-d4ff4152ad72c6b6111e234152285c94125b646b.tar.gz
yuzu-d4ff4152ad72c6b6111e234152285c94125b646b.tar.bz2
yuzu-d4ff4152ad72c6b6111e234152285c94125b646b.tar.lz
yuzu-d4ff4152ad72c6b6111e234152285c94125b646b.tar.xz
yuzu-d4ff4152ad72c6b6111e234152285c94125b646b.tar.zst
yuzu-d4ff4152ad72c6b6111e234152285c94125b646b.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/card_image.cpp10
-rw-r--r--src/core/file_sys/card_image.h2
-rw-r--r--src/core/loader/xci.cpp3
3 files changed, 8 insertions, 7 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp
index 8f5142a07..ecdd7505b 100644
--- a/src/core/file_sys/card_image.cpp
+++ b/src/core/file_sys/card_image.cpp
@@ -122,14 +122,16 @@ u64 XCI::GetProgramTitleID() const {
return secure_partition->GetProgramTitleID();
}
-std::shared_ptr<NCA> XCI::GetProgramNCA() const {
- return program;
+bool XCI::HasProgramNCA() const {
+ return program != nullptr;
}
VirtualFile XCI::GetProgramNCAFile() const {
- if (GetProgramNCA() == nullptr)
+ if (!HasProgramNCA()) {
return nullptr;
- return GetProgramNCA()->GetBaseFile();
+ }
+
+ return program->GetBaseFile();
}
const std::vector<std::shared_ptr<NCA>>& XCI::GetNCAs() const {
diff --git a/src/core/file_sys/card_image.h b/src/core/file_sys/card_image.h
index ce514dfa0..48cbef666 100644
--- a/src/core/file_sys/card_image.h
+++ b/src/core/file_sys/card_image.h
@@ -80,7 +80,7 @@ public:
u64 GetProgramTitleID() const;
- std::shared_ptr<NCA> GetProgramNCA() const;
+ bool HasProgramNCA() const;
VirtualFile GetProgramNCAFile() const;
const std::vector<std::shared_ptr<NCA>>& GetNCAs() const;
std::shared_ptr<NCA> GetNCAByType(NCAContentType type) const;
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp
index 7a619acb4..461607c95 100644
--- a/src/core/loader/xci.cpp
+++ b/src/core/loader/xci.cpp
@@ -59,8 +59,7 @@ ResultStatus AppLoader_XCI::Load(Kernel::Process& process) {
if (xci->GetProgramNCAStatus() != ResultStatus::Success)
return xci->GetProgramNCAStatus();
- const auto nca = xci->GetProgramNCA();
- if (nca == nullptr && !Core::Crypto::KeyManager::KeyFileExists(false))
+ if (!xci->HasProgramNCA() && !Core::Crypto::KeyManager::KeyFileExists(false))
return ResultStatus::ErrorMissingProductionKeyFile;
const auto result = nca_loader->Load(process);