From c37f76f12d0db61574ad0ce137be6bc2ce617cf2 Mon Sep 17 00:00:00 2001 From: ParantezTech <12572227+par274@users.noreply.github.com> Date: Thu, 8 Oct 2026 18:25:28 +0300 Subject: [PATCH] [NP] Expose the game trials flag --- .../Np/NpEntitlementAccessExports.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/SharpEmu.Libs/Np/NpEntitlementAccessExports.cs b/src/SharpEmu.Libs/Np/NpEntitlementAccessExports.cs index 5c60943..030e5e9 100644 --- a/src/SharpEmu.Libs/Np/NpEntitlementAccessExports.cs +++ b/src/SharpEmu.Libs/Np/NpEntitlementAccessExports.cs @@ -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 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",