From 4ac3b0cec5361c057802e87e80edf9e750daa0c3 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Fri, 17 Sep 2021 01:50:31 -0400 Subject: [PATCH] hidsys: Check sysver for the removed cmds with 13.0.0. --- nx/include/switch/services/hidsys.h | 16 ++++++++-------- nx/source/services/hidsys.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/nx/include/switch/services/hidsys.h b/nx/include/switch/services/hidsys.h index 960139f6..00096324 100644 --- a/nx/include/switch/services/hidsys.h +++ b/nx/include/switch/services/hidsys.h @@ -656,7 +656,7 @@ Result hidsysIsButtonConfigStorageRightEmpty(s32 index, bool *out); /** * @brief GetButtonConfigStorageEmbeddedDeprecated - * @note Only available on [10.0.0+]. + * @note Only available on [10.0.0-12.1.0]. * @param[in] index Array index, should be 0-4. * @param[out] config \ref HidcfgButtonConfigEmbedded */ @@ -664,7 +664,7 @@ Result hidsysGetButtonConfigStorageEmbeddedDeprecated(s32 index, HidcfgButtonCon /** * @brief GetButtonConfigStorageFullDeprecated - * @note Only available on [10.0.0+]. + * @note Only available on [10.0.0-12.1.0]. * @param[in] index Array index, should be 0-4. * @param[out] config \ref HidcfgButtonConfigFull */ @@ -672,7 +672,7 @@ Result hidsysGetButtonConfigStorageFullDeprecated(s32 index, HidcfgButtonConfigF /** * @brief GetButtonConfigStorageLeftDeprecated - * @note Only available on [10.0.0+]. + * @note Only available on [10.0.0-12.1.0]. * @param[in] index Array index, should be 0-4. * @param[out] config \ref HidcfgButtonConfigLeft */ @@ -680,7 +680,7 @@ Result hidsysGetButtonConfigStorageLeftDeprecated(s32 index, HidcfgButtonConfigL /** * @brief GetButtonConfigStorageRightDeprecated - * @note Only available on [10.0.0+]. + * @note Only available on [10.0.0-12.1.0]. * @param[in] index Array index, should be 0-4. * @param[out] config \ref HidcfgButtonConfigRight */ @@ -688,7 +688,7 @@ Result hidsysGetButtonConfigStorageRightDeprecated(s32 index, HidcfgButtonConfig /** * @brief SetButtonConfigStorageEmbeddedDeprecated - * @note Only available on [10.0.0+]. + * @note Only available on [10.0.0-12.1.0]. * @param[in] index Array index, should be 0-4. * @param[in] config \ref HidcfgButtonConfigEmbedded */ @@ -696,7 +696,7 @@ Result hidsysSetButtonConfigStorageEmbeddedDeprecated(s32 index, const HidcfgBut /** * @brief SetButtonConfigStorageFullDeprecated - * @note Only available on [10.0.0+]. + * @note Only available on [10.0.0-12.1.0]. * @param[in] index Array index, should be 0-4. * @param[in] config \ref HidcfgButtonConfigFull */ @@ -704,7 +704,7 @@ Result hidsysSetButtonConfigStorageFullDeprecated(s32 index, const HidcfgButtonC /** * @brief SetButtonConfigStorageLeftDeprecated - * @note Only available on [10.0.0+]. + * @note Only available on [10.0.0-12.1.0]. * @param[in] index Array index, should be 0-4. * @param[in] config \ref HidcfgButtonConfigLeft */ @@ -712,7 +712,7 @@ Result hidsysSetButtonConfigStorageLeftDeprecated(s32 index, const HidcfgButtonC /** * @brief SetButtonConfigStorageRightDeprecated - * @note Only available on [10.0.0+]. + * @note Only available on [10.0.0-12.1.0]. * @param[in] index Array index, should be 0-4. * @param[in] config \ref HidcfgButtonConfigRight */ diff --git a/nx/source/services/hidsys.c b/nx/source/services/hidsys.c index 1df38a81..b3cdac3d 100644 --- a/nx/source/services/hidsys.c +++ b/nx/source/services/hidsys.c @@ -678,56 +678,56 @@ Result hidsysIsButtonConfigStorageRightEmpty(s32 index, bool *out) { } Result hidsysGetButtonConfigStorageEmbeddedDeprecated(s32 index, HidcfgButtonConfigEmbedded *config) { - if (hosversionBefore(10,0,0)) + if (hosversionBefore(10,0,0) || hosversionAtLeast(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return _hidsysCmdInU32OutBufFixed((u32)index, config, sizeof(*config), 1259); } Result hidsysGetButtonConfigStorageFullDeprecated(s32 index, HidcfgButtonConfigFull *config) { - if (hosversionBefore(10,0,0)) + if (hosversionBefore(10,0,0) || hosversionAtLeast(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return _hidsysCmdInU32OutBufFixed((u32)index, config, sizeof(*config), 1260); } Result hidsysGetButtonConfigStorageLeftDeprecated(s32 index, HidcfgButtonConfigLeft *config) { - if (hosversionBefore(10,0,0)) + if (hosversionBefore(10,0,0) || hosversionAtLeast(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return _hidsysCmdInU32OutBufFixed((u32)index, config, sizeof(*config), 1261); } Result hidsysGetButtonConfigStorageRightDeprecated(s32 index, HidcfgButtonConfigRight *config) { - if (hosversionBefore(10,0,0)) + if (hosversionBefore(10,0,0) || hosversionAtLeast(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return _hidsysCmdInU32OutBufFixed((u32)index, config, sizeof(*config), 1262); } Result hidsysSetButtonConfigStorageEmbeddedDeprecated(s32 index, const HidcfgButtonConfigEmbedded *config) { - if (hosversionBefore(10,0,0)) + if (hosversionBefore(10,0,0) || hosversionAtLeast(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return _hidsysCmdInU32InBufFixedNoOut((u32)index, config, sizeof(*config), 1263); } Result hidsysSetButtonConfigStorageFullDeprecated(s32 index, const HidcfgButtonConfigFull *config) { - if (hosversionBefore(10,0,0)) + if (hosversionBefore(10,0,0) || hosversionAtLeast(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return _hidsysCmdInU32InBufFixedNoOut((u32)index, config, sizeof(*config), 1264); } Result hidsysSetButtonConfigStorageLeftDeprecated(s32 index, const HidcfgButtonConfigLeft *config) { - if (hosversionBefore(10,0,0)) + if (hosversionBefore(10,0,0) || hosversionAtLeast(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return _hidsysCmdInU32InBufFixedNoOut((u32)index, config, sizeof(*config), 1265); } Result hidsysSetButtonConfigStorageRightDeprecated(s32 index, const HidcfgButtonConfigRight *config) { - if (hosversionBefore(10,0,0)) + if (hosversionBefore(10,0,0) || hosversionAtLeast(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return _hidsysCmdInU32InBufFixedNoOut((u32)index, config, sizeof(*config), 1266);