summaryrefslogtreecommitdiffstats
path: root/src/core/loader/nsp.cpp
diff options
context:
space:
mode:
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;