hid: Add SetGestureOutputRanges function

Add an implementation for function 92 (SetGestureOutputRanges) in the HID service.
This fixes a crash in Donkey Kong Country Returns HD which occurs when the game
attempts to access this unimplemented function. The function is now properly
registered and returns success while logging the call.

The specific error that was occurring:
"Unknown / unimplemented function '92': port='hid'"

According to the official Switch documentation, this function was introduced in
firmware 18.0.0+ and is used for setting gesture output ranges for touch/gesture
controls.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-05-12 16:10:57 +10:00
parent 9c4eea3939
commit 42573456db
2 changed files with 9 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#include <array> #include <array>
@@ -89,6 +90,7 @@ IHidServer::IHidServer(Core::System& system_, std::shared_ptr<ResourceManager> r
{88, C<&IHidServer::GetSixAxisSensorIcInformation>, "GetSixAxisSensorIcInformation"}, {88, C<&IHidServer::GetSixAxisSensorIcInformation>, "GetSixAxisSensorIcInformation"},
{89, C<&IHidServer::ResetIsSixAxisSensorDeviceNewlyAssigned>, "ResetIsSixAxisSensorDeviceNewlyAssigned"}, {89, C<&IHidServer::ResetIsSixAxisSensorDeviceNewlyAssigned>, "ResetIsSixAxisSensorDeviceNewlyAssigned"},
{91, C<&IHidServer::ActivateGesture>, "ActivateGesture"}, {91, C<&IHidServer::ActivateGesture>, "ActivateGesture"},
{92, C<&IHidServer::SetGestureOutputRanges>, "SetGestureOutputRanges"},
{100, C<&IHidServer::SetSupportedNpadStyleSet>, "SetSupportedNpadStyleSet"}, {100, C<&IHidServer::SetSupportedNpadStyleSet>, "SetSupportedNpadStyleSet"},
{101, C<&IHidServer::GetSupportedNpadStyleSet>, "GetSupportedNpadStyleSet"}, {101, C<&IHidServer::GetSupportedNpadStyleSet>, "GetSupportedNpadStyleSet"},
{102, C<&IHidServer::SetSupportedNpadIdType>, "SetSupportedNpadIdType"}, {102, C<&IHidServer::SetSupportedNpadIdType>, "SetSupportedNpadIdType"},
@@ -1431,6 +1433,11 @@ Result IHidServer::SetTouchScreenResolution(u32 width, u32 height,
R_SUCCEED(); R_SUCCEED();
} }
Result IHidServer::SetGestureOutputRanges(ClientAppletResourceUserId aruid) {
LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}", aruid.pid);
R_SUCCEED();
}
std::shared_ptr<ResourceManager> IHidServer::GetResourceManager() { std::shared_ptr<ResourceManager> IHidServer::GetResourceManager() {
resource_manager->Initialize(); resource_manager->Initialize();
return resource_manager; return resource_manager;

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#pragma once #pragma once
@@ -104,6 +105,7 @@ private:
Result ResetIsSixAxisSensorDeviceNewlyAssigned(Core::HID::SixAxisSensorHandle sixaxis_handle, Result ResetIsSixAxisSensorDeviceNewlyAssigned(Core::HID::SixAxisSensorHandle sixaxis_handle,
ClientAppletResourceUserId aruid); ClientAppletResourceUserId aruid);
Result ActivateGesture(u32 basic_gesture_id, ClientAppletResourceUserId aruid); Result ActivateGesture(u32 basic_gesture_id, ClientAppletResourceUserId aruid);
Result SetGestureOutputRanges(ClientAppletResourceUserId aruid);
Result SetSupportedNpadStyleSet(Core::HID::NpadStyleSet supported_style_set, Result SetSupportedNpadStyleSet(Core::HID::NpadStyleSet supported_style_set,
ClientAppletResourceUserId aruid); ClientAppletResourceUserId aruid);
Result GetSupportedNpadStyleSet(Out<Core::HID::NpadStyleSet> out_supported_style_set, Result GetSupportedNpadStyleSet(Out<Core::HID::NpadStyleSet> out_supported_style_set,