[fixes] move repeating methods into CpuContext (#41)

This commit is contained in:
Dawid
2026-07-10 22:46:50 +02:00
committed by GitHub
parent c0fd6a80e8
commit 29021b5a71
31 changed files with 527 additions and 770 deletions
+2 -11
View File
@@ -46,8 +46,7 @@ public static class AvPlayerExports
var dataAddress = ctx[CpuRegister.Rsi];
lock (StateGate)
{
return SetReturn(
ctx,
return ctx.SetReturn(
handle != 0 && dataAddress != 0 && Players.Contains(handle)
? 0
: InvalidParameters);
@@ -63,15 +62,7 @@ public static class AvPlayerExports
{
lock (StateGate)
{
return SetReturn(
ctx,
Players.Remove(ctx[CpuRegister.Rdi]) ? 0 : InvalidParameters);
return ctx.SetReturn(Players.Remove(ctx[CpuRegister.Rdi]) ? 0 : InvalidParameters);
}
}
private static int SetReturn(CpuContext ctx, int result)
{
ctx[CpuRegister.Rax] = unchecked((ulong)result);
return result;
}
}