diff --git a/nx/include/switch/services/applet.h b/nx/include/switch/services/applet.h index 0bd0cfcc..d46f6faa 100644 --- a/nx/include/switch/services/applet.h +++ b/nx/include/switch/services/applet.h @@ -1354,6 +1354,13 @@ Result appletQueryApplicationPlayStatisticsByUid(u128 userID, PdmApplicationPlay */ Result appletGetGpuErrorDetectedSystemEvent(Event *out_event); +/** + * @brief Launches the jit-sysmodule when it was not previously launched by this cmd. Returns 0 when it was previously launched. + * @note Only available with AppletType_*Application on [5.0.0+]. + * @note Requires the jit-sysmodule to actually be installed. + */ +Result appletPrepareForJit(void); + // IHomeMenuFunctions /** diff --git a/nx/source/services/applet.c b/nx/source/services/applet.c index 84e8fceb..8e1c07a4 100644 --- a/nx/source/services/applet.c +++ b/nx/source/services/applet.c @@ -4287,6 +4287,15 @@ Result appletGetGpuErrorDetectedSystemEvent(Event *out_event) { return _appletGetEvent(&g_appletIFunctions, out_event, 130, false); } +Result appletPrepareForJit(void) { + if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication()) + return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); + if (hosversionBefore(5,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _appletCmdNoIO(&g_appletIFunctions, 1001); +} + // IHomeMenuFunctions Result appletRequestToGetForeground(void) {