mirror of
https://github.com/par274/sharpemu.git
synced 2026-08-08 10:45:52 +08:00
Functions exports in kernel and NpTrophy2 (#749)
* sceNpTrophy2GetTrophyInfoArray export * sceNpTrophy2GetTrophyInfoArray comment changed * sceKernelIsTrinityMode & sceKernelGetOpenPsId exports * deleted console log in KernelIsTrinityMode * sceKernelGetOpenPsId: fix ORBIS_GEN2_ERROR_INVALID_ARGUMENT casts with uint.
This commit is contained in:
@@ -466,4 +466,45 @@ public static class KernelExports
|
|||||||
ctx[CpuRegister.Rax] = unchecked((ulong)(-1L));
|
ctx[CpuRegister.Rax] = unchecked((ulong)(-1L));
|
||||||
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
|
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SysAbiExport(
|
||||||
|
Nid = "tU5e3f9gSiU",
|
||||||
|
ExportName = "sceKernelIsTrinityMode",
|
||||||
|
Target = Generation.Gen4 | Generation.Gen5,
|
||||||
|
LibraryName = "libKernel")]
|
||||||
|
public static int KernelIsTrinityMode(CpuContext ctx)
|
||||||
|
{
|
||||||
|
ctx[CpuRegister.Rax] = 0;
|
||||||
|
|
||||||
|
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
[SysAbiExport(
|
||||||
|
Nid = "DLORcroUqbc",
|
||||||
|
ExportName = "sceKernelGetOpenPsId",
|
||||||
|
Target = Generation.Gen4 | Generation.Gen5,
|
||||||
|
LibraryName = "libKernel")]
|
||||||
|
public static int KernelGetOpenPsId(CpuContext ctx)
|
||||||
|
{
|
||||||
|
ulong bufferPtr = ctx[CpuRegister.Rdi];
|
||||||
|
|
||||||
|
if (bufferPtr == 0)
|
||||||
|
{
|
||||||
|
ctx[CpuRegister.Rax] = unchecked((ulong)(int)OrbisGen2Result.ORBIS_GEN2_ERROR_INVALID_ARGUMENT);
|
||||||
|
|
||||||
|
return (int)OrbisGen2Result.ORBIS_GEN2_ERROR_INVALID_ARGUMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
Span<byte> openPsId = stackalloc byte[16];
|
||||||
|
|
||||||
|
if (!ctx.Memory.TryWrite(bufferPtr, openPsId))
|
||||||
|
{
|
||||||
|
ctx[CpuRegister.Rax] = unchecked((ulong)(int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT);
|
||||||
|
return (int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx[CpuRegister.Rax] = 0;
|
||||||
|
|
||||||
|
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,15 @@ public static class NpTrophy2Exports
|
|||||||
public static int NpTrophy2GetTrophyInfo(CpuContext ctx) =>
|
public static int NpTrophy2GetTrophyInfo(CpuContext ctx) =>
|
||||||
SetReturn(ctx, OrbisGen2Result.ORBIS_GEN2_ERROR_NOT_FOUND);
|
SetReturn(ctx, OrbisGen2Result.ORBIS_GEN2_ERROR_NOT_FOUND);
|
||||||
|
|
||||||
|
[SysAbiExport(
|
||||||
|
Nid = "y3zHpdZO6ME",
|
||||||
|
ExportName = "sceNpTrophy2GetTrophyInfoArray",
|
||||||
|
Target = Generation.Gen5,
|
||||||
|
LibraryName = "libSceNpTrophy2")]
|
||||||
|
public static int NpTrophy2GetTrophyInfoArray(CpuContext ctx) =>
|
||||||
|
SetReturn(ctx, OrbisGen2Result.ORBIS_GEN2_ERROR_NOT_FOUND);
|
||||||
|
|
||||||
|
|
||||||
private static int WriteIdAndReturn(CpuContext ctx, ulong outAddress, ref int nextId)
|
private static int WriteIdAndReturn(CpuContext ctx, ulong outAddress, ref int nextId)
|
||||||
{
|
{
|
||||||
if (outAddress == 0)
|
if (outAddress == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user