summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/patch_manager.cpp7
-rw-r--r--src/core/file_sys/patch_manager.h3
-rw-r--r--src/core/file_sys/romfs_factory.cpp5
-rw-r--r--src/core/file_sys/romfs_factory.h1
-rw-r--r--src/core/file_sys/submission_package.cpp5
5 files changed, 15 insertions, 6 deletions
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp
index 3fc44fb5c..1ac00ebb0 100644
--- a/src/core/file_sys/patch_manager.cpp
+++ b/src/core/file_sys/patch_manager.cpp
@@ -206,7 +206,7 @@ VirtualFile PatchManager::PatchRomFS(VirtualFile romfs, u64 ivfc_offset, Content
206 romfs = new_nca->GetRomFS(); 206 romfs = new_nca->GetRomFS();
207 } 207 }
208 } else if (update_raw != nullptr) { 208 } else if (update_raw != nullptr) {
209 const auto new_nca = std::make_shared<NCA>(update, romfs, ivfc_offset); 209 const auto new_nca = std::make_shared<NCA>(update_raw, romfs, ivfc_offset);
210 if (new_nca->GetStatus() == Loader::ResultStatus::Success && 210 if (new_nca->GetStatus() == Loader::ResultStatus::Success &&
211 new_nca->GetRomFS() != nullptr) { 211 new_nca->GetRomFS() != nullptr) {
212 LOG_INFO(Loader, " RomFS: Update (PACKED) applied successfully"); 212 LOG_INFO(Loader, " RomFS: Update (PACKED) applied successfully");
@@ -231,7 +231,8 @@ static bool IsDirValidAndNonEmpty(const VirtualDir& dir) {
231 return dir != nullptr && (!dir->GetFiles().empty() || !dir->GetSubdirectories().empty()); 231 return dir != nullptr && (!dir->GetFiles().empty() || !dir->GetSubdirectories().empty());
232} 232}
233 233
234std::map<PatchType, std::string> PatchManager::GetPatchVersionNames(VirtualFile update_raw) const { 234std::map<std::string, std::string, std::less<>> PatchManager::GetPatchVersionNames(
235 VirtualFile update_raw) const {
235 std::map<std::string, std::string, std::less<>> out; 236 std::map<std::string, std::string, std::less<>> out;
236 const auto installed = Service::FileSystem::GetUnionContents(); 237 const auto installed = Service::FileSystem::GetUnionContents();
237 238
@@ -253,7 +254,7 @@ std::map<PatchType, std::string> PatchManager::GetPatchVersionNames(VirtualFile
253 FormatTitleVersion(meta_ver.get(), TitleVersionFormat::ThreeElements)); 254 FormatTitleVersion(meta_ver.get(), TitleVersionFormat::ThreeElements));
254 } 255 }
255 } else if (update_raw != nullptr) { 256 } else if (update_raw != nullptr) {
256 out[PatchType::Update] = "PACKED"; 257 out.insert_or_assign("Update", "PACKED");
257 } 258 }
258 } 259 }
259 260
diff --git a/src/core/file_sys/patch_manager.h b/src/core/file_sys/patch_manager.h
index e87ce54e5..2ae9322a1 100644
--- a/src/core/file_sys/patch_manager.h
+++ b/src/core/file_sys/patch_manager.h
@@ -51,7 +51,8 @@ public:
51 51
52 // Returns a vector of pairs between patch names and patch versions. 52 // Returns a vector of pairs between patch names and patch versions.
53 // i.e. Update 3.2.2 will return {"Update", "3.2.2"} 53 // i.e. Update 3.2.2 will return {"Update", "3.2.2"}
54 std::map<std::string, std::string, std::less<>> GetPatchVersionNames() const; 54 std::map<std::string, std::string, std::less<>> GetPatchVersionNames(
55 VirtualFile update_raw = nullptr) const;
55 56
56 // Given title_id of the program, attempts to get the control data of the update and parse it, 57 // Given title_id of the program, attempts to get the control data of the update and parse it,
57 // falling back to the base control data. 58 // falling back to the base control data.
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp
index a0ee16895..0b645b106 100644
--- a/src/core/file_sys/romfs_factory.cpp
+++ b/src/core/file_sys/romfs_factory.cpp
@@ -24,13 +24,16 @@ RomFSFactory::RomFSFactory(Loader::AppLoader& app_loader) {
24 LOG_ERROR(Service_FS, "Unable to read RomFS!"); 24 LOG_ERROR(Service_FS, "Unable to read RomFS!");
25 } 25 }
26 26
27 app_loader.ReadUpdateRaw(update_raw);
28 updatable = app_loader.IsRomFSUpdatable(); 27 updatable = app_loader.IsRomFSUpdatable();
29 ivfc_offset = app_loader.ReadRomFSIVFCOffset(); 28 ivfc_offset = app_loader.ReadRomFSIVFCOffset();
30} 29}
31 30
32RomFSFactory::~RomFSFactory() = default; 31RomFSFactory::~RomFSFactory() = default;
33 32
33void RomFSFactory::SetPackedUpdate(VirtualFile update_raw) {
34 this->update_raw = std::move(update_raw);
35}
36
34ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess() { 37ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess() {
35 if (!updatable) 38 if (!updatable)
36 return MakeResult<VirtualFile>(file); 39 return MakeResult<VirtualFile>(file);
diff --git a/src/core/file_sys/romfs_factory.h b/src/core/file_sys/romfs_factory.h
index 1cd4cedf1..7724c0b23 100644
--- a/src/core/file_sys/romfs_factory.h
+++ b/src/core/file_sys/romfs_factory.h
@@ -32,6 +32,7 @@ public:
32 explicit RomFSFactory(Loader::AppLoader& app_loader); 32 explicit RomFSFactory(Loader::AppLoader& app_loader);
33 ~RomFSFactory(); 33 ~RomFSFactory();
34 34
35 void SetPackedUpdate(VirtualFile update_raw);
35 ResultVal<VirtualFile> OpenCurrentProcess(); 36 ResultVal<VirtualFile> OpenCurrentProcess();
36 ResultVal<VirtualFile> Open(u64 title_id, StorageId storage, ContentRecordType type); 37 ResultVal<VirtualFile> Open(u64 title_id, StorageId storage, ContentRecordType type);
37 38
diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp
index 09bf077cd..ab5dc900c 100644
--- a/src/core/file_sys/submission_package.cpp
+++ b/src/core/file_sys/submission_package.cpp
@@ -259,8 +259,11 @@ void NSP::ReadNCAs(const std::vector<VirtualFile>& files) {
259 auto next_nca = std::make_shared<NCA>(next_file); 259 auto next_nca = std::make_shared<NCA>(next_file);
260 if (next_nca->GetType() == NCAContentType::Program) 260 if (next_nca->GetType() == NCAContentType::Program)
261 program_status[cnmt.GetTitleID()] = next_nca->GetStatus(); 261 program_status[cnmt.GetTitleID()] = next_nca->GetStatus();
262 if (next_nca->GetStatus() == Loader::ResultStatus::Success) 262 if (next_nca->GetStatus() == Loader::ResultStatus::Success ||
263 (next_nca->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS &&
264 (cnmt.GetTitleID() & 0x800) != 0)) {
263 ncas_title[rec.type] = std::move(next_nca); 265 ncas_title[rec.type] = std::move(next_nca);
266 }
264 } 267 }
265 268
266 break; 269 break;