summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-06-10 06:19:23 +0200
committerZach Hilman <zachhilman@gmail.com>2019-06-10 06:19:23 +0200
commit1c75945dc4a89307f04d5f48a4363adb44d08ac8 (patch)
treea1ee5ac652f237f34bd07c3f0146e2febd4e9558
parentMerge pull request #2571 from lioncash/ref (diff)
downloadyuzu-1c75945dc4a89307f04d5f48a4363adb44d08ac8.tar
yuzu-1c75945dc4a89307f04d5f48a4363adb44d08ac8.tar.gz
yuzu-1c75945dc4a89307f04d5f48a4363adb44d08ac8.tar.bz2
yuzu-1c75945dc4a89307f04d5f48a4363adb44d08ac8.tar.lz
yuzu-1c75945dc4a89307f04d5f48a4363adb44d08ac8.tar.xz
yuzu-1c75945dc4a89307f04d5f48a4363adb44d08ac8.tar.zst
yuzu-1c75945dc4a89307f04d5f48a4363adb44d08ac8.zip
-rw-r--r--src/core/file_sys/submission_package.cpp21
-rw-r--r--src/core/loader/nsp.cpp2
2 files changed, 22 insertions, 1 deletions
diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp
index c69caae0f..753d2f58a 100644
--- a/src/core/file_sys/submission_package.cpp
+++ b/src/core/file_sys/submission_package.cpp
@@ -85,12 +85,29 @@ Loader::ResultStatus NSP::GetProgramStatus(u64 title_id) const {
}
u64 NSP::GetFirstTitleID() const {
+ if (IsExtractedType()) {
+ return GetProgramTitleID();
+ }
+
if (program_status.empty())
return 0;
return program_status.begin()->first;
}
u64 NSP::GetProgramTitleID() const {
+ if (IsExtractedType()) {
+ if (GetExeFS() == nullptr || !IsDirectoryExeFS(GetExeFS())) {
+ return 0;
+ }
+
+ ProgramMetadata meta;
+ if (meta.Load(GetExeFS()->GetFile("main.npdm")) == Loader::ResultStatus::Success) {
+ return meta.GetTitleID();
+ } else {
+ return 0;
+ }
+ }
+
const auto out = GetFirstTitleID();
if ((out & 0x800) == 0)
return out;
@@ -102,6 +119,10 @@ u64 NSP::GetProgramTitleID() const {
}
std::vector<u64> NSP::GetTitleIDs() const {
+ if (IsExtractedType()) {
+ return {GetProgramTitleID()};
+ }
+
std::vector<u64> out;
out.reserve(ncas.size());
for (const auto& kv : ncas)
diff --git a/src/core/loader/nsp.cpp b/src/core/loader/nsp.cpp
index ad56bbb38..8b90bbd30 100644
--- a/src/core/loader/nsp.cpp
+++ b/src/core/loader/nsp.cpp
@@ -77,7 +77,7 @@ AppLoader_NSP::LoadResult AppLoader_NSP::Load(Kernel::Process& process) {
return {ResultStatus::ErrorAlreadyLoaded, {}};
}
- if (title_id == 0) {
+ if (!nsp->IsExtractedType() && title_id == 0) {
return {ResultStatus::ErrorNSPMissingProgramNCA, {}};
}