Implement HID function stub "SetGestureOutputRanges" (#105)

Add function stub for "SetGestureOutputRanges" in HID service

Fixes userspace panic when booting Donkey Kong Country Returns HD:

> Debug <Critical> core\hle\service\service.cpp:operator ():78: Assertion Failed!
Unknown / unimplemented function '92(<unknown>)': port='hid' cmd_buf={[0]=0x6, [1]=0x8000000C, [2]=0x1, [3]=0x0, [4]=0x4F434653, [5]=0x0, [6]=0x0, [7]=0x0, [8]=0x49434653}
> Service.AM <Info> core\hle\service\am\service\application_functions.cpp:SetTerminateResult:187: (STUBBED) called, result=0x1a80a (2010-0212)
> Debug.Emulated <Critical> core\hle\kernel\svc\svc_exception.cpp:Break:52: Userspace PANIC! info1=0x0000001086D02C4C, info2=0x0000000000000004
> Debug.Emulated <Critical> core\hle\kernel\svc\svc_exception.cpp:operator ():33: debug_buffer_err_code=1A80A
> Debug.Emulated <Critical> core\hle\kernel\svc\svc_exception.cpp:Break:102: Emulated program broke execution! reason=0x0000000000000000, info1=0x0000001086D02C4C, info2=0x0000000000000004

ref: 132077e18f

![](https://i.imgur.com/hbBnlYs.png)

Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/105
Co-authored-by: EmulationEnjoyer <emulationenjoyer@noreply.localhost>
Co-committed-by: EmulationEnjoyer <emulationenjoyer@noreply.localhost>
This commit is contained in:
EmulationEnjoyer 2025-01-22 20:42:58 +00:00 committed by Briar
parent 2c02c18c86
commit d5bb26bf3e
2 changed files with 11 additions and 0 deletions

View file

@ -89,6 +89,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"},
@ -576,6 +577,15 @@ Result IHidServer::ActivateGesture(u32 basic_gesture_id, ClientAppletResourceUse
R_RETURN(GetResourceManager()->GetGesture()->Activate(aruid.pid, basic_gesture_id)); R_RETURN(GetResourceManager()->GetGesture()->Activate(aruid.pid, basic_gesture_id));
} }
Result IHidServer::SetGestureOutputRanges(u32 param1, u32 param2, u32 param3, u32 param4) {
// https://switchbrew.org/wiki/HID_services , Undocumented. 92 [18.0.0+] SetGestureOutputRanges
LOG_WARNING(
Service_HID,
"(STUBBED) called, param1={}, param2={}, param3={}, param4={}",
param1, param2, param3, param4);
R_SUCCEED();
}
Result IHidServer::SetSupportedNpadStyleSet(Core::HID::NpadStyleSet supported_style_set, Result IHidServer::SetSupportedNpadStyleSet(Core::HID::NpadStyleSet supported_style_set,
ClientAppletResourceUserId aruid) { ClientAppletResourceUserId aruid) {
LOG_DEBUG(Service_HID, "called, supported_style_set={}, applet_resource_user_id={}", LOG_DEBUG(Service_HID, "called, supported_style_set={}, applet_resource_user_id={}",

View file

@ -104,6 +104,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(u32 param1, u32 param2, u32 param3, u32 param4);
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,