summaryrefslogtreecommitdiffstats
path: root/src/core/loader/nsp.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-09-25 15:18:55 +0200
committerZach Hilman <zachhilman@gmail.com>2018-10-05 14:46:31 +0200
commit504574882914902f0648e30078038472ae985570 (patch)
treebfa46c9144c1f0f1a5e2375c74996fd1065dbec6 /src/core/loader/nsp.cpp
parentloader: Add ReadRomFSIVFCOffset to NSP, XCI, and NAX loaders (diff)
downloadyuzu-504574882914902f0648e30078038472ae985570.tar
yuzu-504574882914902f0648e30078038472ae985570.tar.gz
yuzu-504574882914902f0648e30078038472ae985570.tar.bz2
yuzu-504574882914902f0648e30078038472ae985570.tar.lz
yuzu-504574882914902f0648e30078038472ae985570.tar.xz
yuzu-504574882914902f0648e30078038472ae985570.tar.zst
yuzu-504574882914902f0648e30078038472ae985570.zip
Diffstat (limited to '')
-rw-r--r--src/core/loader/nsp.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/loader/nsp.cpp b/src/core/loader/nsp.cpp
index ae1edf9ca..a630b618c 100644
--- a/src/core/loader/nsp.cpp
+++ b/src/core/loader/nsp.cpp
@@ -104,6 +104,24 @@ u64 AppLoader_NSP::ReadRomFSIVFCOffset() const {
return secondary_loader->ReadRomFSIVFCOffset();
}
+ResultStatus AppLoader_NSP::ReadUpdateRaw(FileSys::VirtualFile& file) {
+ if (nsp->IsExtractedType())
+ return ResultStatus::ErrorNoPackedUpdate;
+
+ const auto read =
+ nsp->GetNCAFile(FileSys::GetUpdateTitleID(title_id), FileSys::ContentRecordType::Program);
+
+ if (read == nullptr)
+ return ResultStatus::ErrorNoPackedUpdate;
+ const auto nca_test = std::make_shared<FileSys::NCA>(read);
+
+ if (nca_test->GetStatus() != ResultStatus::ErrorMissingBKTRBaseRomFS)
+ return nca_test->GetStatus();
+
+ file = read;
+ return ResultStatus::Success;
+}
+
ResultStatus AppLoader_NSP::ReadProgramId(u64& out_program_id) {
if (title_id == 0)
return ResultStatus::ErrorNotInitialized;