diff options
| author | 2018-12-10 21:52:19 -0500 | |
|---|---|---|
| committer | 2018-12-10 21:52:19 -0500 | |
| commit | 2c45c6d23431021efb1053abcb40064256aac338 (patch) | |
| tree | edd00a30fa32460e8158992d53768038e83141dc /src/core | |
| parent | Merge pull request #1887 from FearlessTobi/port-4476 (diff) | |
| parent | qt: Add Properties menu to game list right-click (diff) | |
| download | yuzu-2c45c6d23431021efb1053abcb40064256aac338.tar.gz yuzu-2c45c6d23431021efb1053abcb40064256aac338.tar.xz yuzu-2c45c6d23431021efb1053abcb40064256aac338.zip | |
Merge pull request #1819 from DarkLordZach/disable-addons
patch_manager: Add support for disabling patches
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/core.cpp | 8 | ||||
| -rw-r--r-- | src/core/core.h | 4 | ||||
| -rw-r--r-- | src/core/file_sys/patch_manager.cpp | 56 | ||||
| -rw-r--r-- | src/core/file_sys/patch_manager.h | 5 | ||||
| -rw-r--r-- | src/core/hle/service/aoc/aoc_u.cpp | 12 | ||||
| -rw-r--r-- | src/core/loader/loader.h | 10 | ||||
| -rw-r--r-- | src/core/loader/nsp.cpp | 7 | ||||
| -rw-r--r-- | src/core/loader/nsp.h | 1 | ||||
| -rw-r--r-- | src/core/loader/xci.cpp | 7 | ||||
| -rw-r--r-- | src/core/loader/xci.h | 1 | ||||
| -rw-r--r-- | src/core/settings.h | 5 |
11 files changed, 102 insertions, 14 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 795fabc65..ce7851538 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <thread> | 8 | #include <thread> |
| 9 | #include <utility> | 9 | #include <utility> |
| 10 | 10 | ||
| 11 | #include "common/file_util.h" | ||
| 11 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 12 | #include "common/string_util.h" | 13 | #include "common/string_util.h" |
| 13 | #include "core/arm/exclusive_monitor.h" | 14 | #include "core/arm/exclusive_monitor.h" |
| @@ -40,7 +41,6 @@ namespace Core { | |||
| 40 | 41 | ||
| 41 | /*static*/ System System::s_instance; | 42 | /*static*/ System System::s_instance; |
| 42 | 43 | ||
| 43 | namespace { | ||
| 44 | FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, | 44 | FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, |
| 45 | const std::string& path) { | 45 | const std::string& path) { |
| 46 | // To account for split 00+01+etc files. | 46 | // To account for split 00+01+etc files. |
| @@ -69,11 +69,13 @@ FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, | |||
| 69 | return FileSys::ConcatenatedVfsFile::MakeConcatenatedFile(concat, dir->GetName()); | 69 | return FileSys::ConcatenatedVfsFile::MakeConcatenatedFile(concat, dir->GetName()); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | if (FileUtil::IsDirectory(path)) | ||
| 73 | return vfs->OpenFile(path + "/" + "main", FileSys::Mode::Read); | ||
| 74 | |||
| 72 | return vfs->OpenFile(path, FileSys::Mode::Read); | 75 | return vfs->OpenFile(path, FileSys::Mode::Read); |
| 73 | } | 76 | } |
| 74 | } // Anonymous namespace | ||
| 75 | |||
| 76 | struct System::Impl { | 77 | struct System::Impl { |
| 78 | |||
| 77 | Cpu& CurrentCpuCore() { | 79 | Cpu& CurrentCpuCore() { |
| 78 | return cpu_core_manager.GetCurrentCore(); | 80 | return cpu_core_manager.GetCurrentCore(); |
| 79 | } | 81 | } |
diff --git a/src/core/core.h b/src/core/core.h index be71bd437..71031dfcf 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <string> | 9 | #include <string> |
| 10 | 10 | ||
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "core/file_sys/vfs_types.h" | ||
| 12 | #include "core/hle/kernel/object.h" | 13 | #include "core/hle/kernel/object.h" |
| 13 | 14 | ||
| 14 | namespace Core::Frontend { | 15 | namespace Core::Frontend { |
| @@ -55,6 +56,9 @@ class TelemetrySession; | |||
| 55 | 56 | ||
| 56 | struct PerfStatsResults; | 57 | struct PerfStatsResults; |
| 57 | 58 | ||
| 59 | FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, | ||
| 60 | const std::string& path); | ||
| 61 | |||
| 58 | class System { | 62 | class System { |
| 59 | public: | 63 | public: |
| 60 | System(const System&) = delete; | 64 | System(const System&) = delete; |
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 6b14e08be..ecdc21c87 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp | |||
| @@ -56,6 +56,10 @@ PatchManager::PatchManager(u64 title_id) : title_id(title_id) {} | |||
| 56 | 56 | ||
| 57 | PatchManager::~PatchManager() = default; | 57 | PatchManager::~PatchManager() = default; |
| 58 | 58 | ||
| 59 | u64 PatchManager::GetTitleID() const { | ||
| 60 | return title_id; | ||
| 61 | } | ||
| 62 | |||
| 59 | VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { | 63 | VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { |
| 60 | LOG_INFO(Loader, "Patching ExeFS for title_id={:016X}", title_id); | 64 | LOG_INFO(Loader, "Patching ExeFS for title_id={:016X}", title_id); |
| 61 | 65 | ||
| @@ -73,11 +77,15 @@ VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { | |||
| 73 | 77 | ||
| 74 | const auto installed = Service::FileSystem::GetUnionContents(); | 78 | const auto installed = Service::FileSystem::GetUnionContents(); |
| 75 | 79 | ||
| 80 | const auto& disabled = Settings::values.disabled_addons[title_id]; | ||
| 81 | const auto update_disabled = | ||
| 82 | std::find(disabled.begin(), disabled.end(), "Update") != disabled.end(); | ||
| 83 | |||
| 76 | // Game Updates | 84 | // Game Updates |
| 77 | const auto update_tid = GetUpdateTitleID(title_id); | 85 | const auto update_tid = GetUpdateTitleID(title_id); |
| 78 | const auto update = installed.GetEntry(update_tid, ContentRecordType::Program); | 86 | const auto update = installed.GetEntry(update_tid, ContentRecordType::Program); |
| 79 | 87 | ||
| 80 | if (update != nullptr && update->GetExeFS() != nullptr && | 88 | if (!update_disabled && update != nullptr && update->GetExeFS() != nullptr && |
| 81 | update->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS) { | 89 | update->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS) { |
| 82 | LOG_INFO(Loader, " ExeFS: Update ({}) applied successfully", | 90 | LOG_INFO(Loader, " ExeFS: Update ({}) applied successfully", |
| 83 | FormatTitleVersion(installed.GetEntryVersion(update_tid).value_or(0))); | 91 | FormatTitleVersion(installed.GetEntryVersion(update_tid).value_or(0))); |
| @@ -95,6 +103,9 @@ VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { | |||
| 95 | std::vector<VirtualDir> layers; | 103 | std::vector<VirtualDir> layers; |
| 96 | layers.reserve(patch_dirs.size() + 1); | 104 | layers.reserve(patch_dirs.size() + 1); |
| 97 | for (const auto& subdir : patch_dirs) { | 105 | for (const auto& subdir : patch_dirs) { |
| 106 | if (std::find(disabled.begin(), disabled.end(), subdir->GetName()) != disabled.end()) | ||
| 107 | continue; | ||
| 108 | |||
| 98 | auto exefs_dir = subdir->GetSubdirectory("exefs"); | 109 | auto exefs_dir = subdir->GetSubdirectory("exefs"); |
| 99 | if (exefs_dir != nullptr) | 110 | if (exefs_dir != nullptr) |
| 100 | layers.push_back(std::move(exefs_dir)); | 111 | layers.push_back(std::move(exefs_dir)); |
| @@ -111,11 +122,16 @@ VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { | |||
| 111 | return exefs; | 122 | return exefs; |
| 112 | } | 123 | } |
| 113 | 124 | ||
| 114 | static std::vector<VirtualFile> CollectPatches(const std::vector<VirtualDir>& patch_dirs, | 125 | std::vector<VirtualFile> PatchManager::CollectPatches(const std::vector<VirtualDir>& patch_dirs, |
| 115 | const std::string& build_id) { | 126 | const std::string& build_id) const { |
| 127 | const auto& disabled = Settings::values.disabled_addons[title_id]; | ||
| 128 | |||
| 116 | std::vector<VirtualFile> out; | 129 | std::vector<VirtualFile> out; |
| 117 | out.reserve(patch_dirs.size()); | 130 | out.reserve(patch_dirs.size()); |
| 118 | for (const auto& subdir : patch_dirs) { | 131 | for (const auto& subdir : patch_dirs) { |
| 132 | if (std::find(disabled.begin(), disabled.end(), subdir->GetName()) != disabled.end()) | ||
| 133 | continue; | ||
| 134 | |||
| 119 | auto exefs_dir = subdir->GetSubdirectory("exefs"); | 135 | auto exefs_dir = subdir->GetSubdirectory("exefs"); |
| 120 | if (exefs_dir != nullptr) { | 136 | if (exefs_dir != nullptr) { |
| 121 | for (const auto& file : exefs_dir->GetFiles()) { | 137 | for (const auto& file : exefs_dir->GetFiles()) { |
| @@ -228,6 +244,7 @@ static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType t | |||
| 228 | return; | 244 | return; |
| 229 | } | 245 | } |
| 230 | 246 | ||
| 247 | const auto& disabled = Settings::values.disabled_addons[title_id]; | ||
| 231 | auto patch_dirs = load_dir->GetSubdirectories(); | 248 | auto patch_dirs = load_dir->GetSubdirectories(); |
| 232 | std::sort(patch_dirs.begin(), patch_dirs.end(), | 249 | std::sort(patch_dirs.begin(), patch_dirs.end(), |
| 233 | [](const VirtualDir& l, const VirtualDir& r) { return l->GetName() < r->GetName(); }); | 250 | [](const VirtualDir& l, const VirtualDir& r) { return l->GetName() < r->GetName(); }); |
| @@ -237,6 +254,9 @@ static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType t | |||
| 237 | layers.reserve(patch_dirs.size() + 1); | 254 | layers.reserve(patch_dirs.size() + 1); |
| 238 | layers_ext.reserve(patch_dirs.size() + 1); | 255 | layers_ext.reserve(patch_dirs.size() + 1); |
| 239 | for (const auto& subdir : patch_dirs) { | 256 | for (const auto& subdir : patch_dirs) { |
| 257 | if (std::find(disabled.begin(), disabled.end(), subdir->GetName()) != disabled.end()) | ||
| 258 | continue; | ||
| 259 | |||
| 240 | auto romfs_dir = subdir->GetSubdirectory("romfs"); | 260 | auto romfs_dir = subdir->GetSubdirectory("romfs"); |
| 241 | if (romfs_dir != nullptr) | 261 | if (romfs_dir != nullptr) |
| 242 | layers.push_back(std::move(romfs_dir)); | 262 | layers.push_back(std::move(romfs_dir)); |
| @@ -282,7 +302,12 @@ VirtualFile PatchManager::PatchRomFS(VirtualFile romfs, u64 ivfc_offset, Content | |||
| 282 | // Game Updates | 302 | // Game Updates |
| 283 | const auto update_tid = GetUpdateTitleID(title_id); | 303 | const auto update_tid = GetUpdateTitleID(title_id); |
| 284 | const auto update = installed.GetEntryRaw(update_tid, type); | 304 | const auto update = installed.GetEntryRaw(update_tid, type); |
| 285 | if (update != nullptr) { | 305 | |
| 306 | const auto& disabled = Settings::values.disabled_addons[title_id]; | ||
| 307 | const auto update_disabled = | ||
| 308 | std::find(disabled.begin(), disabled.end(), "Update") != disabled.end(); | ||
| 309 | |||
| 310 | if (!update_disabled && update != nullptr) { | ||
| 286 | const auto new_nca = std::make_shared<NCA>(update, romfs, ivfc_offset); | 311 | const auto new_nca = std::make_shared<NCA>(update, romfs, ivfc_offset); |
| 287 | if (new_nca->GetStatus() == Loader::ResultStatus::Success && | 312 | if (new_nca->GetStatus() == Loader::ResultStatus::Success && |
| 288 | new_nca->GetRomFS() != nullptr) { | 313 | new_nca->GetRomFS() != nullptr) { |
| @@ -290,7 +315,7 @@ VirtualFile PatchManager::PatchRomFS(VirtualFile romfs, u64 ivfc_offset, Content | |||
| 290 | FormatTitleVersion(installed.GetEntryVersion(update_tid).value_or(0))); | 315 | FormatTitleVersion(installed.GetEntryVersion(update_tid).value_or(0))); |
| 291 | romfs = new_nca->GetRomFS(); | 316 | romfs = new_nca->GetRomFS(); |
| 292 | } | 317 | } |
| 293 | } else if (update_raw != nullptr) { | 318 | } else if (!update_disabled && update_raw != nullptr) { |
| 294 | const auto new_nca = std::make_shared<NCA>(update_raw, romfs, ivfc_offset); | 319 | const auto new_nca = std::make_shared<NCA>(update_raw, romfs, ivfc_offset); |
| 295 | if (new_nca->GetStatus() == Loader::ResultStatus::Success && | 320 | if (new_nca->GetStatus() == Loader::ResultStatus::Success && |
| 296 | new_nca->GetRomFS() != nullptr) { | 321 | new_nca->GetRomFS() != nullptr) { |
| @@ -320,25 +345,30 @@ std::map<std::string, std::string, std::less<>> PatchManager::GetPatchVersionNam | |||
| 320 | VirtualFile update_raw) const { | 345 | VirtualFile update_raw) const { |
| 321 | std::map<std::string, std::string, std::less<>> out; | 346 | std::map<std::string, std::string, std::less<>> out; |
| 322 | const auto installed = Service::FileSystem::GetUnionContents(); | 347 | const auto installed = Service::FileSystem::GetUnionContents(); |
| 348 | const auto& disabled = Settings::values.disabled_addons[title_id]; | ||
| 323 | 349 | ||
| 324 | // Game Updates | 350 | // Game Updates |
| 325 | const auto update_tid = GetUpdateTitleID(title_id); | 351 | const auto update_tid = GetUpdateTitleID(title_id); |
| 326 | PatchManager update{update_tid}; | 352 | PatchManager update{update_tid}; |
| 327 | auto [nacp, discard_icon_file] = update.GetControlMetadata(); | 353 | auto [nacp, discard_icon_file] = update.GetControlMetadata(); |
| 328 | 354 | ||
| 355 | const auto update_disabled = | ||
| 356 | std::find(disabled.begin(), disabled.end(), "Update") != disabled.end(); | ||
| 357 | const auto update_label = update_disabled ? "[D] Update" : "Update"; | ||
| 358 | |||
| 329 | if (nacp != nullptr) { | 359 | if (nacp != nullptr) { |
| 330 | out.insert_or_assign("Update", nacp->GetVersionString()); | 360 | out.insert_or_assign(update_label, nacp->GetVersionString()); |
| 331 | } else { | 361 | } else { |
| 332 | if (installed.HasEntry(update_tid, ContentRecordType::Program)) { | 362 | if (installed.HasEntry(update_tid, ContentRecordType::Program)) { |
| 333 | const auto meta_ver = installed.GetEntryVersion(update_tid); | 363 | const auto meta_ver = installed.GetEntryVersion(update_tid); |
| 334 | if (meta_ver.value_or(0) == 0) { | 364 | if (meta_ver.value_or(0) == 0) { |
| 335 | out.insert_or_assign("Update", ""); | 365 | out.insert_or_assign(update_label, ""); |
| 336 | } else { | 366 | } else { |
| 337 | out.insert_or_assign( | 367 | out.insert_or_assign( |
| 338 | "Update", FormatTitleVersion(*meta_ver, TitleVersionFormat::ThreeElements)); | 368 | update_label, FormatTitleVersion(*meta_ver, TitleVersionFormat::ThreeElements)); |
| 339 | } | 369 | } |
| 340 | } else if (update_raw != nullptr) { | 370 | } else if (update_raw != nullptr) { |
| 341 | out.insert_or_assign("Update", "PACKED"); | 371 | out.insert_or_assign(update_label, "PACKED"); |
| 342 | } | 372 | } |
| 343 | } | 373 | } |
| 344 | 374 | ||
| @@ -378,7 +408,9 @@ std::map<std::string, std::string, std::less<>> PatchManager::GetPatchVersionNam | |||
| 378 | if (types.empty()) | 408 | if (types.empty()) |
| 379 | continue; | 409 | continue; |
| 380 | 410 | ||
| 381 | out.insert_or_assign(mod->GetName(), types); | 411 | const auto mod_disabled = |
| 412 | std::find(disabled.begin(), disabled.end(), mod->GetName()) != disabled.end(); | ||
| 413 | out.insert_or_assign(mod_disabled ? "[D] " + mod->GetName() : mod->GetName(), types); | ||
| 382 | } | 414 | } |
| 383 | } | 415 | } |
| 384 | 416 | ||
| @@ -401,7 +433,9 @@ std::map<std::string, std::string, std::less<>> PatchManager::GetPatchVersionNam | |||
| 401 | 433 | ||
| 402 | list += fmt::format("{}", dlc_match.back().title_id & 0x7FF); | 434 | list += fmt::format("{}", dlc_match.back().title_id & 0x7FF); |
| 403 | 435 | ||
| 404 | out.insert_or_assign("DLC", std::move(list)); | 436 | const auto dlc_disabled = |
| 437 | std::find(disabled.begin(), disabled.end(), "DLC") != disabled.end(); | ||
| 438 | out.insert_or_assign(dlc_disabled ? "[D] DLC" : "DLC", std::move(list)); | ||
| 405 | } | 439 | } |
| 406 | 440 | ||
| 407 | return out; | 441 | return out; |
diff --git a/src/core/file_sys/patch_manager.h b/src/core/file_sys/patch_manager.h index 7d168837f..b8a1652fd 100644 --- a/src/core/file_sys/patch_manager.h +++ b/src/core/file_sys/patch_manager.h | |||
| @@ -30,6 +30,8 @@ public: | |||
| 30 | explicit PatchManager(u64 title_id); | 30 | explicit PatchManager(u64 title_id); |
| 31 | ~PatchManager(); | 31 | ~PatchManager(); |
| 32 | 32 | ||
| 33 | u64 GetTitleID() const; | ||
| 34 | |||
| 33 | // Currently tracked ExeFS patches: | 35 | // Currently tracked ExeFS patches: |
| 34 | // - Game Updates | 36 | // - Game Updates |
| 35 | VirtualDir PatchExeFS(VirtualDir exefs) const; | 37 | VirtualDir PatchExeFS(VirtualDir exefs) const; |
| @@ -63,6 +65,9 @@ public: | |||
| 63 | std::pair<std::unique_ptr<NACP>, VirtualFile> ParseControlNCA(const NCA& nca) const; | 65 | std::pair<std::unique_ptr<NACP>, VirtualFile> ParseControlNCA(const NCA& nca) const; |
| 64 | 66 | ||
| 65 | private: | 67 | private: |
| 68 | std::vector<VirtualFile> CollectPatches(const std::vector<VirtualDir>& patch_dirs, | ||
| 69 | const std::string& build_id) const; | ||
| 70 | |||
| 66 | u64 title_id; | 71 | u64 title_id; |
| 67 | }; | 72 | }; |
| 68 | 73 | ||
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index 0417fdb92..b506bc3dd 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include "core/hle/service/aoc/aoc_u.h" | 20 | #include "core/hle/service/aoc/aoc_u.h" |
| 21 | #include "core/hle/service/filesystem/filesystem.h" | 21 | #include "core/hle/service/filesystem/filesystem.h" |
| 22 | #include "core/loader/loader.h" | 22 | #include "core/loader/loader.h" |
| 23 | #include "core/settings.h" | ||
| 23 | 24 | ||
| 24 | namespace Service::AOC { | 25 | namespace Service::AOC { |
| 25 | 26 | ||
| @@ -76,6 +77,13 @@ void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) { | |||
| 76 | rb.Push(RESULT_SUCCESS); | 77 | rb.Push(RESULT_SUCCESS); |
| 77 | 78 | ||
| 78 | const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID(); | 79 | const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID(); |
| 80 | |||
| 81 | const auto& disabled = Settings::values.disabled_addons[current]; | ||
| 82 | if (std::find(disabled.begin(), disabled.end(), "DLC") != disabled.end()) { | ||
| 83 | rb.Push<u32>(0); | ||
| 84 | return; | ||
| 85 | } | ||
| 86 | |||
| 79 | rb.Push<u32>(static_cast<u32>( | 87 | rb.Push<u32>(static_cast<u32>( |
| 80 | std::count_if(add_on_content.begin(), add_on_content.end(), | 88 | std::count_if(add_on_content.begin(), add_on_content.end(), |
| 81 | [current](u64 tid) { return CheckAOCTitleIDMatchesBase(tid, current); }))); | 89 | [current](u64 tid) { return CheckAOCTitleIDMatchesBase(tid, current); }))); |
| @@ -96,6 +104,10 @@ void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) { | |||
| 96 | out.push_back(static_cast<u32>(add_on_content[i] & 0x7FF)); | 104 | out.push_back(static_cast<u32>(add_on_content[i] & 0x7FF)); |
| 97 | } | 105 | } |
| 98 | 106 | ||
| 107 | const auto& disabled = Settings::values.disabled_addons[current]; | ||
| 108 | if (std::find(disabled.begin(), disabled.end(), "DLC") != disabled.end()) | ||
| 109 | out = {}; | ||
| 110 | |||
| 99 | if (out.size() < offset) { | 111 | if (out.size() < offset) { |
| 100 | IPC::ResponseBuilder rb{ctx, 2}; | 112 | IPC::ResponseBuilder rb{ctx, 2}; |
| 101 | // TODO(DarkLordZach): Find the correct error code. | 113 | // TODO(DarkLordZach): Find the correct error code. |
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 5390ab9ee..0838e303b 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <vector> | 12 | #include <vector> |
| 13 | 13 | ||
| 14 | #include "common/common_types.h" | 14 | #include "common/common_types.h" |
| 15 | #include "core/file_sys/control_metadata.h" | ||
| 15 | #include "core/file_sys/vfs.h" | 16 | #include "core/file_sys/vfs.h" |
| 16 | 17 | ||
| 17 | namespace Kernel { | 18 | namespace Kernel { |
| @@ -243,6 +244,15 @@ public: | |||
| 243 | return ResultStatus::ErrorNotImplemented; | 244 | return ResultStatus::ErrorNotImplemented; |
| 244 | } | 245 | } |
| 245 | 246 | ||
| 247 | /** | ||
| 248 | * Get the developer of the application | ||
| 249 | * @param developer Reference to store the application developer into | ||
| 250 | * @return ResultStatus result of function | ||
| 251 | */ | ||
| 252 | virtual ResultStatus ReadDeveloper(std::string& developer) { | ||
| 253 | return ResultStatus::ErrorNotImplemented; | ||
| 254 | } | ||
| 255 | |||
| 246 | protected: | 256 | protected: |
| 247 | FileSys::VirtualFile file; | 257 | FileSys::VirtualFile file; |
| 248 | bool is_loaded = false; | 258 | bool is_loaded = false; |
diff --git a/src/core/loader/nsp.cpp b/src/core/loader/nsp.cpp index 080d89904..b4ab88ae8 100644 --- a/src/core/loader/nsp.cpp +++ b/src/core/loader/nsp.cpp | |||
| @@ -151,4 +151,11 @@ ResultStatus AppLoader_NSP::ReadTitle(std::string& title) { | |||
| 151 | title = nacp_file->GetApplicationName(); | 151 | title = nacp_file->GetApplicationName(); |
| 152 | return ResultStatus::Success; | 152 | return ResultStatus::Success; |
| 153 | } | 153 | } |
| 154 | |||
| 155 | ResultStatus AppLoader_NSP::ReadDeveloper(std::string& developer) { | ||
| 156 | if (nacp_file == nullptr) | ||
| 157 | return ResultStatus::ErrorNoControl; | ||
| 158 | developer = nacp_file->GetDeveloperName(); | ||
| 159 | return ResultStatus::Success; | ||
| 160 | } | ||
| 154 | } // namespace Loader | 161 | } // namespace Loader |
diff --git a/src/core/loader/nsp.h b/src/core/loader/nsp.h index 9ed8a59cf..2b1e0719b 100644 --- a/src/core/loader/nsp.h +++ b/src/core/loader/nsp.h | |||
| @@ -43,6 +43,7 @@ public: | |||
| 43 | ResultStatus ReadProgramId(u64& out_program_id) override; | 43 | ResultStatus ReadProgramId(u64& out_program_id) override; |
| 44 | ResultStatus ReadIcon(std::vector<u8>& buffer) override; | 44 | ResultStatus ReadIcon(std::vector<u8>& buffer) override; |
| 45 | ResultStatus ReadTitle(std::string& title) override; | 45 | ResultStatus ReadTitle(std::string& title) override; |
| 46 | ResultStatus ReadDeveloper(std::string& developer) override; | ||
| 46 | 47 | ||
| 47 | private: | 48 | private: |
| 48 | std::unique_ptr<FileSys::NSP> nsp; | 49 | std::unique_ptr<FileSys::NSP> nsp; |
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index 461607c95..bd5a83b49 100644 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp | |||
| @@ -120,4 +120,11 @@ ResultStatus AppLoader_XCI::ReadTitle(std::string& title) { | |||
| 120 | title = nacp_file->GetApplicationName(); | 120 | title = nacp_file->GetApplicationName(); |
| 121 | return ResultStatus::Success; | 121 | return ResultStatus::Success; |
| 122 | } | 122 | } |
| 123 | |||
| 124 | ResultStatus AppLoader_XCI::ReadDeveloper(std::string& developer) { | ||
| 125 | if (nacp_file == nullptr) | ||
| 126 | return ResultStatus::ErrorNoControl; | ||
| 127 | developer = nacp_file->GetDeveloperName(); | ||
| 128 | return ResultStatus::Success; | ||
| 129 | } | ||
| 123 | } // namespace Loader | 130 | } // namespace Loader |
diff --git a/src/core/loader/xci.h b/src/core/loader/xci.h index ded5bb88a..15d1b1a23 100644 --- a/src/core/loader/xci.h +++ b/src/core/loader/xci.h | |||
| @@ -43,6 +43,7 @@ public: | |||
| 43 | ResultStatus ReadProgramId(u64& out_program_id) override; | 43 | ResultStatus ReadProgramId(u64& out_program_id) override; |
| 44 | ResultStatus ReadIcon(std::vector<u8>& buffer) override; | 44 | ResultStatus ReadIcon(std::vector<u8>& buffer) override; |
| 45 | ResultStatus ReadTitle(std::string& title) override; | 45 | ResultStatus ReadTitle(std::string& title) override; |
| 46 | ResultStatus ReadDeveloper(std::string& developer) override; | ||
| 46 | 47 | ||
| 47 | private: | 48 | private: |
| 48 | std::unique_ptr<FileSys::XCI> xci; | 49 | std::unique_ptr<FileSys::XCI> xci; |
diff --git a/src/core/settings.h b/src/core/settings.h index a0c5fd447..de01b05c0 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -6,8 +6,10 @@ | |||
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <atomic> | 8 | #include <atomic> |
| 9 | #include <map> | ||
| 9 | #include <optional> | 10 | #include <optional> |
| 10 | #include <string> | 11 | #include <string> |
| 12 | #include <vector> | ||
| 11 | #include "common/common_types.h" | 13 | #include "common/common_types.h" |
| 12 | 14 | ||
| 13 | namespace Settings { | 15 | namespace Settings { |
| @@ -411,6 +413,9 @@ struct Values { | |||
| 411 | std::string web_api_url; | 413 | std::string web_api_url; |
| 412 | std::string yuzu_username; | 414 | std::string yuzu_username; |
| 413 | std::string yuzu_token; | 415 | std::string yuzu_token; |
| 416 | |||
| 417 | // Add-Ons | ||
| 418 | std::map<u64, std::vector<std::string>> disabled_addons; | ||
| 414 | } extern values; | 419 | } extern values; |
| 415 | 420 | ||
| 416 | void Apply(); | 421 | void Apply(); |