summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2020-10-15 14:35:35 -0400
committerGravatar Morph2020-11-15 23:33:20 -0500
commit92fa5257c762f631c64cbc8a60870af7deaf2ead (patch)
treefcddf1f601e75b391c246ac46b6d4591395e9dc8
parentcontrollers/npad: Send an empty vibration on destruction/deactivation (diff)
downloadyuzu-92fa5257c762f631c64cbc8a60870af7deaf2ead.tar.gz
yuzu-92fa5257c762f631c64cbc8a60870af7deaf2ead.tar.xz
yuzu-92fa5257c762f631c64cbc8a60870af7deaf2ead.zip
hid: Mark Begin/EndPermitVibrationSession as stubs
The implementation of these commands seem incomplete and causes rumble in Super Mario Party to stop working since only EndPermitVibrationSession is called. Thus, these are better off being marked as a stub until this can be investigated more thoroughly.
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp10
-rw-r--r--src/core/hle/service/hid/controllers/npad.h3
-rw-r--r--src/core/hle/service/hid/hid.cpp9
3 files changed, 4 insertions, 18 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 81725efbb..1fc06ef3f 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -694,7 +694,7 @@ void Controller_NPad::VibrateControllers(const std::vector<DeviceHandle>& vibrat
694 const std::vector<VibrationValue>& vibration_values) { 694 const std::vector<VibrationValue>& vibration_values) {
695 LOG_TRACE(Service_HID, "called"); 695 LOG_TRACE(Service_HID, "called");
696 696
697 if (!Settings::values.vibration_enabled.GetValue() || !can_controllers_vibrate) { 697 if (!Settings::values.vibration_enabled.GetValue()) {
698 return; 698 return;
699 } 699 }
700 700
@@ -924,14 +924,6 @@ void Controller_NPad::SetUnintendedHomeButtonInputProtectionEnabled(bool is_prot
924 unintended_home_button_input_protection[NPadIdToIndex(npad_id)] = is_protection_enabled; 924 unintended_home_button_input_protection[NPadIdToIndex(npad_id)] = is_protection_enabled;
925} 925}
926 926
927void Controller_NPad::SetVibrationEnabled(bool can_vibrate) {
928 can_controllers_vibrate = can_vibrate;
929}
930
931bool Controller_NPad::IsVibrationEnabled() const {
932 return can_controllers_vibrate;
933}
934
935void Controller_NPad::ClearAllConnectedControllers() { 927void Controller_NPad::ClearAllConnectedControllers() {
936 for (auto& controller : connected_controllers) { 928 for (auto& controller : connected_controllers) {
937 if (controller.is_connected && controller.type != NPadControllerType::None) { 929 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 4dc2a974d..576ef1558 100644
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -173,8 +173,6 @@ public:
173 LedPattern GetLedPattern(u32 npad_id); 173 LedPattern GetLedPattern(u32 npad_id);
174 bool IsUnintendedHomeButtonInputProtectionEnabled(u32 npad_id) const; 174 bool IsUnintendedHomeButtonInputProtectionEnabled(u32 npad_id) const;
175 void SetUnintendedHomeButtonInputProtectionEnabled(bool is_protection_enabled, u32 npad_id); 175 void SetUnintendedHomeButtonInputProtectionEnabled(bool is_protection_enabled, u32 npad_id);
176 void SetVibrationEnabled(bool can_vibrate);
177 bool IsVibrationEnabled() const;
178 void ClearAllConnectedControllers(); 176 void ClearAllConnectedControllers();
179 void DisconnectAllConnectedControllers(); 177 void DisconnectAllConnectedControllers();
180 void ConnectAllDisconnectedControllers(); 178 void ConnectAllDisconnectedControllers();
@@ -416,7 +414,6 @@ private:
416 std::array<ControllerHolder, 10> connected_controllers{}; 414 std::array<ControllerHolder, 10> connected_controllers{};
417 std::array<bool, 10> unintended_home_button_input_protection{}; 415 std::array<bool, 10> unintended_home_button_input_protection{};
418 GyroscopeZeroDriftMode gyroscope_zero_drift_mode{GyroscopeZeroDriftMode::Standard}; 416 GyroscopeZeroDriftMode gyroscope_zero_drift_mode{GyroscopeZeroDriftMode::Standard};
419 bool can_controllers_vibrate{true};
420 bool sixaxis_sensors_enabled{true}; 417 bool sixaxis_sensors_enabled{true};
421 bool sixaxis_at_rest{true}; 418 bool sixaxis_at_rest{true};
422 std::array<ControllerPad, 10> npad_pad_states{}; 419 std::array<ControllerPad, 10> npad_pad_states{};
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 878f20bd2..e88f30d6a 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -1112,18 +1112,15 @@ void Hid::BeginPermitVibrationSession(Kernel::HLERequestContext& ctx) {
1112 IPC::RequestParser rp{ctx}; 1112 IPC::RequestParser rp{ctx};
1113 const auto applet_resource_user_id{rp.Pop<u64>()}; 1113 const auto applet_resource_user_id{rp.Pop<u64>()};
1114 1114
1115 applet_resource->GetController<Controller_NPad>(HidController::NPad).SetVibrationEnabled(true); 1115 LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}",
1116 1116 applet_resource_user_id);
1117 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
1118 1117
1119 IPC::ResponseBuilder rb{ctx, 2}; 1118 IPC::ResponseBuilder rb{ctx, 2};
1120 rb.Push(RESULT_SUCCESS); 1119 rb.Push(RESULT_SUCCESS);
1121} 1120}
1122 1121
1123void Hid::EndPermitVibrationSession(Kernel::HLERequestContext& ctx) { 1122void Hid::EndPermitVibrationSession(Kernel::HLERequestContext& ctx) {
1124 applet_resource->GetController<Controller_NPad>(HidController::NPad).SetVibrationEnabled(false); 1123 LOG_WARNING(Service_HID, "(STUBBED) called");
1125
1126 LOG_DEBUG(Service_HID, "called");
1127 1124
1128 IPC::ResponseBuilder rb{ctx, 2}; 1125 IPC::ResponseBuilder rb{ctx, 2};
1129 rb.Push(RESULT_SUCCESS); 1126 rb.Push(RESULT_SUCCESS);