diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-04-08 09:41:06 +0200 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-04-08 09:41:06 +0200 |
commit | 8e545deab934480706b4767bc15773921a9fa4e8 (patch) | |
tree | ee2d44af3e703c726477c03d44af962e43414186 /src/core/hle/service/hid/hid.cpp | |
parent | Merge pull request #6160 from Morph1984/fs-update-12.x (diff) | |
download | yuzu-8e545deab934480706b4767bc15773921a9fa4e8.tar yuzu-8e545deab934480706b4767bc15773921a9fa4e8.tar.gz yuzu-8e545deab934480706b4767bc15773921a9fa4e8.tar.bz2 yuzu-8e545deab934480706b4767bc15773921a9fa4e8.tar.lz yuzu-8e545deab934480706b4767bc15773921a9fa4e8.tar.xz yuzu-8e545deab934480706b4767bc15773921a9fa4e8.tar.zst yuzu-8e545deab934480706b4767bc15773921a9fa4e8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/hid/hid.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index ba27bbb05..7ba25ff79 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -263,7 +263,7 @@ Hid::Hid(Core::System& system_) : ServiceFramework{system_, "hid"} { {131, &Hid::IsUnintendedHomeButtonInputProtectionEnabled, "IsUnintendedHomeButtonInputProtectionEnabled"}, {132, &Hid::EnableUnintendedHomeButtonInputProtection, "EnableUnintendedHomeButtonInputProtection"}, {133, nullptr, "SetNpadJoyAssignmentModeSingleWithDestination"}, - {134, nullptr, "SetNpadAnalogStickUseCenterClamp"}, + {134, &Hid::SetNpadAnalogStickUseCenterClamp, "SetNpadAnalogStickUseCenterClamp"}, {135, nullptr, "SetNpadCaptureButtonAssignment"}, {136, nullptr, "ClearNpadCaptureButtonAssignment"}, {200, &Hid::GetVibrationDeviceInfo, "GetVibrationDeviceInfo"}, @@ -1087,6 +1087,27 @@ void Hid::EnableUnintendedHomeButtonInputProtection(Kernel::HLERequestContext& c rb.Push(RESULT_SUCCESS); } +void Hid::SetNpadAnalogStickUseCenterClamp(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + struct Parameters { + bool analog_stick_use_center_clamp; + u64 applet_resource_user_id; + }; + static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size."); + + const auto parameters{rp.PopRaw<Parameters>()}; + + applet_resource->GetController<Controller_NPad>(HidController::NPad) + .SetAnalogStickUseCenterClamp(parameters.analog_stick_use_center_clamp); + + LOG_WARNING(Service_HID, + "(STUBBED) called, analog_stick_use_center_clamp={}, applet_resource_user_id={}", + parameters.analog_stick_use_center_clamp, parameters.applet_resource_user_id); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); +} + void Hid::GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto vibration_device_handle{rp.PopRaw<Controller_NPad::DeviceHandle>()}; |