diff --git a/nx/include/switch/services/applet.h b/nx/include/switch/services/applet.h index 5d5a38f7..6947e2f2 100644 --- a/nx/include/switch/services/applet.h +++ b/nx/include/switch/services/applet.h @@ -728,7 +728,11 @@ Result appletBeginBlockingHomeButton(s64 val); */ Result appletEndBlockingHomeButton(void); -void appletNotifyRunning(u8 *out); +/** + * @brief Notify that the app is now running, for the Application logo screen. This throws a fatal-error on failure. + * @note This will just return when applet-type isn't AppletType_Application, or when this was already used previously. Used automatically by \ref appletInitialize when __nx_applet_auto_notifyrunning is set to true (the default value). + */ +void appletNotifyRunning(bool *out); /** * @brief Gets the PseudoDeviceId. This is derived from the output of a ns command, and from data in the host title control.nacp. diff --git a/nx/source/services/applet.c b/nx/source/services/applet.c index 254a57dc..697fba51 100644 --- a/nx/source/services/applet.c +++ b/nx/source/services/applet.c @@ -2609,42 +2609,11 @@ Result appletEndBlockingHomeButton(void) { return _appletCmdNoIO(&g_appletIFunctions, 33); } -void appletNotifyRunning(u8 *out) { - IpcCommand c; - ipcInitialize(&c); - +void appletNotifyRunning(bool *out) { if (__nx_applet_type!=AppletType_Application || g_appletNotifiedRunning) return; g_appletNotifiedRunning = 1; - struct { - u64 magic; - u64 cmd_id; - } *raw; - - raw = serviceIpcPrepareHeader(&g_appletIFunctions, &c, sizeof(*raw)); - - raw->magic = SFCI_MAGIC; - raw->cmd_id = 40; - - Result rc = serviceIpcDispatch(&g_appletIFunctions); - - if (R_SUCCEEDED(rc)) { - IpcParsedCommand r; - struct { - u64 magic; - u64 result; - u8 out; - } *resp; - - serviceIpcParse(&g_appletIFunctions, &r, sizeof(*resp)); - resp = r.Raw; - - rc = resp->result; - - if (R_SUCCEEDED(rc) && out) { - *out = resp->out; - } - } + Result rc = _appletCmdNoInOutBool(&g_appletIFunctions, out, 40); if (R_FAILED(rc)) fatalSimple(MAKERESULT(Module_Libnx, LibnxError_BadAppletNotifyRunning)); }