diff --git a/nx/include/switch/services/applet.h b/nx/include/switch/services/applet.h index 83f929a7..fa79572c 100644 --- a/nx/include/switch/services/applet.h +++ b/nx/include/switch/services/applet.h @@ -1210,6 +1210,12 @@ Result appletRequestToShutdown(void); */ Result appletRequestToReboot(void); +/** + * @brief Exit the application and return to the kiosk demo menu. This terminates the current process. This will enter an infinite-sleep-loop on success. + * @note Only available with AppletType_*Application on [4.0.0+], on kiosk systems (QuestFlag set). + */ +Result appletExitAndRequestToShowThanksMessage(void); + /** * @brief Initializes the ApplicationCopyrightFrameBuffer, with dimensions 1280x720 + the tmem for it. This is used as an overlay for screenshots. * @note Only available with AppletType_*Application on 5.0.0+. diff --git a/nx/source/services/applet.c b/nx/source/services/applet.c index 9282bb41..e81628eb 100644 --- a/nx/source/services/applet.c +++ b/nx/source/services/applet.c @@ -3880,6 +3880,19 @@ Result appletRequestToReboot(void) { return rc; } +Result appletExitAndRequestToShowThanksMessage(void) { + Result rc=0; + + if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication()) + return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + rc = _appletCmdNoIO(&g_appletIFunctions, 80); + if (R_SUCCEEDED(rc)) while(1)svcSleepThread(86400000000000ULL); + return rc; +} + static Result _appletInitializeApplicationCopyrightFrameBuffer(TransferMemory *tmem, s32 width, s32 height) { IpcCommand c; ipcInitialize(&c);