Added appletStartSleepSequence, appletStartShutdownSequence, appletStartRebootSequence, appletIsAutoPowerDownRequested, appletLoadAndApplyIdlePolicySettings, appletNotifyCecSettingsChanged, appletSetDefaultHomeButtonLongPressTime, appletUpdateDefaultDisplayResolution, appletShouldSleepOnBoot, and appletGetHdcpAuthenticationFailedEvent.

This commit is contained in:
yellows8 2019-08-08 11:32:27 -04:00
parent f13d9ba6cc
commit f5b24bd244
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 150 additions and 0 deletions

View File

@ -1262,6 +1262,74 @@ Result appletGetPopFromGeneralChannelEvent(Event *out_event);
*/
Result appletGetHomeButtonWriterLockAccessor(AppletLockAccessor *a);
// IGlobalStateController
/**
* @brief Start the sequence for entering sleep-mode.
* @note Only available with AppletType_SystemApplet.
* @param[in] flag Flag, official sw uses hard-coded value = true.
*/
Result appletStartSleepSequence(bool flag);
/**
* @brief Start the system-shutdown sequence.
* @note Only available with AppletType_SystemApplet.
*/
Result appletStartShutdownSequence(void);
/**
* @brief Start the system-reboot sequence.
* @note Only available with AppletType_SystemApplet.
*/
Result appletStartRebootSequence(void);
/**
* @brief IsAutoPowerDownRequested. Uses an idle:sys cmd internally.
* @note Only available with AppletType_SystemApplet on [7.0.0+].
* @param[out] out Output flag.
*/
Result appletIsAutoPowerDownRequested(bool *out);
/**
* @brief LoadAndApplyIdlePolicySettings. Uses an idle:sys cmd internally.
* @note Only available with AppletType_SystemApplet.
*/
Result appletLoadAndApplyIdlePolicySettings(void);
/**
* @brief NotifyCecSettingsChanged. Uses an omm cmd internally.
* @note Only available with AppletType_SystemApplet on [2.0.0+].
*/
Result appletNotifyCecSettingsChanged(void);
/**
* @brief Sets the DefaultHomeButtonLongPressTime.
* @note Only available with AppletType_SystemApplet on [3.0.0+].
* @param[in] val Input value.
*/
Result appletSetDefaultHomeButtonLongPressTime(s64 val);
/**
* @brief UpdateDefaultDisplayResolution. Uses an omm cmd internally.
* @note Only available with AppletType_SystemApplet on [3.0.0+].
*/
Result appletUpdateDefaultDisplayResolution(void);
/**
* @brief ShouldSleepOnBoot. Uses an omm cmd internally.
* @note Only available with AppletType_SystemApplet on [3.0.0+].
* @param[out] out Output flag.
*/
Result appletShouldSleepOnBoot(bool *out);
/**
* @brief Gets an Event which is signaled for HdcpAuthenticationFailed.
* @note Only available with AppletType_SystemApplet on [4.0.0+].
* @note The Event must be closed by the user once finished with it.
* @param[out] out_event Output Event with autoclear=false.
*/
Result appletGetHdcpAuthenticationFailedEvent(Event *out_event);
// ILibraryAppletSelfAccessor
/**

View File

@ -3974,6 +3974,88 @@ Result appletGetHomeButtonWriterLockAccessor(AppletLockAccessor *a) {
return _appletGetHomeButtonRwLockAccessor(&g_appletIFunctions, a, 30);
}
// IGlobalStateController
Result appletStartSleepSequence(bool flag) {
if (__nx_applet_type != AppletType_SystemApplet)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
return _appletCmdInBool(&g_appletIGlobalStateController, flag, 2);
}
Result appletStartShutdownSequence(void) {
if (__nx_applet_type != AppletType_SystemApplet)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
return _appletCmdNoIO(&g_appletIGlobalStateController, 3);
}
Result appletStartRebootSequence(void) {
if (__nx_applet_type != AppletType_SystemApplet)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
return _appletCmdNoIO(&g_appletIGlobalStateController, 4);
}
Result appletIsAutoPowerDownRequested(bool *out) {
if (__nx_applet_type != AppletType_SystemApplet)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(7,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdNoInOutBool(&g_appletIGlobalStateController, out, 9);
}
Result appletLoadAndApplyIdlePolicySettings(void) {
if (__nx_applet_type != AppletType_SystemApplet)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
return _appletCmdNoIO(&g_appletIGlobalStateController, 10);
}
Result appletNotifyCecSettingsChanged(void) {
if (__nx_applet_type != AppletType_SystemApplet)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(2,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdNoIO(&g_appletIGlobalStateController, 11);
}
Result appletSetDefaultHomeButtonLongPressTime(s64 val) {
if (hosversionBefore(3,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdInU64(&g_appletIGlobalStateController, val, 12);
}
Result appletUpdateDefaultDisplayResolution(void) {
if (__nx_applet_type != AppletType_SystemApplet)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(3,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdNoIO(&g_appletIGlobalStateController, 13);
}
Result appletShouldSleepOnBoot(bool *out) {
if (__nx_applet_type != AppletType_SystemApplet)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(3,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdNoInOutBool(&g_appletIGlobalStateController, out, 14);
}
Result appletGetHdcpAuthenticationFailedEvent(Event *out_event) {
if (__nx_applet_type != AppletType_SystemApplet)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(4,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletGetEvent(&g_appletIGlobalStateController, out_event, 15, false);
}
// ILibraryAppletSelfAccessor
static Result _appletExitProcessAndReturn(void) {