From 58d27a9438697b2e2e8dd0bab74e0fd9d2b8a2a5 Mon Sep 17 00:00:00 2001 From: Florin9doi Date: Sat, 18 May 2024 10:31:52 +0300 Subject: [PATCH] Pad: Simplify is_fake_pad logic --- rpcs3/Emu/Io/pad_types.h | 2 ++ rpcs3/Input/pad_thread.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Io/pad_types.h b/rpcs3/Emu/Io/pad_types.h index 79299dce81..cfda7cf6c0 100644 --- a/rpcs3/Emu/Io/pad_types.h +++ b/rpcs3/Emu/Io/pad_types.h @@ -146,7 +146,9 @@ enum CELL_PAD_PCLASS_TYPE_SKATEBOARD = 0x8001, // these are used together with pad->is_fake_pad to capture input events for usbd/gem/move without conflicting with cellPad + CELL_PAD_FAKE_TYPE_FIRST = 0xa000, CELL_PAD_FAKE_TYPE_GUNCON3 = 0xa000, + CELL_PAD_FAKE_TYPE_LAST, CELL_PAD_PCLASS_TYPE_MAX // last item }; diff --git a/rpcs3/Input/pad_thread.cpp b/rpcs3/Input/pad_thread.cpp index c1a225070b..a3a81b4c65 100644 --- a/rpcs3/Input/pad_thread.cpp +++ b/rpcs3/Input/pad_thread.cpp @@ -190,7 +190,8 @@ void pad_thread::Init() i, cfg->device.to_string(), m_pads[i]->m_pad_handler, m_pads[i]->m_vendor_id, m_pads[i]->m_product_id, m_pads[i]->m_class_type, m_pads[i]->m_class_profile); } - m_pads[i]->is_fake_pad = (g_cfg.io.move == move_handler::fake && i >= (static_cast(CELL_PAD_MAX_PORT_NUM) - static_cast(CELL_GEM_MAX_NUM))) || m_pads[i]->m_class_type == CELL_PAD_FAKE_TYPE_GUNCON3; + m_pads[i]->is_fake_pad = (g_cfg.io.move == move_handler::fake && i >= (static_cast(CELL_PAD_MAX_PORT_NUM) - static_cast(CELL_GEM_MAX_NUM))) + || (m_pads[i]->m_class_type >= CELL_PAD_FAKE_TYPE_FIRST && m_pads[i]->m_class_type <= CELL_PAD_FAKE_TYPE_LAST); connect_usb_controller(i, input::get_product_by_vid_pid(m_pads[i]->m_vendor_id, m_pads[i]->m_product_id)); } }