From 5844372bd9461643834728d1c0f4a7d9fc90a7b5 Mon Sep 17 00:00:00 2001 From: Dmugetsu Date: Mon, 21 Apr 2025 06:31:42 -0600 Subject: [PATCH] men im blind this is how it should be --- src/emulator.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/emulator.cpp b/src/emulator.cpp index 6dc3a6808..ae4a153ca 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -308,19 +308,23 @@ void Emulator::LoadSystemModules(const std::string& game_serial) { for (const auto& [module_name, init_func] : ModulesToLoad) { const auto it = std::ranges::find_if( found_modules, [&](const auto& path) { return path.filename() == module_name; }); + bool loaded = false; if (it != found_modules.end()) { LOG_INFO(Loader, "Loading {}", it->string()); if (linker->LoadModule(*it) != -1) { + loaded = true; if (init_func) { init_func(&linker->GetHLESymbols()); } } } - if (init_func) { - LOG_INFO(Loader, "Can't Load {} switching to HLE", module_name); - init_func(&linker->GetHLESymbols()); - } else { - LOG_INFO(Loader, "No HLE available for {} module", module_name); + if (!loaded) { + if (init_func) { + LOG_INFO(Loader, "Can't Load {} switching to HLE", module_name); + init_func(&linker->GetHLESymbols()); + } else { + LOG_INFO(Loader, "No HLE available for {} module", module_name); + } } } if (!game_serial.empty() && std::filesystem::exists(sys_module_path / game_serial)) { @@ -328,7 +332,9 @@ void Emulator::LoadSystemModules(const std::string& game_serial) { std::filesystem::directory_iterator(sys_module_path / game_serial)) { LOG_INFO(Loader, "Loading {} from game serial file {}", entry.path().string(), game_serial); - linker->LoadModule(entry.path()); + if (linker->LoadModule(entry.path()) == -1) { + entry.path().string(); + } } } }