From 194a8f537bd658c569391ad83b8fb55936ba7dab Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 20 Apr 2021 01:02:33 -0700 Subject: [PATCH] pgl: fix argument order for LaunchProgram on 12.x --- nx/source/services/pgl.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/nx/source/services/pgl.c b/nx/source/services/pgl.c index 1542b4ef..a3457f0e 100644 --- a/nx/source/services/pgl.c +++ b/nx/source/services/pgl.c @@ -83,15 +83,21 @@ static Result _pglCmdInU64(u64 inval, u32 cmd_id) { } Result pglLaunchProgram(u64 *out_pid, const NcmProgramLocation *loc, u32 pm_launch_flags, u8 pgl_launch_flags) { - const struct { - u8 pgl_flags; - u32 pm_flags; - NcmProgramLocation loc; - } in = { pgl_launch_flags, pm_launch_flags, *loc }; - if (_pglShouldUseTipc()) { + const struct { + NcmProgramLocation loc; + u32 pm_flags; + u8 pgl_flags; + } in = { *loc, pm_launch_flags, pgl_launch_flags }; + return tipcDispatchInOut(&g_pglSrv.tipc, 0, in, *out_pid); } else { + const struct { + u8 pgl_flags; + u32 pm_flags; + NcmProgramLocation loc; + } in = { pgl_launch_flags, pm_launch_flags, *loc }; + return serviceDispatchInOut(&g_pglSrv.cmif, 0, in, *out_pid); } }