diff --git a/nx/include/switch/services/hidsys.h b/nx/include/switch/services/hidsys.h index 75ce76d9c..033829f10 100644 --- a/nx/include/switch/services/hidsys.h +++ b/nx/include/switch/services/hidsys.h @@ -323,6 +323,51 @@ Result hidsysGetUniquePadsFromNpad(HidNpadIdType id, HidsysUniquePadId *unique_p **/ Result hidsysEnableAppletToGetInput(bool enable); +/** + * @brief EnableHandheldHids +**/ +Result hidsysEnableHandheldHids(void); + +/** + * @brief DisableHandheldHids +**/ +Result hidsysDisableHandheldHids(void); + +/** + * @brief SetJoyConRailEnabled + * @note Only available on [9.0.0+]. + * @param[in] enable Input flag. +**/ +Result hidsysSetJoyConRailEnabled(bool enable); + +/** + * @brief IsJoyConRailEnabled + * @note Only available on [9.0.0+]. + * @param[out] out Output flag. +**/ +Result hidsysIsJoyConRailEnabled(bool *out); + +/** + * @brief IsHandheldHidsEnabled + * @note Only available on [10.0.0+]. + * @param[out] out Output flag. +**/ +Result hidsysIsHandheldHidsEnabled(bool *out); + +/** + * @brief IsJoyConAttachedOnAllRail + * @note Only available on [11.0.0+]. + * @param[out] out Output flag. +**/ +Result hidsysIsJoyConAttachedOnAllRail(bool *out); + +/** + * @brief IsInvertedControllerConnectedOnRail + * @note Only available on [19.0.0+]. + * @param[out] out Output flag. +**/ +Result hidsysIsInvertedControllerConnectedOnRail(bool *out); + /** * @brief AcquireUniquePadConnectionEventHandle * @param[out] out_event Output Event. diff --git a/nx/source/services/hidsys.c b/nx/source/services/hidsys.c index 6e7b5fc9b..14cd72a4a 100644 --- a/nx/source/services/hidsys.c +++ b/nx/source/services/hidsys.c @@ -340,6 +340,49 @@ Result hidsysEnableAppletToGetInput(bool enable) { return serviceDispatchIn(&g_hidsysSrv, 503, in); } +Result hidsysEnableHandheldHids(void) { + return _hidsysCmdNoIO(520); +} + +Result hidsysDisableHandheldHids(void) { + return _hidsysCmdNoIO(521); +} + +Result hidsysSetJoyConRailEnabled(bool enable) { + if (hosversionBefore(9,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _hidsysCmdInBoolNoOut(enable, 522); +} + +Result hidsysIsJoyConRailEnabled(bool *out) { + if (hosversionBefore(9,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _hidsysCmdNoInOutBool(out, 523); +} + +Result hidsysIsHandheldHidsEnabled(bool *out) { + if (hosversionBefore(10,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _hidsysCmdNoInOutBool(out, 524); +} + +Result hidsysIsJoyConAttachedOnAllRail(bool *out) { + if (hosversionBefore(11,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _hidsysCmdNoInOutBool(out, 525); +} + +Result hidsysIsInvertedControllerConnectedOnRail(bool *out) { + if (hosversionBefore(19,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _hidsysCmdNoInOutBool(out, 526); +} + Result hidsysAcquireUniquePadConnectionEventHandle(Event *out_event) { Handle tmp_handle = INVALID_HANDLE;