mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-29 22:20:48 +00:00
cellGem: implement cellGemSetRumble
This commit is contained in:
parent
c6a76eb9af
commit
cc50049bca
@ -888,7 +888,7 @@ public:
|
|||||||
std::lock_guard lock(pad::g_pad_mutex);
|
std::lock_guard lock(pad::g_pad_mutex);
|
||||||
const auto handler = pad::get_current_handler();
|
const auto handler = pad::get_current_handler();
|
||||||
auto& handlers = handler->get_handlers();
|
auto& handlers = handler->get_handlers();
|
||||||
if (auto it = handlers.find(pad_handler::move); it != handlers.end())
|
if (auto it = handlers.find(pad_handler::move); it != handlers.end() && it->second)
|
||||||
{
|
{
|
||||||
for (auto& binding : it->second->bindings())
|
for (auto& binding : it->second->bindings())
|
||||||
{
|
{
|
||||||
@ -2789,6 +2789,25 @@ error_code cellGemSetRumble(u32 gem_num, u8 rumble)
|
|||||||
|
|
||||||
gem.controllers[gem_num].rumble = rumble;
|
gem.controllers[gem_num].rumble = rumble;
|
||||||
|
|
||||||
|
// Set actual device rumble
|
||||||
|
if (g_cfg.io.move == move_handler::real)
|
||||||
|
{
|
||||||
|
std::lock_guard pad_lock(pad::g_pad_mutex);
|
||||||
|
const auto handler = pad::get_current_handler();
|
||||||
|
auto& handlers = handler->get_handlers();
|
||||||
|
if (auto it = handlers.find(pad_handler::move); it != handlers.end() && it->second)
|
||||||
|
{
|
||||||
|
const u32 pad_index = pad_num(gem_num);
|
||||||
|
for (const auto& binding : it->second->bindings())
|
||||||
|
{
|
||||||
|
if (!binding.device || binding.device->player_id != pad_index) continue;
|
||||||
|
|
||||||
|
handler->SetRumble(pad_index, rumble, rumble > 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -817,11 +817,9 @@ int ps_move_handler::send_output_report(ps_move_device* device)
|
|||||||
const auto elapsed = now - device->last_output_report_time;
|
const auto elapsed = now - device->last_output_report_time;
|
||||||
|
|
||||||
// Update LED at an interval or it will be disabled automatically
|
// Update LED at an interval or it will be disabled automatically
|
||||||
if (elapsed >= 4000ms)
|
device->new_output_data |= elapsed >= 4000ms;
|
||||||
{
|
|
||||||
device->new_output_data = true;
|
if (!device->new_output_data)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// Use LED update rate of 120ms
|
// Use LED update rate of 120ms
|
||||||
if (elapsed < 120ms)
|
if (elapsed < 120ms)
|
||||||
@ -858,6 +856,7 @@ void ps_move_handler::apply_pad_data(const pad_ensemble& binding)
|
|||||||
|
|
||||||
const u8 speed_large = config->enable_vibration_motor_large ? pad->m_vibrateMotors[idx_l].m_value : 0;
|
const u8 speed_large = config->enable_vibration_motor_large ? pad->m_vibrateMotors[idx_l].m_value : 0;
|
||||||
|
|
||||||
|
dev->new_output_data |= dev->large_motor != speed_large;
|
||||||
dev->large_motor = speed_large;
|
dev->large_motor = speed_large;
|
||||||
|
|
||||||
if (send_output_report(dev) >= 0)
|
if (send_output_report(dev) >= 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user