mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-12-06 07:12:28 +01:00
input: Memorize original small motor value for display purposes
This commit is contained in:
parent
aca9d28a7a
commit
0876a7d37e
|
|
@ -3482,7 +3482,7 @@ error_code cellGemSetRumble(u32 gem_num, u8 rumble)
|
||||||
{
|
{
|
||||||
if (!binding.device || binding.device->player_id != pad_index) continue;
|
if (!binding.device || binding.device->player_id != pad_index) continue;
|
||||||
|
|
||||||
handler->SetRumble(pad_index, rumble, rumble > 0);
|
handler->SetRumble(pad_index, rumble, rumble);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,8 +128,8 @@ void show_debug_overlay(const CellPadData& data, const Pad& pad, const pad_info&
|
||||||
"on", data.len >= CELL_PAD_LEN_CHANGE_DEFAULT ? "on" : "off",
|
"on", data.len >= CELL_PAD_LEN_CHANGE_DEFAULT ? "on" : "off",
|
||||||
(setting & CELL_PAD_SETTING_PRESS_ON) ? "on" : "off", data.len >= CELL_PAD_LEN_CHANGE_PRESS_ON ? "on" : "off",
|
(setting & CELL_PAD_SETTING_PRESS_ON) ? "on" : "off", data.len >= CELL_PAD_LEN_CHANGE_PRESS_ON ? "on" : "off",
|
||||||
(setting & CELL_PAD_SETTING_SENSOR_ON) ? "on" : "off", data.len >= CELL_PAD_LEN_CHANGE_SENSOR_ON ? "on" : "off",
|
(setting & CELL_PAD_SETTING_SENSOR_ON) ? "on" : "off", data.len >= CELL_PAD_LEN_CHANGE_SENSOR_ON ? "on" : "off",
|
||||||
pad.m_vibrateMotors[0].m_value, pad.m_vibrateMotors[0].m_adjusted_value,
|
pad.m_vibrate_motors[0].value, pad.m_vibrate_motors[0].adjusted_value,
|
||||||
pad.m_vibrateMotors[1].m_value, pad.m_vibrateMotors[1].m_adjusted_value,
|
pad.m_vibrate_motors[1].value, pad.m_vibrate_motors[1].adjusted_value,
|
||||||
pad.m_digital_1, d1,
|
pad.m_digital_1, d1,
|
||||||
pad.m_digital_2, d2,
|
pad.m_digital_2, d2,
|
||||||
pad.m_press_up, !!(d1 & CELL_PAD_CTRL_UP), data.button[CELL_PAD_BTN_OFFSET_PRESS_UP],
|
pad.m_press_up, !!(d1 & CELL_PAD_CTRL_UP), data.button[CELL_PAD_BTN_OFFSET_PRESS_UP],
|
||||||
|
|
@ -905,7 +905,7 @@ error_code cellPadSetActDirect(u32 port_no, vm::ptr<CellPadActParam> param)
|
||||||
if (!(pad->m_device_capability & CELL_PAD_CAPABILITY_ACTUATOR))
|
if (!(pad->m_device_capability & CELL_PAD_CAPABILITY_ACTUATOR))
|
||||||
return CELL_PAD_ERROR_UNSUPPORTED_GAMEPAD;
|
return CELL_PAD_ERROR_UNSUPPORTED_GAMEPAD;
|
||||||
|
|
||||||
handler->SetRumble(port_no, param->motor[1], param->motor[0] > 0);
|
handler->SetRumble(port_no, param->motor[1], param->motor[0]);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -538,8 +538,8 @@ bool PadHandlerBase::bindPadToDevice(std::shared_ptr<Pad> pad)
|
||||||
pad->m_sensors[2] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_Z, 0, 0, 0, DEFAULT_MOTION_Z);
|
pad->m_sensors[2] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_Z, 0, 0, 0, DEFAULT_MOTION_Z);
|
||||||
pad->m_sensors[3] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_G, 0, 0, 0, DEFAULT_MOTION_G);
|
pad->m_sensors[3] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_G, 0, 0, 0, DEFAULT_MOTION_G);
|
||||||
|
|
||||||
pad->m_vibrateMotors[0] = VibrateMotor(true);
|
pad->m_vibrate_motors[0] = VibrateMotor(true);
|
||||||
pad->m_vibrateMotors[1] = VibrateMotor(false);
|
pad->m_vibrate_motors[1] = VibrateMotor(false);
|
||||||
|
|
||||||
m_bindings.emplace_back(pad, pad_device, nullptr);
|
m_bindings.emplace_back(pad, pad_device, nullptr);
|
||||||
|
|
||||||
|
|
@ -759,10 +759,10 @@ void PadHandlerBase::process()
|
||||||
|
|
||||||
if ((get_system_time() - pad->m_last_rumble_time_us) > 3'000'000)
|
if ((get_system_time() - pad->m_last_rumble_time_us) > 3'000'000)
|
||||||
{
|
{
|
||||||
for (VibrateMotor& motor : pad->m_vibrateMotors)
|
for (VibrateMotor& motor : pad->m_vibrate_motors)
|
||||||
{
|
{
|
||||||
motor.m_value = 0;
|
motor.value = 0;
|
||||||
motor.m_adjusted_value = 0;
|
motor.adjusted_value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pad->m_last_rumble_time_us = 0;
|
pad->m_last_rumble_time_us = 0;
|
||||||
|
|
|
||||||
|
|
@ -31,30 +31,27 @@ std::string cfg_pad::get_buttons(std::vector<std::string> vec)
|
||||||
return fmt::merge(vec, ",");
|
return fmt::merge(vec, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 cfg_pad::get_large_motor_speed(std::array<VibrateMotor, 2>& motors) const
|
u8 cfg_pad::get_motor_speed(VibrateMotor& motor, f32 multiplier) const
|
||||||
{
|
{
|
||||||
VibrateMotor& motor = motors[switch_vibration_motors ? 1 : 0];
|
// If motor is small, use either 0 or 255.
|
||||||
const f32 multiplier = multiplier_vibration_motor_large / 100.0f;
|
const u8 value = motor.is_large_motor ? motor.value : (motor.value > 0 ? 255 : 0);
|
||||||
|
|
||||||
// Ignore lower range. Scale remaining range to full range.
|
// Ignore lower range. Scale remaining range to full range.
|
||||||
const f32 adjusted = PadHandlerBase::ScaledInput(motor.m_value, static_cast<f32>(vibration_threshold.get()), 255.0f, 0.0f, 255.0f);
|
const f32 adjusted = PadHandlerBase::ScaledInput(value, static_cast<f32>(vibration_threshold.get()), 255.0f, 0.0f, 255.0f);
|
||||||
|
|
||||||
// Apply multiplier
|
// Apply multiplier
|
||||||
motor.m_adjusted_value = static_cast<u8>(std::clamp(adjusted * multiplier, 0.0f, 255.0f));
|
motor.adjusted_value = static_cast<u8>(std::clamp(adjusted * multiplier, 0.0f, 255.0f));
|
||||||
return motor.m_adjusted_value;
|
return motor.adjusted_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
u8 cfg_pad::get_large_motor_speed(std::array<VibrateMotor, 2>& motors) const
|
||||||
|
{
|
||||||
|
return get_motor_speed(motors[switch_vibration_motors ? 1 : 0], multiplier_vibration_motor_large / 100.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 cfg_pad::get_small_motor_speed(std::array<VibrateMotor, 2>& motors) const
|
u8 cfg_pad::get_small_motor_speed(std::array<VibrateMotor, 2>& motors) const
|
||||||
{
|
{
|
||||||
VibrateMotor& motor = motors[switch_vibration_motors ? 0 : 1];
|
return get_motor_speed(motors[switch_vibration_motors ? 0 : 1], multiplier_vibration_motor_small / 100.0f);
|
||||||
const f32 multiplier = multiplier_vibration_motor_small / 100.0f;
|
|
||||||
|
|
||||||
// Ignore lower range. Scale remaining range to full range.
|
|
||||||
const f32 adjusted = PadHandlerBase::ScaledInput(motor.m_value, static_cast<f32>(vibration_threshold.get()), 255.0f, 0.0f, 255.0f);
|
|
||||||
|
|
||||||
// Apply multiplier
|
|
||||||
motor.m_adjusted_value = static_cast<u8>(std::clamp(adjusted * multiplier, 0.0f, 255.0f));
|
|
||||||
return motor.m_adjusted_value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cfg_input::load(const std::string& title_id, const std::string& config_file, bool strict)
|
bool cfg_input::load(const std::string& title_id, const std::string& config_file, bool strict)
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ struct cfg_pad final : cfg::node
|
||||||
static std::vector<std::string> get_buttons(const std::string& str);
|
static std::vector<std::string> get_buttons(const std::string& str);
|
||||||
static std::string get_buttons(std::vector<std::string> vec);
|
static std::string get_buttons(std::vector<std::string> vec);
|
||||||
|
|
||||||
|
u8 get_motor_speed(VibrateMotor& motor, f32 multiplier) const;
|
||||||
u8 get_large_motor_speed(std::array<VibrateMotor, 2>& motors) const;
|
u8 get_large_motor_speed(std::array<VibrateMotor, 2>& motors) const;
|
||||||
u8 get_small_motor_speed(std::array<VibrateMotor, 2>& motors) const;
|
u8 get_small_motor_speed(std::array<VibrateMotor, 2>& motors) const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -459,13 +459,13 @@ struct AnalogSensor
|
||||||
|
|
||||||
struct VibrateMotor
|
struct VibrateMotor
|
||||||
{
|
{
|
||||||
bool m_is_large_motor = false;
|
bool is_large_motor = false;
|
||||||
u8 m_value = 0;
|
u8 value = 0;
|
||||||
u8 m_adjusted_value = 0;
|
u8 adjusted_value = 0;
|
||||||
|
|
||||||
VibrateMotor() {}
|
VibrateMotor() {}
|
||||||
VibrateMotor(bool is_large_motor)
|
VibrateMotor(bool is_large_motor)
|
||||||
: m_is_large_motor(is_large_motor)
|
: is_large_motor(is_large_motor)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -546,7 +546,7 @@ struct Pad
|
||||||
std::vector<Button> m_buttons;
|
std::vector<Button> m_buttons;
|
||||||
std::array<AnalogStick, 4> m_sticks{};
|
std::array<AnalogStick, 4> m_sticks{};
|
||||||
std::array<AnalogSensor, 4> m_sensors{};
|
std::array<AnalogSensor, 4> m_sensors{};
|
||||||
std::array<VibrateMotor, 2> m_vibrateMotors{};
|
std::array<VibrateMotor, 2> m_vibrate_motors{};
|
||||||
|
|
||||||
std::vector<Button> m_buttons_external;
|
std::vector<Button> m_buttons_external;
|
||||||
std::array<AnalogStick, 4> m_sticks_external{};
|
std::array<AnalogStick, 4> m_sticks_external{};
|
||||||
|
|
|
||||||
|
|
@ -549,8 +549,8 @@ void ds3_pad_handler::apply_pad_data(const pad_ensemble& binding)
|
||||||
|
|
||||||
cfg_pad* config = dev->config;
|
cfg_pad* config = dev->config;
|
||||||
|
|
||||||
const u8 speed_large = config->get_large_motor_speed(pad->m_vibrateMotors);
|
const u8 speed_large = config->get_large_motor_speed(pad->m_vibrate_motors);
|
||||||
const u8 speed_small = config->get_small_motor_speed(pad->m_vibrateMotors);
|
const u8 speed_small = config->get_small_motor_speed(pad->m_vibrate_motors);
|
||||||
|
|
||||||
const bool wireless = dev->cable_state == 0;
|
const bool wireless = dev->cable_state == 0;
|
||||||
const bool low_battery = dev->battery_level < 25;
|
const bool low_battery = dev->battery_level < 25;
|
||||||
|
|
|
||||||
|
|
@ -918,8 +918,8 @@ void ds4_pad_handler::apply_pad_data(const pad_ensemble& binding)
|
||||||
cfg_pad* config = dev->config;
|
cfg_pad* config = dev->config;
|
||||||
|
|
||||||
// Attempt to send rumble no matter what
|
// Attempt to send rumble no matter what
|
||||||
const u8 speed_large = config->get_large_motor_speed(pad->m_vibrateMotors);
|
const u8 speed_large = config->get_large_motor_speed(pad->m_vibrate_motors);
|
||||||
const u8 speed_small = config->get_small_motor_speed(pad->m_vibrateMotors);
|
const u8 speed_small = config->get_small_motor_speed(pad->m_vibrate_motors);
|
||||||
|
|
||||||
const bool wireless = dev->cable_state == 0;
|
const bool wireless = dev->cable_state == 0;
|
||||||
const bool low_battery = dev->battery_level < 2;
|
const bool low_battery = dev->battery_level < 2;
|
||||||
|
|
|
||||||
|
|
@ -939,8 +939,8 @@ void dualsense_pad_handler::apply_pad_data(const pad_ensemble& binding)
|
||||||
cfg_pad* config = dev->config;
|
cfg_pad* config = dev->config;
|
||||||
|
|
||||||
// Attempt to send rumble no matter what
|
// Attempt to send rumble no matter what
|
||||||
const u8 speed_large = config->get_large_motor_speed(pad->m_vibrateMotors);
|
const u8 speed_large = config->get_large_motor_speed(pad->m_vibrate_motors);
|
||||||
const u8 speed_small = config->get_small_motor_speed(pad->m_vibrateMotors);
|
const u8 speed_small = config->get_small_motor_speed(pad->m_vibrate_motors);
|
||||||
|
|
||||||
const bool wireless = dev->cable_state == 0;
|
const bool wireless = dev->cable_state == 0;
|
||||||
const bool low_battery = dev->battery_level <= 1;
|
const bool low_battery = dev->battery_level <= 1;
|
||||||
|
|
|
||||||
|
|
@ -1302,8 +1302,8 @@ void evdev_joystick_handler::apply_pad_data(const pad_ensemble& binding)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Handle vibration
|
// Handle vibration
|
||||||
const u8 force_large = cfg->get_large_motor_speed(pad->m_vibrateMotors);
|
const u8 force_large = cfg->get_large_motor_speed(pad->m_vibrate_motors);
|
||||||
const u8 force_small = cfg->get_small_motor_speed(pad->m_vibrateMotors);
|
const u8 force_small = cfg->get_small_motor_speed(pad->m_vibrate_motors);
|
||||||
SetRumble(evdev_device, force_large, force_small);
|
SetRumble(evdev_device, force_large, force_small);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1478,8 +1478,8 @@ bool evdev_joystick_handler::bindPadToDevice(std::shared_ptr<Pad> pad)
|
||||||
pad->m_sensors[2] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_Z, m_dev->axis_motion[2].code, m_dev->axis_motion[2].mirrored, m_dev->axis_motion[2].shift, DEFAULT_MOTION_Z);
|
pad->m_sensors[2] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_Z, m_dev->axis_motion[2].code, m_dev->axis_motion[2].mirrored, m_dev->axis_motion[2].shift, DEFAULT_MOTION_Z);
|
||||||
pad->m_sensors[3] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_G, m_dev->axis_motion[3].code, m_dev->axis_motion[3].mirrored, m_dev->axis_motion[3].shift, DEFAULT_MOTION_G);
|
pad->m_sensors[3] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_G, m_dev->axis_motion[3].code, m_dev->axis_motion[3].mirrored, m_dev->axis_motion[3].shift, DEFAULT_MOTION_G);
|
||||||
|
|
||||||
pad->m_vibrateMotors[0] = VibrateMotor(true);
|
pad->m_vibrate_motors[0] = VibrateMotor(true);
|
||||||
pad->m_vibrateMotors[1] = VibrateMotor(false);
|
pad->m_vibrate_motors[1] = VibrateMotor(false);
|
||||||
|
|
||||||
if (std::shared_ptr<EvdevDevice> evdev_device = add_device(player_config->device, false))
|
if (std::shared_ptr<EvdevDevice> evdev_device = add_device(player_config->device, false))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1072,8 +1072,8 @@ bool keyboard_pad_handler::bindPadToDevice(std::shared_ptr<Pad> pad)
|
||||||
pad->m_sensors[2] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_Z, 0, 0, 0, DEFAULT_MOTION_Z);
|
pad->m_sensors[2] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_Z, 0, 0, 0, DEFAULT_MOTION_Z);
|
||||||
pad->m_sensors[3] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_G, 0, 0, 0, DEFAULT_MOTION_G);
|
pad->m_sensors[3] = AnalogSensor(CELL_PAD_BTN_OFFSET_SENSOR_G, 0, 0, 0, DEFAULT_MOTION_G);
|
||||||
|
|
||||||
pad->m_vibrateMotors[0] = VibrateMotor(true);
|
pad->m_vibrate_motors[0] = VibrateMotor(true);
|
||||||
pad->m_vibrateMotors[1] = VibrateMotor(false);
|
pad->m_vibrate_motors[1] = VibrateMotor(false);
|
||||||
|
|
||||||
m_bindings.emplace_back(pad, nullptr, nullptr);
|
m_bindings.emplace_back(pad, nullptr, nullptr);
|
||||||
m_pads_internal.push_back(*pad);
|
m_pads_internal.push_back(*pad);
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ void pad_thread::Init()
|
||||||
input::set_mouse_and_keyboard(m_handlers.contains(pad_handler::keyboard) ? input::active_mouse_and_keyboard::pad : input::active_mouse_and_keyboard::emulated);
|
input::set_mouse_and_keyboard(m_handlers.contains(pad_handler::keyboard) ? input::active_mouse_and_keyboard::pad : input::active_mouse_and_keyboard::emulated);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pad_thread::SetRumble(u32 pad, u8 large_motor, bool small_motor)
|
void pad_thread::SetRumble(u32 pad, u8 large_motor, u8 small_motor)
|
||||||
{
|
{
|
||||||
if (pad >= m_pads.size() || !m_pads[pad])
|
if (pad >= m_pads.size() || !m_pads[pad])
|
||||||
return;
|
return;
|
||||||
|
|
@ -261,8 +261,8 @@ void pad_thread::SetRumble(u32 pad, u8 large_motor, bool small_motor)
|
||||||
const u64 now_us = get_system_time();
|
const u64 now_us = get_system_time();
|
||||||
|
|
||||||
m_pads[pad]->m_last_rumble_time_us = now_us;
|
m_pads[pad]->m_last_rumble_time_us = now_us;
|
||||||
m_pads[pad]->m_vibrateMotors[0].m_value = large_motor;
|
m_pads[pad]->m_vibrate_motors[0].value = large_motor;
|
||||||
m_pads[pad]->m_vibrateMotors[1].m_value = small_motor ? 255 : 0;
|
m_pads[pad]->m_vibrate_motors[1].value = small_motor;
|
||||||
|
|
||||||
// Rumble copilots as well
|
// Rumble copilots as well
|
||||||
for (const auto& copilot : m_pads[pad]->copilots)
|
for (const auto& copilot : m_pads[pad]->copilots)
|
||||||
|
|
@ -270,8 +270,8 @@ void pad_thread::SetRumble(u32 pad, u8 large_motor, bool small_motor)
|
||||||
if (copilot && copilot->is_connected())
|
if (copilot && copilot->is_connected())
|
||||||
{
|
{
|
||||||
copilot->m_last_rumble_time_us = now_us;
|
copilot->m_last_rumble_time_us = now_us;
|
||||||
copilot->m_vibrateMotors[0].m_value = large_motor;
|
copilot->m_vibrate_motors[0].value = large_motor;
|
||||||
copilot->m_vibrateMotors[1].m_value = small_motor ? 255 : 0;
|
copilot->m_vibrate_motors[1].value = small_motor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public:
|
||||||
|
|
||||||
PadInfo& GetInfo() { return m_info; }
|
PadInfo& GetInfo() { return m_info; }
|
||||||
std::array<std::shared_ptr<Pad>, CELL_PAD_MAX_PORT_NUM>& GetPads() { return m_pads; }
|
std::array<std::shared_ptr<Pad>, CELL_PAD_MAX_PORT_NUM>& GetPads() { return m_pads; }
|
||||||
void SetRumble(u32 pad, u8 large_motor, bool small_motor);
|
void SetRumble(u32 pad, u8 large_motor, u8 small_motor);
|
||||||
void SetIntercepted(bool intercepted);
|
void SetIntercepted(bool intercepted);
|
||||||
|
|
||||||
s32 AddLddPad();
|
s32 AddLddPad();
|
||||||
|
|
|
||||||
|
|
@ -816,7 +816,7 @@ void ps_move_handler::apply_pad_data(const pad_ensemble& binding)
|
||||||
|
|
||||||
cfg_pad* config = dev->config;
|
cfg_pad* config = dev->config;
|
||||||
|
|
||||||
const u8 speed_large = config->get_large_motor_speed(pad->m_vibrateMotors);
|
const u8 speed_large = config->get_large_motor_speed(pad->m_vibrate_motors);
|
||||||
|
|
||||||
dev->new_output_data |= dev->large_motor != speed_large;
|
dev->new_output_data |= dev->large_motor != speed_large;
|
||||||
dev->large_motor = speed_large;
|
dev->large_motor = speed_large;
|
||||||
|
|
|
||||||
|
|
@ -735,8 +735,8 @@ void sdl_pad_handler::apply_pad_data(const pad_ensemble& binding)
|
||||||
// The two motors are not the same, and they create different vibration effects. Values range between 0 to 65535.
|
// The two motors are not the same, and they create different vibration effects. Values range between 0 to 65535.
|
||||||
if (dev->sdl.has_rumble || dev->sdl.has_rumble_triggers)
|
if (dev->sdl.has_rumble || dev->sdl.has_rumble_triggers)
|
||||||
{
|
{
|
||||||
const u8 speed_large = cfg->get_large_motor_speed(pad->m_vibrateMotors);
|
const u8 speed_large = cfg->get_large_motor_speed(pad->m_vibrate_motors);
|
||||||
const u8 speed_small = cfg->get_small_motor_speed(pad->m_vibrateMotors);
|
const u8 speed_small = cfg->get_small_motor_speed(pad->m_vibrate_motors);
|
||||||
|
|
||||||
dev->new_output_data |= dev->large_motor != speed_large || dev->small_motor != speed_small;
|
dev->new_output_data |= dev->large_motor != speed_large || dev->small_motor != speed_small;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -566,8 +566,8 @@ void xinput_pad_handler::apply_pad_data(const pad_ensemble& binding)
|
||||||
|
|
||||||
// The left motor is the low-frequency rumble motor. The right motor is the high-frequency rumble motor.
|
// The left motor is the low-frequency rumble motor. The right motor is the high-frequency rumble motor.
|
||||||
// The two motors are not the same, and they create different vibration effects. Values range between 0 to 65535.
|
// The two motors are not the same, and they create different vibration effects. Values range between 0 to 65535.
|
||||||
const u8 speed_large = cfg->get_large_motor_speed(pad->m_vibrateMotors);
|
const u8 speed_large = cfg->get_large_motor_speed(pad->m_vibrate_motors);
|
||||||
const u8 speed_small = cfg->get_small_motor_speed(pad->m_vibrateMotors);
|
const u8 speed_small = cfg->get_small_motor_speed(pad->m_vibrate_motors);
|
||||||
|
|
||||||
dev->new_output_data |= dev->large_motor != speed_large || dev->small_motor != speed_small;
|
dev->new_output_data |= dev->large_motor != speed_large || dev->small_motor != speed_small;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue