From 3ee06a91df6975851660ae497bff7a79d61a9f96 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Tue, 10 Mar 2026 00:25:45 -0500 Subject: [PATCH 1/5] Relocate imports on HLE loads (#4113) Now that dynamic HLE loads happen after the eboot loads, HLEs for most "preload" modules wouldn't detect if you didn't have libSceRtc dumped. This was because, while we stored all the new symbols from the HLE lib, we weren't relocating loaded modules to use these symbols. --- src/core/libraries/sysmodule/sysmodule_internal.cpp | 4 ++++ src/core/linker.h | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/libraries/sysmodule/sysmodule_internal.cpp b/src/core/libraries/sysmodule/sysmodule_internal.cpp index 55acded94..def410e25 100644 --- a/src/core/libraries/sysmodule/sysmodule_internal.cpp +++ b/src/core/libraries/sysmodule/sysmodule_internal.cpp @@ -252,6 +252,10 @@ s32 loadModuleInternal(s32 index, s32 argc, const void* argv, s32* res_out) { if (init_func) { LOG_INFO(Loader, "Can't Load {} switching to HLE", mod_name); init_func(&linker->GetHLESymbols()); + + // When loading HLEs, we need to relocate imports + // This ensures later module loads can see our HLE functions. + linker->RelocateAllImports(); } else { LOG_INFO(Loader, "No HLE available for {} module", mod_name); } diff --git a/src/core/linker.h b/src/core/linker.h index 8ffcd9d45..3cb59d9ee 100644 --- a/src/core/linker.h +++ b/src/core/linker.h @@ -125,11 +125,10 @@ public: } } - void LoadSharedLibraries() { + void RelocateAllImports() { + std::scoped_lock lk{mutex}; for (auto& module : m_modules) { - if (module->IsSharedLib()) { - module->Start(0, nullptr, nullptr); - } + Relocate(module.get()); } } From ac3786f533024f04c77b5d295a14bca05f737751 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Tue, 10 Mar 2026 18:25:22 -0500 Subject: [PATCH 2/5] Fix return type for ImageAtomicU32CmpSwap (#4115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Somedays I wonder how I miss these details. But hey, least there are two other people who also missed this 😅 --- src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp index 549e27ae0..1055bf081 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp @@ -147,7 +147,7 @@ Id ImageAtomicU32CmpSwap(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords const auto& texture = ctx.images[handle & 0xFFFF]; const Id pointer{ctx.OpImageTexelPointer(ctx.image_u32, texture.id, coords, ctx.ConstU32(0U))}; const auto [scope, semantics]{AtomicArgs(ctx)}; - return (ctx.*atomic_func)(ctx.F32[1], pointer, scope, semantics, semantics, value, cmp_value); + return (ctx.*atomic_func)(ctx.U32[1], pointer, scope, semantics, semantics, value, cmp_value); } } // Anonymous namespace From c8b3d63e7ebb48ac16a287b78032708cf3c9e222 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Thu, 12 Mar 2026 01:53:12 -0500 Subject: [PATCH 3/5] Core: Fix game arguments (#4118) * Fix game arguments. Tested with Crash Team Racing Nitro Fueled * Fix the fix This callback runs unconditionally, so only perform erase if we actually place anything in gameArgs --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index d3799e2ec..3370901a8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -99,6 +99,7 @@ int main(int argc, char* argv[]) { const auto& extras = app.remaining(); if (!extras.empty()) { gameArgs = extras; + gameArgs.erase(gameArgs.begin()); } }); From 67ffd0334b8428f395563c89fbdaa5f6233ea1e7 Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Thu, 12 Mar 2026 17:15:04 +0100 Subject: [PATCH 4/5] Properly fix game flag handling (#4119) * fix the fix for the fix * fine there's no debug info then because of Ubuntu things --- src/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 3370901a8..d2804ee62 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -99,7 +99,6 @@ int main(int argc, char* argv[]) { const auto& extras = app.remaining(); if (!extras.empty()) { gameArgs = extras; - gameArgs.erase(gameArgs.begin()); } }); @@ -143,6 +142,14 @@ int main(int argc, char* argv[]) { return 1; } } + if (!gameArgs.empty()) { + if (gameArgs.front() == "--") { + gameArgs.erase(gameArgs.begin()); + } else { + std::cerr << "Error: unhandled flags\n"; + return 1; + } + } // ---- Apply flags ---- if (patchFile) From f336096b12cf853b8eb8137cb67646fee7cfde17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BD=D1=8C=D0=BA=D0=B0=20=D0=A7=D0=B5=D1=82?= =?UTF-8?q?=D0=B2=D1=91=D1=80=D1=82=D1=8B=D0=B9?= Date: Fri, 13 Mar 2026 17:38:22 +0700 Subject: [PATCH 5/5] PSF file format: close file after encode() (#4122) --- src/core/file_format/psf.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/file_format/psf.cpp b/src/core/file_format/psf.cpp index e647059f0..c5be7410a 100644 --- a/src/core/file_format/psf.cpp +++ b/src/core/file_format/psf.cpp @@ -113,6 +113,7 @@ bool PSF::Encode(const std::filesystem::path& filepath) const { LOG_ERROR(Core, "Failed to write PSF file. Written {} Expected {}", written, psf_buffer.size()); } + file.Close(); return written == psf_buffer.size(); }