From cc4819744823ee7ebc0ca41533d2b0b938a72a53 Mon Sep 17 00:00:00 2001 From: Zephyron Date: Sat, 8 Feb 2025 19:39:53 +1000 Subject: [PATCH] service/hid: reorganize gesture-related functions - Move SetGestureOutputRanges function registration to be with other gesture-related functions (next to ActivateGesture) - Move SetGestureOutputRanges implementation to be with other gesture-related implementations - Change log level from WARNING to DEBUG for SetGestureOutputRanges - Move function declaration to private section with other IPC handlers - Update function ordering to match service registration order These changes improve code organization by grouping related functionality together and maintain consistency between the interface registration and implementation ordering. --- src/core/hle/service/hid/hid_server.cpp | 14 +++++++------- src/core/hle/service/hid/hid_server.h | 3 +-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/core/hle/service/hid/hid_server.cpp b/src/core/hle/service/hid/hid_server.cpp index 602a5ab52..c12b1b16b 100644 --- a/src/core/hle/service/hid/hid_server.cpp +++ b/src/core/hle/service/hid/hid_server.cpp @@ -89,6 +89,7 @@ IHidServer::IHidServer(Core::System& system_, std::shared_ptr r {88, C<&IHidServer::GetSixAxisSensorIcInformation>, "GetSixAxisSensorIcInformation"}, {89, C<&IHidServer::ResetIsSixAxisSensorDeviceNewlyAssigned>, "ResetIsSixAxisSensorDeviceNewlyAssigned"}, {91, C<&IHidServer::ActivateGesture>, "ActivateGesture"}, + {92, C<&IHidServer::SetGestureOutputRanges>, "SetGestureOutputRanges"}, {100, C<&IHidServer::SetSupportedNpadStyleSet>, "SetSupportedNpadStyleSet"}, {101, C<&IHidServer::GetSupportedNpadStyleSet>, "GetSupportedNpadStyleSet"}, {102, C<&IHidServer::SetSupportedNpadIdType>, "SetSupportedNpadIdType"}, @@ -184,7 +185,6 @@ IHidServer::IHidServer(Core::System& system_, std::shared_ptr r {1003, C<&IHidServer::IsFirmwareUpdateNeededForNotification>, "IsFirmwareUpdateNeededForNotification"}, {1004, C<&IHidServer::SetTouchScreenResolution>, "SetTouchScreenResolution"}, {2000, nullptr, "ActivateDigitizer"}, - {92, C<&IHidServer::SetGestureOutputRanges>, "SetGestureOutputRanges"}, }; // clang-format on @@ -577,6 +577,12 @@ Result IHidServer::ActivateGesture(u32 basic_gesture_id, ClientAppletResourceUse R_RETURN(GetResourceManager()->GetGesture()->Activate(aruid.pid, basic_gesture_id)); } +Result IHidServer::SetGestureOutputRanges(u32 param1, u32 param2, u32 param3, u32 param4) { + LOG_DEBUG(Service_HID, "SetGestureOutputRanges called with params: {}, {}, {}, {}", param1, param2, param3, param4); + // REF: https://switchbrew.org/wiki/HID_services , Undocumented. 92 [18.0.0+] SetGestureOutputRanges + R_SUCCEED(); +} + Result IHidServer::SetSupportedNpadStyleSet(Core::HID::NpadStyleSet supported_style_set, ClientAppletResourceUserId aruid) { LOG_DEBUG(Service_HID, "called, supported_style_set={}, applet_resource_user_id={}", @@ -1437,10 +1443,4 @@ std::shared_ptr IHidServer::GetResourceManager() { return resource_manager; } -Result IHidServer::SetGestureOutputRanges(u32 param1, u32 param2, u32 param3, u32 param4) { - LOG_WARNING(Service_HID, "SetGestureOutputRanges called with params: {}, {}, {}, {}", param1, param2, param3, param4); - // REF: https://switchbrew.org/wiki/HID_services , Undocumented. 92 [18.0.0+] SetGestureOutputRanges - R_SUCCEED(); -} - } // namespace Service::HID diff --git a/src/core/hle/service/hid/hid_server.h b/src/core/hle/service/hid/hid_server.h index 437c5bd9a..477b35ff0 100644 --- a/src/core/hle/service/hid/hid_server.h +++ b/src/core/hle/service/hid/hid_server.h @@ -31,8 +31,6 @@ public: std::shared_ptr GetResourceManager(); - Result SetGestureOutputRanges(u32, u32, u32, u32); - private: Result CreateAppletResource(OutInterface out_applet_resource, ClientAppletResourceUserId aruid); @@ -106,6 +104,7 @@ private: Result ResetIsSixAxisSensorDeviceNewlyAssigned(Core::HID::SixAxisSensorHandle sixaxis_handle, ClientAppletResourceUserId aruid); Result ActivateGesture(u32 basic_gesture_id, ClientAppletResourceUserId aruid); + Result SetGestureOutputRanges(u32, u32, u32, u32); Result SetSupportedNpadStyleSet(Core::HID::NpadStyleSet supported_style_set, ClientAppletResourceUserId aruid); Result GetSupportedNpadStyleSet(Out out_supported_style_set,