Fixes a Mutex Issue Preventing Some UE Titles From Booting (#451)

* Optimize guest import, memory, and pthread hot paths

* Fix UE adaptive mutex self-lock handling
This commit is contained in:
Spooks
2026-07-19 13:20:05 -06:00
committed by GitHub
parent 8ef5a54ee4
commit 90c72ebecf
9 changed files with 647 additions and 58 deletions
@@ -1105,10 +1105,13 @@ public static partial class KernelMemoryCompatExports
return (int)OrbisGen2Result.ORBIS_GEN2_ERROR_INVALID_ARGUMENT;
}
var payload = GC.AllocateUninitializedArray<byte>(count);
if (count > 0 && (!TryReadCompat(ctx, source, payload) || !TryWriteCompat(ctx, destination, payload)))
if (count > 0 && !ctx.Memory.TryCopy(destination, source, (ulong)count))
{
return (int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT;
var payload = GC.AllocateUninitializedArray<byte>(count);
if (!TryReadCompat(ctx, source, payload) || !TryWriteCompat(ctx, destination, payload))
{
return (int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT;
}
}
ctx[CpuRegister.Rax] = destination;