mirror of
https://github.com/par274/sharpemu.git
synced 2026-08-01 15:39:47 +08:00
fix: Add ASTRO BOT compatibility stubs (#481)
* Add ASTRO BOT compatibility stubs * Fix ASTRO BOT compatibility stubs
This commit is contained in:
@@ -2661,6 +2661,26 @@ public static partial class KernelMemoryCompatExports
|
||||
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
|
||||
}
|
||||
|
||||
[SysAbiExport(
|
||||
Nid = "n1-v6FgU7MQ",
|
||||
ExportName = "sceKernelConfiguredFlexibleMemorySize",
|
||||
Target = Generation.Gen4 | Generation.Gen5,
|
||||
LibraryName = "libKernel")]
|
||||
public static int KernelConfiguredFlexibleMemorySize(CpuContext ctx)
|
||||
{
|
||||
var outSizeAddress = ctx[CpuRegister.Rdi];
|
||||
if (outSizeAddress == 0)
|
||||
{
|
||||
return (int)OrbisGen2Result.ORBIS_GEN2_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
Span<byte> sizeBytes = stackalloc byte[sizeof(ulong)];
|
||||
BinaryPrimitives.WriteUInt64LittleEndian(sizeBytes, FlexibleMemorySizeBytes);
|
||||
return ctx.Memory.TryWrite(outSizeAddress, sizeBytes)
|
||||
? (int)OrbisGen2Result.ORBIS_GEN2_OK
|
||||
: (int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT;
|
||||
}
|
||||
|
||||
[SysAbiExport(
|
||||
Nid = "rTXw65xmLIA",
|
||||
ExportName = "sceKernelAllocateDirectMemory",
|
||||
|
||||
Reference in New Issue
Block a user