aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/hid/controllers/npad.h
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-10-07 14:22:47 -0400
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-11-15 23:33:20 -0500
commit07b81f57babcc7aa41fddfc892148688e841d96e (patch)
tree1fc825c5a8e9b93ee1384f4713b3379ec4218931 /src/core/hle/service/hid/controllers/npad.h
parent31de52513eef90ed19583ab1ffe3e74ebe95e45d (diff)
hid: Fix controller rumble based on new research
This fixes the issue where rumble is only sent to the first controller. Now, individual controllers can receive their own rumble commands.
Diffstat (limited to 'src/core/hle/service/hid/controllers/npad.h')
-rw-r--r--src/core/hle/service/hid/controllers/npad.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h
index 35dd2bf5f..c1b19103a 100644
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -109,13 +109,13 @@ public:
};
static_assert(sizeof(NpadStyleSet) == 4, "NpadStyleSet is an invalid size");
- struct Vibration {
+ struct VibrationValue {
f32 amp_low;
f32 freq_low;
f32 amp_high;
f32 freq_high;
};
- static_assert(sizeof(Vibration) == 0x10, "Vibration is an invalid size");
+ static_assert(sizeof(VibrationValue) == 0x10, "Vibration is an invalid size");
struct LedPattern {
explicit LedPattern(u64 light1, u64 light2, u64 light3, u64 light4) {
@@ -148,10 +148,10 @@ public:
void SetNpadMode(u32 npad_id, NpadAssignments assignment_mode);
- void VibrateController(const std::vector<u32>& controllers,
- const std::vector<Vibration>& vibrations);
+ void VibrateController(const std::vector<DeviceHandle>& vibration_device_handles,
+ const std::vector<VibrationValue>& vibration_values);
- Vibration GetLastVibration() const;
+ VibrationValue GetLastVibration(const DeviceHandle& vibration_device_handle) const;
std::shared_ptr<Kernel::ReadableEvent> GetStyleSetChangedEvent(u32 npad_id) const;
void SignalStyleSetChangedEvent(u32 npad_id) const;
@@ -410,7 +410,7 @@ private:
NpadHandheldActivationMode handheld_activation_mode{NpadHandheldActivationMode::Dual};
// Each controller should have their own styleset changed event
std::array<Kernel::EventPair, 10> styleset_changed_events;
- Vibration last_processed_vibration{};
+ std::array<std::array<VibrationValue, 3>, 10> latest_vibration_values;
std::array<ControllerHolder, 10> connected_controllers{};
std::array<bool, 10> unintended_home_button_input_protection{};
GyroscopeZeroDriftMode gyroscope_zero_drift_mode{GyroscopeZeroDriftMode::Standard};