hiddbg: Added support for SleepButton AutoPilot.

This commit is contained in:
yellows8 2021-02-13 14:20:44 -05:00
parent ae3271ba4c
commit d4542ec9b0
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 24 additions and 0 deletions

View File

@ -40,6 +40,11 @@ typedef struct {
u64 keys[4];
} HiddbgKeyboardAutoPilotState;
/// State for overriding SleepButtonState.
typedef struct {
u64 buttons; ///< Bitfield of buttons, only bit0 is used.
} HiddbgSleepButtonAutoPilotState;
/// HdlsHandle
typedef struct {
u64 handle; ///< Handle
@ -215,6 +220,17 @@ Result hiddbgUnsetKeyboardAutoPilotState(void);
*/
Result hiddbgDeactivateHomeButton(void);
/**
* @brief SetSleepButtonAutoPilotState
* @param[in] state \ref HiddbgSleepButtonAutoPilotState
*/
Result hiddbgSetSleepButtonAutoPilotState(const HiddbgSleepButtonAutoPilotState *state);
/**
* @brief UnsetSleepButtonAutoPilotState
*/
Result hiddbgUnsetSleepButtonAutoPilotState(void);
/**
* @brief Writes the input RGB colors to the spi-flash for the specified UniquePad (offset 0x6050 size 0x6).
* @note Only available with [3.0.0+].

View File

@ -115,6 +115,14 @@ Result hiddbgDeactivateHomeButton(void) {
return _hiddbgCmdNoIO(110);
}
Result hiddbgSetSleepButtonAutoPilotState(const HiddbgSleepButtonAutoPilotState *state) {
return serviceDispatchIn(&g_hiddbgSrv, 121, *state);
}
Result hiddbgUnsetSleepButtonAutoPilotState(void) {
return _hiddbgCmdNoIO(122);
}
Result hiddbgUpdateControllerColor(u32 colorBody, u32 colorButtons, HidsysUniquePadId unique_pad_id) {
if (hosversionBefore(3,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);