mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
Minor appletNotifyRunning improvements and added docs.
This commit is contained in:
parent
493abc7703
commit
3b2e484d88
@ -728,7 +728,11 @@ Result appletBeginBlockingHomeButton(s64 val);
|
|||||||
*/
|
*/
|
||||||
Result appletEndBlockingHomeButton(void);
|
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.
|
* @brief Gets the PseudoDeviceId. This is derived from the output of a ns command, and from data in the host title control.nacp.
|
||||||
|
@ -2609,42 +2609,11 @@ Result appletEndBlockingHomeButton(void) {
|
|||||||
return _appletCmdNoIO(&g_appletIFunctions, 33);
|
return _appletCmdNoIO(&g_appletIFunctions, 33);
|
||||||
}
|
}
|
||||||
|
|
||||||
void appletNotifyRunning(u8 *out) {
|
void appletNotifyRunning(bool *out) {
|
||||||
IpcCommand c;
|
|
||||||
ipcInitialize(&c);
|
|
||||||
|
|
||||||
if (__nx_applet_type!=AppletType_Application || g_appletNotifiedRunning) return;
|
if (__nx_applet_type!=AppletType_Application || g_appletNotifiedRunning) return;
|
||||||
g_appletNotifiedRunning = 1;
|
g_appletNotifiedRunning = 1;
|
||||||
|
|
||||||
struct {
|
Result rc = _appletCmdNoInOutBool(&g_appletIFunctions, out, 40);
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (R_FAILED(rc)) fatalSimple(MAKERESULT(Module_Libnx, LibnxError_BadAppletNotifyRunning));
|
if (R_FAILED(rc)) fatalSimple(MAKERESULT(Module_Libnx, LibnxError_BadAppletNotifyRunning));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user