[NP] Expose the game trials flag

This commit is contained in:
ParantezTech 2026-10-08 18:25:28 +03:00
parent 73666f529e
commit c37f76f12d
1 changed files with 20 additions and 0 deletions

View File

@ -95,6 +95,26 @@ public static class NpEntitlementAccessExports
return ctx.SetReturn(OrbisGen2Result.ORBIS_GEN2_OK);
}
[SysAbiExport(
Nid = "y7JD1gfwyfA",
ExportName = "sceNpEntitlementAccessGetGameTrialsFlag",
Target = Generation.Gen5,
LibraryName = "libSceNpEntitlementAccess")]
public static int NpEntitlementAccessGetGameTrialsFlag(CpuContext ctx)
{
var flagAddress = ctx[CpuRegister.Rdi];
if (flagAddress == 0)
{
return ctx.SetReturn(NpEntitlementAccessErrorParameter);
}
Span<byte> flagBytes = stackalloc byte[sizeof(uint)];
BinaryPrimitives.WriteUInt32LittleEndian(flagBytes, 0);
return ctx.Memory.TryWrite(flagAddress, flagBytes)
? ctx.SetReturn(OrbisGen2Result.ORBIS_GEN2_OK)
: ctx.SetReturn(OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT);
}
[SysAbiExport(
Nid = "TFyU+KFBv54",
ExportName = "sceNpEntitlementAccessGetAddcontEntitlementInfoList",