aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/patch_manager.cpp
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2026-08-30 08:10:51 +0200
committercrueter <crueter@eden-emu.dev>2026-08-30 08:10:51 +0200
commit672bcbae012164ec59ef26ff79995c4585bd0e97 (patch)
tree135eaf71df59e9709e11baff232189df57ba8bc1 /src/core/file_sys/patch_manager.cpp
parent28ab4a1a01e15ad5ada032ec1a5d361b63faf487 (diff)
[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 <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3911 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Diffstat (limited to 'src/core/file_sys/patch_manager.cpp')
-rw-r--r--src/core/file_sys/patch_manager.cpp11
1 files changed, 2 insertions, 9 deletions
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<VirtualFile> PatchManager::CollectPatches(const std::vector<VirtualDir>& patch_dirs,
- const std::string& build_id) const {
+std::vector<VirtualFile> PatchManager::CollectPatches(const std::vector<VirtualDir>& 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<VirtualFile> PatchManager::CollectPatches(const std::vector<VirtualD
for (const auto& file : exefs_dir->GetFiles()) {
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<VirtualFile> PatchManager::CollectPatches(const std::vector<VirtualD
}
}
}
-
return out;
}