loader: Add getter for packed update
Reads the update included with the game if it has one and adds the new ErrorNoPackedUpdate status.
This commit is contained in:
parent
e948fbf5d0
commit
5045748829
6 changed files with 58 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue