From 672bcbae012164ec59ef26ff79995c4585bd0e97 Mon Sep 17 00:00:00 2001 From: lizzie Date: Sun, 30 Aug 2026 08:10:51 +0200 Subject: [file_sys] robust-er IPSwitch compiler (#3911) this PR reworks IPS parser to be less stupid what do i mean by this? well generally give it a bit of love so it doesn't do a lot of unsound allocations also simplify the logic greatly (and use memcmp() string idiom instead of trusting the compiler so blindly...) no this doesn't mean to uber optimize IPS to handle 999 gb/s it's more so it doesn't outright crash with edge cases as the previous codebase was quite spaghetty also the major overhead is obviously the vector shenanigans and the I/O -- but thats out of scope Test that IPSwitch mods still properly work WITH ANY GAME IF THERE IS ANY REGRESSION IN SOME GAME/MOD THEN TELL ME Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3911 Reviewed-by: crueter Reviewed-by: CamilleLaVey --- src/core/file_sys/patch_manager.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/core/file_sys/patch_manager.cpp') diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 6ae4679054..ada8c44e78 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -345,8 +345,7 @@ VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { return exefs; } -std::vector PatchManager::CollectPatches(const std::vector& patch_dirs, - const std::string& build_id) const { +std::vector PatchManager::CollectPatches(const std::vector& patch_dirs, const std::string& build_id) const { const auto& disabled = Settings::values.disabled_addons[title_id]; const auto nso_build_id = fmt::format("{:0<64}", build_id); @@ -361,16 +360,11 @@ std::vector PatchManager::CollectPatches(const std::vectorGetFiles()) { if (file->GetExtension() == "ips") { auto name = file->GetName(); - - const auto this_build_id = - fmt::format("{:0<64}", name.substr(0, name.find('.'))); + const auto this_build_id = fmt::format("{:0<64}", name.substr(0, name.find('.'))); if (nso_build_id == this_build_id) out.push_back(file); } else if (file->GetExtension() == "pchtxt") { IPSwitchCompiler compiler{file}; - if (!compiler.IsValid()) - continue; - const auto this_build_id = Common::HexToString(compiler.GetBuildID()); if (nso_build_id == this_build_id) out.push_back(file); @@ -378,7 +372,6 @@ std::vector PatchManager::CollectPatches(const std::vector