Merge branch 'shadps4-emu:main' into fontlib

This commit is contained in:
Valdis Bogdāns 2026-03-13 15:11:38 +02:00 committed by GitHub
commit 8b44502b1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 5 deletions

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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());
}
}

View File

@ -142,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)

View File

@ -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