From aa8fbf8102b5d3fac8f035fb4086e54fef971db0 Mon Sep 17 00:00:00 2001 From: Florin9doi Date: Sat, 11 May 2024 19:03:17 +0300 Subject: [PATCH] Rename is_fake_move to fit other devices --- rpcs3/Emu/Cell/Modules/cellPad.cpp | 20 ++++++++++---------- rpcs3/Emu/Io/PadHandler.cpp | 4 ++-- rpcs3/Emu/Io/pad_types.h | 2 +- rpcs3/Input/pad_thread.cpp | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellPad.cpp b/rpcs3/Emu/Cell/Modules/cellPad.cpp index c425b5904f..577602053a 100644 --- a/rpcs3/Emu/Cell/Modules/cellPad.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPad.cpp @@ -100,7 +100,7 @@ void cellPad_NotifyStateChange(usz index, u64 /*state*/, bool locked) const auto& pads = handler->GetPads(); const auto& pad = pads[index]; - if (pad->is_fake_move) + if (pad->is_fake_pad) { return; } @@ -198,7 +198,7 @@ error_code cellPadInit(ppu_thread& ppu, u32 max_connect) for (usz i = 0; i < config.get_max_connect(); ++i) { - if (!pads[i]->is_fake_move && (pads[i]->m_port_status & CELL_PAD_STATUS_CONNECTED)) + if (!pads[i]->is_fake_pad && (pads[i]->m_port_status & CELL_PAD_STATUS_CONNECTED)) { send_sys_io_connect_event(i, CELL_PAD_STATUS_CONNECTED); } @@ -264,7 +264,7 @@ error_code cellPadClearBuf(u32 port_no) const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; - if (pad->is_fake_move || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) + if (pad->is_fake_pad || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) return not_an_error(CELL_PAD_ERROR_NO_DEVICE); clear_pad_buffer(pad); @@ -625,7 +625,7 @@ error_code cellPadGetData(u32 port_no, vm::ptr data) const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; - if (pad->is_fake_move || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) + if (pad->is_fake_pad || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) return not_an_error(CELL_PAD_ERROR_NO_DEVICE); pad_get_data(port_no, data.get_ptr()); @@ -705,7 +705,7 @@ error_code cellPadPeriphGetData(u32 port_no, vm::ptr data) const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; - if (pad->is_fake_move || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) + if (pad->is_fake_pad || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) return not_an_error(CELL_PAD_ERROR_NO_DEVICE); pad_get_data(port_no, &data->cellpad_data, true); @@ -737,7 +737,7 @@ error_code cellPadGetRawData(u32 port_no, vm::ptr data) const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; - if (pad->is_fake_move || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) + if (pad->is_fake_pad || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) return not_an_error(CELL_PAD_ERROR_NO_DEVICE); // ? @@ -801,7 +801,7 @@ error_code cellPadSetActDirect(u32 port_no, vm::ptr param) const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; - if (pad->is_fake_move || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) + if (pad->is_fake_pad || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) return not_an_error(CELL_PAD_ERROR_NO_DEVICE); // TODO: find out if this is checked here or later or at all @@ -928,7 +928,7 @@ error_code cellPadGetCapabilityInfo(u32 port_no, vm::ptr const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; - if (pad->is_fake_move || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) + if (pad->is_fake_pad || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) return not_an_error(CELL_PAD_ERROR_NO_DEVICE); // Should return the same as device capability mask, psl1ght has it backwards in pad->h @@ -984,7 +984,7 @@ error_code cellPadInfoPressMode(u32 port_no) const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; - if (pad->is_fake_move || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) + if (pad->is_fake_pad || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) return not_an_error(CELL_PAD_ERROR_NO_DEVICE); return not_an_error((pad->m_device_capability & CELL_PAD_CAPABILITY_PRESS_MODE) ? 1 : 0); @@ -1011,7 +1011,7 @@ error_code cellPadInfoSensorMode(u32 port_no) const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; - if (pad->is_fake_move || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) + if (pad->is_fake_pad || !config.is_reportedly_connected(port_no) || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) return not_an_error(CELL_PAD_ERROR_NO_DEVICE); return not_an_error((pad->m_device_capability & CELL_PAD_CAPABILITY_SENSOR_MODE) ? 1 : 0); diff --git a/rpcs3/Emu/Io/PadHandler.cpp b/rpcs3/Emu/Io/PadHandler.cpp index c56e7d3312..ebd591e94b 100644 --- a/rpcs3/Emu/Io/PadHandler.cpp +++ b/rpcs3/Emu/Io/PadHandler.cpp @@ -748,7 +748,7 @@ void PadHandlerBase::process() pad->m_port_status |= CELL_PAD_STATUS_CONNECTED + CELL_PAD_STATUS_ASSIGN_CHANGES; - if (m_emulation && !pad->is_fake_move) + if (m_emulation && !pad->is_fake_pad) { pad_state_notify_state_change(i, CELL_PAD_STATUS_CONNECTED); } @@ -776,7 +776,7 @@ void PadHandlerBase::process() pad->m_port_status |= CELL_PAD_STATUS_CONNECTED + CELL_PAD_STATUS_ASSIGN_CHANGES; - if (m_emulation && !pad->is_fake_move) + if (m_emulation && !pad->is_fake_pad) { pad_state_notify_state_change(i, CELL_PAD_STATUS_CONNECTED); } diff --git a/rpcs3/Emu/Io/pad_types.h b/rpcs3/Emu/Io/pad_types.h index 8a709c0876..ce4f1306e2 100644 --- a/rpcs3/Emu/Io/pad_types.h +++ b/rpcs3/Emu/Io/pad_types.h @@ -498,7 +498,7 @@ struct Pad bool ldd{false}; CellPadData ldd_data{}; - bool is_fake_move = false; + bool is_fake_pad = false; explicit Pad(pad_handler handler, u32 port_status, u32 device_capability, u32 device_type) : m_pad_handler(handler) diff --git a/rpcs3/Input/pad_thread.cpp b/rpcs3/Input/pad_thread.cpp index e3c3305e5c..e093b739f5 100644 --- a/rpcs3/Input/pad_thread.cpp +++ b/rpcs3/Input/pad_thread.cpp @@ -170,7 +170,7 @@ void pad_thread::Init() cur_pad_handler->Init(); m_pads[i] = std::make_shared(handler_type, CELL_PAD_STATUS_DISCONNECTED, pad_settings[i].device_capability, pad_settings[i].device_type); - m_pads[i]->is_fake_move = (g_cfg.io.move == move_handler::fake && i >= (CELL_PAD_MAX_PORT_NUM - CELL_GEM_MAX_NUM)); + m_pads[i]->is_fake_pad = (g_cfg.io.move == move_handler::fake && i >= (CELL_PAD_MAX_PORT_NUM - CELL_GEM_MAX_NUM)); if (pad_settings[i].is_ldd_pad) {