diff options
| author | 2018-09-25 09:18:55 -0400 | |
|---|---|---|
| committer | 2018-10-05 08:46:31 -0400 | |
| commit | 504574882914902f0648e30078038472ae985570 (patch) | |
| tree | bfa46c9144c1f0f1a5e2375c74996fd1065dbec6 /src/core/loader/nsp.cpp | |
| parent | loader: Add ReadRomFSIVFCOffset to NSP, XCI, and NAX loaders (diff) | |
| download | yuzu-504574882914902f0648e30078038472ae985570.tar.gz yuzu-504574882914902f0648e30078038472ae985570.tar.xz yuzu-504574882914902f0648e30078038472ae985570.zip | |
loader: Add getter for packed update
Reads the update included with the game if it has one and adds the new ErrorNoPackedUpdate status.
Diffstat (limited to 'src/core/loader/nsp.cpp')
| -rw-r--r-- | src/core/loader/nsp.cpp | 18 |
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 { | |||
| 104 | return secondary_loader->ReadRomFSIVFCOffset(); | 104 | return secondary_loader->ReadRomFSIVFCOffset(); |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | ResultStatus AppLoader_NSP::ReadUpdateRaw(FileSys::VirtualFile& file) { | ||
| 108 | if (nsp->IsExtractedType()) | ||
| 109 | return ResultStatus::ErrorNoPackedUpdate; | ||
| 110 | |||
| 111 | const auto read = | ||
| 112 | nsp->GetNCAFile(FileSys::GetUpdateTitleID(title_id), FileSys::ContentRecordType::Program); | ||
| 113 | |||
| 114 | if (read == nullptr) | ||
| 115 | return ResultStatus::ErrorNoPackedUpdate; | ||
| 116 | const auto nca_test = std::make_shared<FileSys::NCA>(read); | ||
| 117 | |||
| 118 | if (nca_test->GetStatus() != ResultStatus::ErrorMissingBKTRBaseRomFS) | ||
| 119 | return nca_test->GetStatus(); | ||
| 120 | |||
| 121 | file = read; | ||
| 122 | return ResultStatus::Success; | ||
| 123 | } | ||
| 124 | |||
| 107 | ResultStatus AppLoader_NSP::ReadProgramId(u64& out_program_id) { | 125 | ResultStatus AppLoader_NSP::ReadProgramId(u64& out_program_id) { |
| 108 | if (title_id == 0) | 126 | if (title_id == 0) |
| 109 | return ResultStatus::ErrorNotInitialized; | 127 | return ResultStatus::ErrorNotInitialized; |