diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/patch_manager.cpp | 7 | ||||
| -rw-r--r-- | src/core/file_sys/patch_manager.h | 3 | ||||
| -rw-r--r-- | src/core/file_sys/romfs_factory.cpp | 5 | ||||
| -rw-r--r-- | src/core/file_sys/romfs_factory.h | 1 | ||||
| -rw-r--r-- | src/core/file_sys/submission_package.cpp | 5 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 9 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 1 | ||||
| -rw-r--r-- | src/core/loader/nsp.cpp | 6 | ||||
| -rw-r--r-- | src/core/loader/xci.cpp | 5 | ||||
| -rw-r--r-- | src/yuzu/game_list_worker.cpp | 5 |
10 files changed, 38 insertions, 9 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 | ||
| 234 | std::map<PatchType, std::string> PatchManager::GetPatchVersionNames(VirtualFile update_raw) const { | 234 | std::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 | ||
| 32 | RomFSFactory::~RomFSFactory() = default; | 31 | RomFSFactory::~RomFSFactory() = default; |
| 33 | 32 | ||
| 33 | void RomFSFactory::SetPackedUpdate(VirtualFile update_raw) { | ||
| 34 | this->update_raw = std::move(update_raw); | ||
| 35 | } | ||
| 36 | |||
| 34 | ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess() { | 37 | ResultVal<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; |
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index aed2abb71..439e62d27 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -264,6 +264,15 @@ ResultCode RegisterBIS(std::unique_ptr<FileSys::BISFactory>&& factory) { | |||
| 264 | return RESULT_SUCCESS; | 264 | return RESULT_SUCCESS; |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | void SetPackedUpdate(FileSys::VirtualFile update_raw) { | ||
| 268 | LOG_TRACE(Service_FS, "Setting packed update for romfs"); | ||
| 269 | |||
| 270 | if (romfs_factory == nullptr) | ||
| 271 | return; | ||
| 272 | |||
| 273 | romfs_factory->SetPackedUpdate(std::move(update_raw)); | ||
| 274 | } | ||
| 275 | |||
| 267 | ResultVal<FileSys::VirtualFile> OpenRomFSCurrentProcess() { | 276 | ResultVal<FileSys::VirtualFile> OpenRomFSCurrentProcess() { |
| 268 | LOG_TRACE(Service_FS, "Opening RomFS for current process"); | 277 | LOG_TRACE(Service_FS, "Opening RomFS for current process"); |
| 269 | 278 | ||
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 7039a2247..53b01bb01 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -39,6 +39,7 @@ ResultCode RegisterSaveData(std::unique_ptr<FileSys::SaveDataFactory>&& factory) | |||
| 39 | ResultCode RegisterSDMC(std::unique_ptr<FileSys::SDMCFactory>&& factory); | 39 | ResultCode RegisterSDMC(std::unique_ptr<FileSys::SDMCFactory>&& factory); |
| 40 | ResultCode RegisterBIS(std::unique_ptr<FileSys::BISFactory>&& factory); | 40 | ResultCode RegisterBIS(std::unique_ptr<FileSys::BISFactory>&& factory); |
| 41 | 41 | ||
| 42 | void SetPackedUpdate(FileSys::VirtualFile update_raw); | ||
| 42 | ResultVal<FileSys::VirtualFile> OpenRomFSCurrentProcess(); | 43 | ResultVal<FileSys::VirtualFile> OpenRomFSCurrentProcess(); |
| 43 | ResultVal<FileSys::VirtualFile> OpenRomFS(u64 title_id, FileSys::StorageId storage_id, | 44 | ResultVal<FileSys::VirtualFile> OpenRomFS(u64 title_id, FileSys::StorageId storage_id, |
| 44 | FileSys::ContentRecordType type); | 45 | FileSys::ContentRecordType type); |
diff --git a/src/core/loader/nsp.cpp b/src/core/loader/nsp.cpp index a630b618c..5534ce01c 100644 --- a/src/core/loader/nsp.cpp +++ b/src/core/loader/nsp.cpp | |||
| @@ -10,8 +10,10 @@ | |||
| 10 | #include "core/file_sys/control_metadata.h" | 10 | #include "core/file_sys/control_metadata.h" |
| 11 | #include "core/file_sys/nca_metadata.h" | 11 | #include "core/file_sys/nca_metadata.h" |
| 12 | #include "core/file_sys/patch_manager.h" | 12 | #include "core/file_sys/patch_manager.h" |
| 13 | #include "core/file_sys/registered_cache.h" | ||
| 13 | #include "core/file_sys/submission_package.h" | 14 | #include "core/file_sys/submission_package.h" |
| 14 | #include "core/hle/kernel/process.h" | 15 | #include "core/hle/kernel/process.h" |
| 16 | #include "core/hle/service/filesystem/filesystem.h" | ||
| 15 | #include "core/loader/deconstructed_rom_directory.h" | 17 | #include "core/loader/deconstructed_rom_directory.h" |
| 16 | #include "core/loader/nca.h" | 18 | #include "core/loader/nca.h" |
| 17 | #include "core/loader/nsp.h" | 19 | #include "core/loader/nsp.h" |
| @@ -91,6 +93,10 @@ ResultStatus AppLoader_NSP::Load(Kernel::Process& process) { | |||
| 91 | if (result != ResultStatus::Success) | 93 | if (result != ResultStatus::Success) |
| 92 | return result; | 94 | return result; |
| 93 | 95 | ||
| 96 | FileSys::VirtualFile update_raw; | ||
| 97 | if (ReadUpdateRaw(update_raw) == ResultStatus::Success && update_raw != nullptr) | ||
| 98 | Service::FileSystem::SetPackedUpdate(std::move(update_raw)); | ||
| 99 | |||
| 94 | is_loaded = true; | 100 | is_loaded = true; |
| 95 | 101 | ||
| 96 | return ResultStatus::Success; | 102 | return ResultStatus::Success; |
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index 9d91ef03a..ee5452eb9 100644 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include "core/file_sys/romfs.h" | 13 | #include "core/file_sys/romfs.h" |
| 14 | #include "core/file_sys/submission_package.h" | 14 | #include "core/file_sys/submission_package.h" |
| 15 | #include "core/hle/kernel/process.h" | 15 | #include "core/hle/kernel/process.h" |
| 16 | #include "core/hle/service/filesystem/filesystem.h" | ||
| 16 | #include "core/loader/nca.h" | 17 | #include "core/loader/nca.h" |
| 17 | #include "core/loader/xci.h" | 18 | #include "core/loader/xci.h" |
| 18 | 19 | ||
| @@ -66,6 +67,10 @@ ResultStatus AppLoader_XCI::Load(Kernel::Process& process) { | |||
| 66 | if (result != ResultStatus::Success) | 67 | if (result != ResultStatus::Success) |
| 67 | return result; | 68 | return result; |
| 68 | 69 | ||
| 70 | FileSys::VirtualFile update_raw; | ||
| 71 | if (ReadUpdateRaw(update_raw) == ResultStatus::Success && update_raw != nullptr) | ||
| 72 | Service::FileSystem::SetPackedUpdate(std::move(update_raw)); | ||
| 73 | |||
| 69 | is_loaded = true; | 74 | is_loaded = true; |
| 70 | 75 | ||
| 71 | return ResultStatus::Success; | 76 | return ResultStatus::Success; |
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index af5b20b90..d2b3de683 100644 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp | |||
| @@ -72,11 +72,10 @@ QString FormatPatchNameVersions(const FileSys::PatchManager& patch_manager, | |||
| 72 | auto ver = kv.second; | 72 | auto ver = kv.second; |
| 73 | 73 | ||
| 74 | // Display container name for packed updates | 74 | // Display container name for packed updates |
| 75 | if (ver == "PACKED" && kv.first == FileSys::PatchType::Update) | 75 | if (ver == "PACKED" && kv.first == "Update") |
| 76 | ver = Loader::GetFileTypeString(loader.GetFileType()); | 76 | ver = Loader::GetFileTypeString(loader.GetFileType()); |
| 77 | 77 | ||
| 78 | out.append( | 78 | out.append(fmt::format("{} ({})\n", kv.first, ver).c_str()); |
| 79 | fmt::format("{} ({})\n", FileSys::FormatPatchTypeName(kv.first), ver).c_str()); | ||
| 80 | } | 79 | } |
| 81 | } | 80 | } |
| 82 | 81 | ||