1
0
Fork 0
forked from suyu/suyu

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.
This commit is contained in:
Morph 2020-10-15 14:35:35 -04:00
parent 373408ae8c
commit 92fa5257c7
3 changed files with 4 additions and 18 deletions

View file

@ -694,7 +694,7 @@ void Controller_NPad::VibrateControllers(const std::vector<DeviceHandle>& vibrat
const std::vector<VibrationValue>& vibration_values) { const std::vector<VibrationValue>& vibration_values) {
LOG_TRACE(Service_HID, "called"); LOG_TRACE(Service_HID, "called");
if (!Settings::values.vibration_enabled.GetValue() || !can_controllers_vibrate) { if (!Settings::values.vibration_enabled.GetValue()) {
return; return;
} }
@ -924,14 +924,6 @@ void Controller_NPad::SetUnintendedHomeButtonInputProtectionEnabled(bool is_prot
unintended_home_button_input_protection[NPadIdToIndex(npad_id)] = is_protection_enabled; unintended_home_button_input_protection[NPadIdToIndex(npad_id)] = is_protection_enabled;
} }
void Controller_NPad::SetVibrationEnabled(bool can_vibrate) {
can_controllers_vibrate = can_vibrate;
}
bool Controller_NPad::IsVibrationEnabled() const {
return can_controllers_vibrate;
}
void Controller_NPad::ClearAllConnectedControllers() { void Controller_NPad::ClearAllConnectedControllers() {
for (auto& controller : connected_controllers) { for (auto& controller : connected_controllers) {
if (controller.is_connected && controller.type != NPadControllerType::None) { if (controller.is_connected && controller.type != NPadControllerType::None) {

View file

@ -173,8 +173,6 @@ public:
LedPattern GetLedPattern(u32 npad_id); LedPattern GetLedPattern(u32 npad_id);
bool IsUnintendedHomeButtonInputProtectionEnabled(u32 npad_id) const; bool IsUnintendedHomeButtonInputProtectionEnabled(u32 npad_id) const;
void SetUnintendedHomeButtonInputProtectionEnabled(bool is_protection_enabled, u32 npad_id); void SetUnintendedHomeButtonInputProtectionEnabled(bool is_protection_enabled, u32 npad_id);
void SetVibrationEnabled(bool can_vibrate);
bool IsVibrationEnabled() const;
void ClearAllConnectedControllers(); void ClearAllConnectedControllers();
void DisconnectAllConnectedControllers(); void DisconnectAllConnectedControllers();
void ConnectAllDisconnectedControllers(); void ConnectAllDisconnectedControllers();
@ -416,7 +414,6 @@ private:
std::array<ControllerHolder, 10> connected_controllers{}; std::array<ControllerHolder, 10> connected_controllers{};
std::array<bool, 10> unintended_home_button_input_protection{}; std::array<bool, 10> unintended_home_button_input_protection{};
GyroscopeZeroDriftMode gyroscope_zero_drift_mode{GyroscopeZeroDriftMode::Standard}; GyroscopeZeroDriftMode gyroscope_zero_drift_mode{GyroscopeZeroDriftMode::Standard};
bool can_controllers_vibrate{true};
bool sixaxis_sensors_enabled{true}; bool sixaxis_sensors_enabled{true};
bool sixaxis_at_rest{true}; bool sixaxis_at_rest{true};
std::array<ControllerPad, 10> npad_pad_states{}; std::array<ControllerPad, 10> npad_pad_states{};

View file

@ -1112,18 +1112,15 @@ void Hid::BeginPermitVibrationSession(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
const auto applet_resource_user_id{rp.Pop<u64>()}; const auto applet_resource_user_id{rp.Pop<u64>()};
applet_resource->GetController<Controller_NPad>(HidController::NPad).SetVibrationEnabled(true); LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}",
applet_resource_user_id);
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
void Hid::EndPermitVibrationSession(Kernel::HLERequestContext& ctx) { void Hid::EndPermitVibrationSession(Kernel::HLERequestContext& ctx) {
applet_resource->GetController<Controller_NPad>(HidController::NPad).SetVibrationEnabled(false); LOG_WARNING(Service_HID, "(STUBBED) called");
LOG_DEBUG(Service_HID, "called");
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);