diff options
Diffstat (limited to 'src/core/hle/service/hid/controllers')
-rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/service/hid/controllers/npad.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 069e0d5de..27b38abab 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -316,6 +316,9 @@ void Controller_NPad::SetNpadMode(u32 npad_id, NPadAssignments assignment_mode) void Controller_NPad::VibrateController(const std::vector<u32>& controller_ids, const std::vector<Vibration>& vibrations) { + if (!can_controllers_vibrate) { + return; + } for (std::size_t i = 0; i < controller_ids.size(); i++) { if (i >= controller_count) { continue; @@ -386,4 +389,7 @@ Controller_NPad::LedPattern Controller_NPad::GetLedPattern(u32 npad_id) { return LedPattern{0, 0, 0, 0}; }; } +void Controller_NPad::SetVibrationEnabled(bool can_vibrate) { + can_controllers_vibrate = can_vibrate; +} } // namespace Service::HID diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 28c89768c..b1aa98820 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -111,6 +111,7 @@ public: void ConnectNPad(u32 npad_id); void DisconnectNPad(u32 npad_id); LedPattern GetLedPattern(u32 npad_id); + void SetVibrationEnabled(bool can_vibrate); private: struct CommonHeader { @@ -275,6 +276,7 @@ private: std::size_t controller_count{}; static constexpr std::array<u32, 10> npad_id_list{0, 1, 2, 3, 4, 5, 6, 7, 32, 16}; std::array<ControllerHolder, 10> connected_controllers{}; + bool can_controllers_vibrate{true}; void InitNewlyAddedControler(std::size_t controller_idx); }; |