diff options
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 23 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.h | 1 |
4 files changed, 29 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 1df62f98e..673db68c7 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -1138,6 +1138,10 @@ void Controller_NPad::SetUnintendedHomeButtonInputProtectionEnabled(bool is_prot | |||
| 1138 | unintended_home_button_input_protection[NPadIdToIndex(npad_id)] = is_protection_enabled; | 1138 | unintended_home_button_input_protection[NPadIdToIndex(npad_id)] = is_protection_enabled; |
| 1139 | } | 1139 | } |
| 1140 | 1140 | ||
| 1141 | void Controller_NPad::SetAnalogStickUseCenterClamp(bool use_center_clamp) { | ||
| 1142 | analog_stick_use_center_clamp = use_center_clamp; | ||
| 1143 | } | ||
| 1144 | |||
| 1141 | void Controller_NPad::ClearAllConnectedControllers() { | 1145 | void Controller_NPad::ClearAllConnectedControllers() { |
| 1142 | for (auto& controller : connected_controllers) { | 1146 | for (auto& controller : connected_controllers) { |
| 1143 | if (controller.is_connected && controller.type != NPadControllerType::None) { | 1147 | if (controller.is_connected && controller.type != NPadControllerType::None) { |
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index bc2e6779d..873a0a1e2 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h | |||
| @@ -219,6 +219,7 @@ public: | |||
| 219 | LedPattern GetLedPattern(u32 npad_id); | 219 | LedPattern GetLedPattern(u32 npad_id); |
| 220 | bool IsUnintendedHomeButtonInputProtectionEnabled(u32 npad_id) const; | 220 | bool IsUnintendedHomeButtonInputProtectionEnabled(u32 npad_id) const; |
| 221 | void SetUnintendedHomeButtonInputProtectionEnabled(bool is_protection_enabled, u32 npad_id); | 221 | void SetUnintendedHomeButtonInputProtectionEnabled(bool is_protection_enabled, u32 npad_id); |
| 222 | void SetAnalogStickUseCenterClamp(bool use_center_clamp); | ||
| 222 | void ClearAllConnectedControllers(); | 223 | void ClearAllConnectedControllers(); |
| 223 | void DisconnectAllConnectedControllers(); | 224 | void DisconnectAllConnectedControllers(); |
| 224 | void ConnectAllDisconnectedControllers(); | 225 | void ConnectAllDisconnectedControllers(); |
| @@ -577,6 +578,7 @@ private: | |||
| 577 | std::array<std::array<bool, 2>, 10> vibration_devices_mounted{}; | 578 | std::array<std::array<bool, 2>, 10> vibration_devices_mounted{}; |
| 578 | std::array<ControllerHolder, 10> connected_controllers{}; | 579 | std::array<ControllerHolder, 10> connected_controllers{}; |
| 579 | std::array<bool, 10> unintended_home_button_input_protection{}; | 580 | std::array<bool, 10> unintended_home_button_input_protection{}; |
| 581 | bool analog_stick_use_center_clamp{}; | ||
| 580 | GyroscopeZeroDriftMode gyroscope_zero_drift_mode{GyroscopeZeroDriftMode::Standard}; | 582 | GyroscopeZeroDriftMode gyroscope_zero_drift_mode{GyroscopeZeroDriftMode::Standard}; |
| 581 | bool sixaxis_sensors_enabled{true}; | 583 | bool sixaxis_sensors_enabled{true}; |
| 582 | f32 sixaxis_fusion_parameter1{}; | 584 | f32 sixaxis_fusion_parameter1{}; |
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"} { | |||
| 263 | {131, &Hid::IsUnintendedHomeButtonInputProtectionEnabled, "IsUnintendedHomeButtonInputProtectionEnabled"}, | 263 | {131, &Hid::IsUnintendedHomeButtonInputProtectionEnabled, "IsUnintendedHomeButtonInputProtectionEnabled"}, |
| 264 | {132, &Hid::EnableUnintendedHomeButtonInputProtection, "EnableUnintendedHomeButtonInputProtection"}, | 264 | {132, &Hid::EnableUnintendedHomeButtonInputProtection, "EnableUnintendedHomeButtonInputProtection"}, |
| 265 | {133, nullptr, "SetNpadJoyAssignmentModeSingleWithDestination"}, | 265 | {133, nullptr, "SetNpadJoyAssignmentModeSingleWithDestination"}, |
| 266 | {134, nullptr, "SetNpadAnalogStickUseCenterClamp"}, | 266 | {134, &Hid::SetNpadAnalogStickUseCenterClamp, "SetNpadAnalogStickUseCenterClamp"}, |
| 267 | {135, nullptr, "SetNpadCaptureButtonAssignment"}, | 267 | {135, nullptr, "SetNpadCaptureButtonAssignment"}, |
| 268 | {136, nullptr, "ClearNpadCaptureButtonAssignment"}, | 268 | {136, nullptr, "ClearNpadCaptureButtonAssignment"}, |
| 269 | {200, &Hid::GetVibrationDeviceInfo, "GetVibrationDeviceInfo"}, | 269 | {200, &Hid::GetVibrationDeviceInfo, "GetVibrationDeviceInfo"}, |
| @@ -1087,6 +1087,27 @@ void Hid::EnableUnintendedHomeButtonInputProtection(Kernel::HLERequestContext& c | |||
| 1087 | rb.Push(RESULT_SUCCESS); | 1087 | rb.Push(RESULT_SUCCESS); |
| 1088 | } | 1088 | } |
| 1089 | 1089 | ||
| 1090 | void Hid::SetNpadAnalogStickUseCenterClamp(Kernel::HLERequestContext& ctx) { | ||
| 1091 | IPC::RequestParser rp{ctx}; | ||
| 1092 | struct Parameters { | ||
| 1093 | bool analog_stick_use_center_clamp; | ||
| 1094 | u64 applet_resource_user_id; | ||
| 1095 | }; | ||
| 1096 | static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size."); | ||
| 1097 | |||
| 1098 | const auto parameters{rp.PopRaw<Parameters>()}; | ||
| 1099 | |||
| 1100 | applet_resource->GetController<Controller_NPad>(HidController::NPad) | ||
| 1101 | .SetAnalogStickUseCenterClamp(parameters.analog_stick_use_center_clamp); | ||
| 1102 | |||
| 1103 | LOG_WARNING(Service_HID, | ||
| 1104 | "(STUBBED) called, analog_stick_use_center_clamp={}, applet_resource_user_id={}", | ||
| 1105 | parameters.analog_stick_use_center_clamp, parameters.applet_resource_user_id); | ||
| 1106 | |||
| 1107 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 1108 | rb.Push(RESULT_SUCCESS); | ||
| 1109 | } | ||
| 1110 | |||
| 1090 | void Hid::GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) { | 1111 | void Hid::GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) { |
| 1091 | IPC::RequestParser rp{ctx}; | 1112 | IPC::RequestParser rp{ctx}; |
| 1092 | const auto vibration_device_handle{rp.PopRaw<Controller_NPad::DeviceHandle>()}; | 1113 | const auto vibration_device_handle{rp.PopRaw<Controller_NPad::DeviceHandle>()}; |
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index 36ed228c8..c2bdd39a3 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h | |||
| @@ -129,6 +129,7 @@ private: | |||
| 129 | void SwapNpadAssignment(Kernel::HLERequestContext& ctx); | 129 | void SwapNpadAssignment(Kernel::HLERequestContext& ctx); |
| 130 | void IsUnintendedHomeButtonInputProtectionEnabled(Kernel::HLERequestContext& ctx); | 130 | void IsUnintendedHomeButtonInputProtectionEnabled(Kernel::HLERequestContext& ctx); |
| 131 | void EnableUnintendedHomeButtonInputProtection(Kernel::HLERequestContext& ctx); | 131 | void EnableUnintendedHomeButtonInputProtection(Kernel::HLERequestContext& ctx); |
| 132 | void SetNpadAnalogStickUseCenterClamp(Kernel::HLERequestContext& ctx); | ||
| 132 | void GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx); | 133 | void GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx); |
| 133 | void SendVibrationValue(Kernel::HLERequestContext& ctx); | 134 | void SendVibrationValue(Kernel::HLERequestContext& ctx); |
| 134 | void GetActualVibrationValue(Kernel::HLERequestContext& ctx); | 135 | void GetActualVibrationValue(Kernel::HLERequestContext& ctx); |