mirror of
https://github.com/par274/sharpemu.git
synced 2026-08-10 03:28:49 +08:00
hle: implement offline NP reachability state (#238)
This commit is contained in:
@@ -10,6 +10,7 @@ public static class NpManagerExports
|
|||||||
{
|
{
|
||||||
private const int NpTitleIdSize = 16;
|
private const int NpTitleIdSize = 16;
|
||||||
private const int NpTitleSecretSize = 128;
|
private const int NpTitleSecretSize = 128;
|
||||||
|
private const int NpReachabilityStateUnavailable = 0;
|
||||||
|
|
||||||
[SysAbiExport(
|
[SysAbiExport(
|
||||||
Nid = "3Zl8BePTh9Y",
|
Nid = "3Zl8BePTh9Y",
|
||||||
@@ -75,8 +76,15 @@ public static class NpManagerExports
|
|||||||
LibraryName = "libSceNpManager")]
|
LibraryName = "libSceNpManager")]
|
||||||
public static int NpGetNpReachabilityState(CpuContext ctx)
|
public static int NpGetNpReachabilityState(CpuContext ctx)
|
||||||
{
|
{
|
||||||
ctx[CpuRegister.Rax] = 0;
|
var stateAddress = ctx[CpuRegister.Rsi];
|
||||||
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
|
if (stateAddress == 0)
|
||||||
|
{
|
||||||
|
return ctx.SetReturn(OrbisGen2Result.ORBIS_GEN2_ERROR_INVALID_ARGUMENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.TryWriteInt32(stateAddress, NpReachabilityStateUnavailable)
|
||||||
|
? ctx.SetReturn(OrbisGen2Result.ORBIS_GEN2_OK)
|
||||||
|
: ctx.SetReturn(OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
[SysAbiExport(
|
[SysAbiExport(
|
||||||
|
|||||||
Reference in New Issue
Block a user