mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-26 10:01:21 -08:00
XCI: Add function for checking the existence of the program NCA
The only reason the getter existed was to check whether or not the program NCA was null. Instead, we can just provide a function to query for the existence of it, instead of exposing it entirely.
This commit is contained in:
parent
78f2a6a9e1
commit
73e1e929a2
@ -122,14 +122,16 @@ u64 XCI::GetProgramTitleID() const {
|
|||||||
return secure_partition->GetProgramTitleID();
|
return secure_partition->GetProgramTitleID();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<NCA> XCI::GetProgramNCA() const {
|
bool XCI::HasProgramNCA() const {
|
||||||
return program;
|
return program != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
VirtualFile XCI::GetProgramNCAFile() const {
|
VirtualFile XCI::GetProgramNCAFile() const {
|
||||||
if (GetProgramNCA() == nullptr)
|
if (!HasProgramNCA()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
return GetProgramNCA()->GetBaseFile();
|
}
|
||||||
|
|
||||||
|
return program->GetBaseFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<std::shared_ptr<NCA>>& XCI::GetNCAs() const {
|
const std::vector<std::shared_ptr<NCA>>& XCI::GetNCAs() const {
|
||||||
|
@ -80,7 +80,7 @@ public:
|
|||||||
|
|
||||||
u64 GetProgramTitleID() const;
|
u64 GetProgramTitleID() const;
|
||||||
|
|
||||||
std::shared_ptr<NCA> GetProgramNCA() const;
|
bool HasProgramNCA() const;
|
||||||
VirtualFile GetProgramNCAFile() const;
|
VirtualFile GetProgramNCAFile() const;
|
||||||
const std::vector<std::shared_ptr<NCA>>& GetNCAs() const;
|
const std::vector<std::shared_ptr<NCA>>& GetNCAs() const;
|
||||||
std::shared_ptr<NCA> GetNCAByType(NCAContentType type) const;
|
std::shared_ptr<NCA> GetNCAByType(NCAContentType type) const;
|
||||||
|
@ -59,8 +59,7 @@ ResultStatus AppLoader_XCI::Load(Kernel::Process& process) {
|
|||||||
if (xci->GetProgramNCAStatus() != ResultStatus::Success)
|
if (xci->GetProgramNCAStatus() != ResultStatus::Success)
|
||||||
return xci->GetProgramNCAStatus();
|
return xci->GetProgramNCAStatus();
|
||||||
|
|
||||||
const auto nca = xci->GetProgramNCA();
|
if (!xci->HasProgramNCA() && !Core::Crypto::KeyManager::KeyFileExists(false))
|
||||||
if (nca == nullptr && !Core::Crypto::KeyManager::KeyFileExists(false))
|
|
||||||
return ResultStatus::ErrorMissingProductionKeyFile;
|
return ResultStatus::ErrorMissingProductionKeyFile;
|
||||||
|
|
||||||
const auto result = nca_loader->Load(process);
|
const auto result = nca_loader->Load(process);
|
||||||
|
Loading…
Reference in New Issue
Block a user