From 74540844d230b597a47f46dd6e03b10d0d12e500 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Mon, 20 Jan 2025 22:55:21 +0100 Subject: [PATCH] cellGem: ignore missing pad handler This is a hacky way to fix cellGem savestates --- rpcs3/Emu/Cell/Modules/cellGem.cpp | 33 +++++++++++----------- rpcs3/Emu/Cell/Modules/cellPad.cpp | 40 +++++++++++++-------------- rpcs3/Emu/Io/Buzz.cpp | 2 +- rpcs3/Emu/Io/GHLtar.cpp | 2 +- rpcs3/Emu/Io/GameTablet.cpp | 2 +- rpcs3/Emu/Io/GunCon3.cpp | 2 +- rpcs3/Emu/Io/TopShotElite.cpp | 2 +- rpcs3/Emu/Io/TopShotFearmaster.cpp | 2 +- rpcs3/Emu/Io/Turntable.cpp | 2 +- rpcs3/Emu/Io/usio.cpp | 4 +-- rpcs3/Emu/RSX/Overlays/overlays.cpp | 2 +- rpcs3/Input/pad_thread.cpp | 6 ++-- rpcs3/Input/pad_thread.h | 10 +++---- rpcs3/rpcs3qt/pad_settings_dialog.cpp | 2 +- 14 files changed, 56 insertions(+), 55 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellGem.cpp b/rpcs3/Emu/Cell/Modules/cellGem.cpp index 5c32a299b3..28c5c3450b 100644 --- a/rpcs3/Emu/Cell/Modules/cellGem.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGem.cpp @@ -329,7 +329,8 @@ public: connected_controllers = 0; std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(true); + if (!handler) break; for (u32 i = 0; i < CELL_GEM_MAX_NUM; i++) { @@ -398,7 +399,7 @@ public: if (g_cfg.io.move == move_handler::real) { std::lock_guard pad_lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num)); if (pad && pad->m_pad_handler == pad_handler::move) { @@ -428,7 +429,7 @@ public: if (g_cfg.io.move == move_handler::real) { std::lock_guard pad_lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num)); if (pad && pad->m_pad_handler == pad_handler::move) { @@ -458,7 +459,7 @@ public: { connected_controllers = 0; std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); for (u32 i = 0; i < std::min(attribute.max_connect, CELL_GEM_MAX_NUM); i++) { const auto& pad = ::at32(handler->GetPads(), pad_num(i)); @@ -479,7 +480,7 @@ public: { connected_controllers = 0; std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); for (u32 i = 0; i < std::min(attribute.max_connect, CELL_GEM_MAX_NUM); i++) { const auto& pad = ::at32(handler->GetPads(), pad_num(i)); @@ -1482,7 +1483,7 @@ public: // Update PS Move LED colors { std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); auto& handlers = handler->get_handlers(); if (auto it = handlers.find(pad_handler::move); it != handlers.end() && it->second) { @@ -1744,7 +1745,7 @@ static void ds3_input_to_pad(const u32 gem_num, be_t& digital_buttons, be_t std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num)); if (!(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) @@ -1837,7 +1838,7 @@ static void ds3_pos_to_gem_state(u32 gem_num, gem_config::gem_controller& contro std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num)); if (!(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) @@ -1868,7 +1869,7 @@ static void ps_move_pos_to_gem_state(u32 gem_num, gem_config::gem_controller& co std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num)); if (pad->m_pad_handler != pad_handler::move || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) @@ -1913,7 +1914,7 @@ static void ds3_input_to_ext(u32 gem_num, gem_config::gem_controller& controller std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num)); if (!(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) @@ -2373,7 +2374,7 @@ error_code cellGemEnableMagnetometer(u32 gem_num, u32 enable) { std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num)); if (pad && pad->m_pad_handler == pad_handler::move) @@ -2421,7 +2422,7 @@ error_code cellGemEnableMagnetometer2(u32 gem_num, u32 enable) { std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num)); if (pad && pad->m_pad_handler == pad_handler::move) @@ -2746,7 +2747,7 @@ error_code cellGemGetInertialState(u32 gem_num, u32 state_flag, u64 timestamp, v { std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num)); if (pad && (pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) @@ -3333,7 +3334,7 @@ error_code cellGemReadExternalPortDeviceInfo(u32 gem_num, vm::ptr ext_id, v { std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num)); if (pad->m_pad_handler != pad_handler::move || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) @@ -3417,7 +3418,7 @@ error_code cellGemSetRumble(u32 gem_num, u8 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(); + const auto handler = pad::get_pad_thread(); auto& handlers = handler->get_handlers(); if (auto it = handlers.find(pad_handler::move); it != handlers.end() && it->second) { @@ -3647,7 +3648,7 @@ error_code cellGemWriteExternalPort(u32 gem_num, vm::ptrGetPads(), pad_num(gem_num)); if (pad->m_pad_handler != pad_handler::move || !(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) diff --git a/rpcs3/Emu/Cell/Modules/cellPad.cpp b/rpcs3/Emu/Cell/Modules/cellPad.cpp index 771bb04a6e..74b3c5fc60 100644 --- a/rpcs3/Emu/Cell/Modules/cellPad.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPad.cpp @@ -196,7 +196,7 @@ bool cellPad_NotifyStateChange(usz index, u64 /*state*/, bool locked, bool is_bl return true; } - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = pads[index]; @@ -268,7 +268,7 @@ error_code cellPadInit(ppu_thread& ppu, u32 max_connect) config.port_setting.fill(CELL_PAD_SETTING_PRESS_OFF | CELL_PAD_SETTING_SENSOR_OFF); config.reported_info = {}; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); for (usz i = 0; i < config.get_max_connect(); ++i) @@ -336,7 +336,7 @@ error_code cellPadClearBuf(u32 port_no) if (port_no >= config.get_max_connect()) return CELL_PAD_ERROR_NO_DEVICE; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; @@ -351,7 +351,7 @@ error_code cellPadClearBuf(u32 port_no) void pad_get_data(u32 port_no, CellPadData* data, bool get_periph_data = false) { auto& config = g_fxo->get(); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = handler->GetPads()[port_no]; const PadInfo& rinfo = handler->GetInfo(); @@ -709,7 +709,7 @@ error_code cellPadGetData(u32 port_no, vm::ptr data) if (port_no >= config.get_max_connect()) return CELL_PAD_ERROR_NO_DEVICE; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; @@ -740,7 +740,7 @@ error_code cellPadPeriphGetInfo(vm::ptr info) if (!info) return CELL_PAD_ERROR_INVALID_PARAMETER; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const PadInfo& rinfo = handler->GetInfo(); std::memset(info.get_ptr(), 0, sizeof(CellPadPeriphInfo)); @@ -795,7 +795,7 @@ error_code cellPadPeriphGetData(u32 port_no, vm::ptr data) if (port_no >= config.get_max_connect()) return CELL_PAD_ERROR_NO_DEVICE; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; @@ -827,7 +827,7 @@ error_code cellPadGetRawData(u32 port_no, vm::ptr data) if (port_no >= config.get_max_connect()) return CELL_PAD_ERROR_NO_DEVICE; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; @@ -891,7 +891,7 @@ error_code cellPadSetActDirect(u32 port_no, vm::ptr param) if (port_no >= config.get_max_connect()) return CELL_PAD_ERROR_NO_DEVICE; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; @@ -923,7 +923,7 @@ error_code cellPadGetInfo(vm::ptr info) std::memset(info.get_ptr(), 0, sizeof(CellPadInfo)); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const PadInfo& rinfo = handler->GetInfo(); info->max_connect = config.max_connect; info->system_info = rinfo.system_info; @@ -968,7 +968,7 @@ error_code cellPadGetInfo2(vm::ptr info) std::memset(info.get_ptr(), 0, sizeof(CellPadInfo2)); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const PadInfo& rinfo = handler->GetInfo(); info->max_connect = config.get_max_connect(); // Here it is forcibly clamped info->system_info = rinfo.system_info; @@ -1018,7 +1018,7 @@ error_code cellPadGetCapabilityInfo(u32 port_no, vm::ptr if (port_no >= config.get_max_connect()) return CELL_PAD_ERROR_NO_DEVICE; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; @@ -1074,7 +1074,7 @@ error_code cellPadInfoPressMode(u32 port_no) if (port_no >= config.get_max_connect()) return CELL_PAD_ERROR_NO_DEVICE; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; @@ -1101,7 +1101,7 @@ error_code cellPadInfoSensorMode(u32 port_no) if (port_no >= config.get_max_connect()) return CELL_PAD_ERROR_NO_DEVICE; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; @@ -1129,7 +1129,7 @@ error_code cellPadSetPressMode(u32 port_no, u32 mode) if (port_no >= CELL_PAD_MAX_PORT_NUM) return CELL_OK; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; @@ -1163,7 +1163,7 @@ error_code cellPadSetSensorMode(u32 port_no, u32 mode) if (port_no >= CELL_PAD_MAX_PORT_NUM) return CELL_OK; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = pads[port_no]; @@ -1190,7 +1190,7 @@ error_code cellPadLddRegisterController() if (!config.max_connect) return CELL_PAD_ERROR_UNINITIALIZED; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const s32 handle = handler->AddLddPad(); @@ -1215,7 +1215,7 @@ error_code cellPadLddDataInsert(s32 handle, vm::ptr data) if (!config.max_connect) return CELL_PAD_ERROR_UNINITIALIZED; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); auto& pads = handler->GetPads(); if (handle < 0 || static_cast(handle) >= pads.size() || !data) // data == NULL stalls on decr @@ -1240,7 +1240,7 @@ error_code cellPadLddGetPortNo(s32 handle) if (!config.max_connect) return CELL_PAD_ERROR_UNINITIALIZED; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); auto& pads = handler->GetPads(); if (handle < 0 || static_cast(handle) >= pads.size()) @@ -1264,7 +1264,7 @@ error_code cellPadLddUnregisterController(s32 handle) if (!config.max_connect) return CELL_PAD_ERROR_UNINITIALIZED; - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); if (handle < 0 || static_cast(handle) >= pads.size()) diff --git a/rpcs3/Emu/Io/Buzz.cpp b/rpcs3/Emu/Io/Buzz.cpp index 108bdec0ab..575c5585b1 100644 --- a/rpcs3/Emu/Io/Buzz.cpp +++ b/rpcs3/Emu/Io/Buzz.cpp @@ -146,7 +146,7 @@ void usb_device_buzz::interrupt_transfer(u32 buf_size, u8* buf, u32 /*endpoint*/ } std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); ensure(pads.size() > m_last_controller); ensure(g_cfg_buzz.players.size() > m_last_controller); diff --git a/rpcs3/Emu/Io/GHLtar.cpp b/rpcs3/Emu/Io/GHLtar.cpp index d6fe87e9fc..db60cccd5b 100644 --- a/rpcs3/Emu/Io/GHLtar.cpp +++ b/rpcs3/Emu/Io/GHLtar.cpp @@ -138,7 +138,7 @@ void usb_device_ghltar::interrupt_transfer(u32 buf_size, u8* buf, u32 /*endpoint } std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pad = ::at32(handler->GetPads(), m_controller_index); if (!(pad->m_port_status & CELL_PAD_STATUS_CONNECTED)) diff --git a/rpcs3/Emu/Io/GameTablet.cpp b/rpcs3/Emu/Io/GameTablet.cpp index 56286a8bff..31ed81f3af 100644 --- a/rpcs3/Emu/Io/GameTablet.cpp +++ b/rpcs3/Emu/Io/GameTablet.cpp @@ -195,7 +195,7 @@ void usb_device_gametablet::interrupt_transfer(u32 buf_size, u8* buf, u32 /*endp { std::lock_guard lock(pad::g_pad_mutex); - const auto gamepad_handler = pad::get_current_handler(); + const auto gamepad_handler = pad::get_pad_thread(); const auto& pads = gamepad_handler->GetPads(); const auto& pad = ::at32(pads, m_controller_index); if (pad->m_port_status & CELL_PAD_STATUS_CONNECTED) diff --git a/rpcs3/Emu/Io/GunCon3.cpp b/rpcs3/Emu/Io/GunCon3.cpp index 7eef591ecc..d229693907 100644 --- a/rpcs3/Emu/Io/GunCon3.cpp +++ b/rpcs3/Emu/Io/GunCon3.cpp @@ -255,7 +255,7 @@ void usb_device_guncon3::interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint, { std::lock_guard lock(pad::g_pad_mutex); - const auto gamepad_handler = pad::get_current_handler(); + const auto gamepad_handler = pad::get_pad_thread(); const auto& pads = gamepad_handler->GetPads(); const auto& pad = ::at32(pads, m_controller_index); if (pad->m_port_status & CELL_PAD_STATUS_CONNECTED) diff --git a/rpcs3/Emu/Io/TopShotElite.cpp b/rpcs3/Emu/Io/TopShotElite.cpp index b170027a9f..06cddab9f0 100644 --- a/rpcs3/Emu/Io/TopShotElite.cpp +++ b/rpcs3/Emu/Io/TopShotElite.cpp @@ -315,7 +315,7 @@ void usb_device_topshotelite::interrupt_transfer(u32 buf_size, u8* buf, u32 /*en { std::lock_guard lock(pad::g_pad_mutex); - const auto gamepad_handler = pad::get_current_handler(); + const auto gamepad_handler = pad::get_pad_thread(); const auto& pads = gamepad_handler->GetPads(); const auto& pad = ::at32(pads, m_controller_index); if (pad->m_port_status & CELL_PAD_STATUS_CONNECTED) diff --git a/rpcs3/Emu/Io/TopShotFearmaster.cpp b/rpcs3/Emu/Io/TopShotFearmaster.cpp index aba831fa9c..98b54700d9 100644 --- a/rpcs3/Emu/Io/TopShotFearmaster.cpp +++ b/rpcs3/Emu/Io/TopShotFearmaster.cpp @@ -339,7 +339,7 @@ void usb_device_topshotfearmaster::interrupt_transfer(u32 buf_size, u8* buf, u32 { std::lock_guard lock(pad::g_pad_mutex); - const auto gamepad_handler = pad::get_current_handler(); + const auto gamepad_handler = pad::get_pad_thread(); const auto& pads = gamepad_handler->GetPads(); const auto& pad = ::at32(pads, m_controller_index); if (pad->m_port_status & CELL_PAD_STATUS_CONNECTED) diff --git a/rpcs3/Emu/Io/Turntable.cpp b/rpcs3/Emu/Io/Turntable.cpp index 63bb815a1d..0ef979725e 100644 --- a/rpcs3/Emu/Io/Turntable.cpp +++ b/rpcs3/Emu/Io/Turntable.cpp @@ -151,7 +151,7 @@ void usb_device_turntable::interrupt_transfer(u32 buf_size, u8* buf, u32 /*endpo // All other bufs are always 0x00 std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const auto& pads = handler->GetPads(); const auto& pad = ::at32(pads, m_controller_index); diff --git a/rpcs3/Emu/Io/usio.cpp b/rpcs3/Emu/Io/usio.cpp index faecec177d..077f6c7d62 100644 --- a/rpcs3/Emu/Io/usio.cpp +++ b/rpcs3/Emu/Io/usio.cpp @@ -189,7 +189,7 @@ void usb_device_usio::save_backup() void usb_device_usio::translate_input_taiko() { std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); std::vector input_buf(0x60); constexpr le_t c_hit = 0x1800; @@ -273,7 +273,7 @@ void usb_device_usio::translate_input_taiko() void usb_device_usio::translate_input_tekken() { std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); std::vector input_buf(0x180); le_t digital_input[2]{}; diff --git a/rpcs3/Emu/RSX/Overlays/overlays.cpp b/rpcs3/Emu/RSX/Overlays/overlays.cpp index e118b3a68c..a1fe40d8ce 100644 --- a/rpcs3/Emu/RSX/Overlays/overlays.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlays.cpp @@ -193,7 +193,7 @@ namespace rsx // Get gamepad input std::lock_guard lock(pad::g_pad_mutex); - const auto handler = pad::get_current_handler(); + const auto handler = pad::get_pad_thread(); const PadInfo& rinfo = handler->GetInfo(); const bool ignore_gamepad_input = (!rinfo.now_connect || !input::g_pads_intercepted); diff --git a/rpcs3/Input/pad_thread.cpp b/rpcs3/Input/pad_thread.cpp index 0c207d6595..70f0e25618 100644 --- a/rpcs3/Input/pad_thread.cpp +++ b/rpcs3/Input/pad_thread.cpp @@ -37,7 +37,7 @@ extern std::string g_input_config_override; namespace pad { - atomic_t g_current = nullptr; + atomic_t g_pad_thread = nullptr; shared_mutex g_pad_mutex; std::string g_title_id; atomic_t g_started{false}; @@ -62,13 +62,13 @@ struct pad_setting pad_thread::pad_thread(void* curthread, void* curwindow, std::string_view title_id) : m_curthread(curthread), m_curwindow(curwindow) { pad::g_title_id = title_id; - pad::g_current = this; + pad::g_pad_thread = this; pad::g_started = false; } pad_thread::~pad_thread() { - pad::g_current = nullptr; + pad::g_pad_thread = nullptr; } void pad_thread::Init() diff --git a/rpcs3/Input/pad_thread.h b/rpcs3/Input/pad_thread.h index fe9fa015c5..1939ce0104 100644 --- a/rpcs3/Input/pad_thread.h +++ b/rpcs3/Input/pad_thread.h @@ -70,7 +70,7 @@ private: namespace pad { - extern atomic_t g_current; + extern atomic_t g_pad_thread; extern shared_mutex g_pad_mutex; extern std::string g_title_id; extern atomic_t g_enabled; @@ -78,14 +78,14 @@ namespace pad extern atomic_t g_started; extern atomic_t g_home_menu_requested; - static inline class pad_thread* get_current_handler(bool relaxed = false) + static inline class pad_thread* get_pad_thread(bool relaxed = false) { if (relaxed) { - return g_current.observe(); + return g_pad_thread.observe(); } - return ensure(g_current.load()); + return ensure(g_pad_thread.load()); } static inline void set_enabled(bool enabled) @@ -102,7 +102,7 @@ namespace pad static inline void SetIntercepted(bool intercepted) { std::lock_guard lock(g_pad_mutex); - const auto handler = get_current_handler(); + const auto handler = get_pad_thread(); handler->SetIntercepted(intercepted); } } diff --git a/rpcs3/rpcs3qt/pad_settings_dialog.cpp b/rpcs3/rpcs3qt/pad_settings_dialog.cpp index 01904e5048..2a2194d1b6 100644 --- a/rpcs3/rpcs3qt/pad_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/pad_settings_dialog.cpp @@ -2017,7 +2017,7 @@ bool pad_settings_dialog::GetIsLddPad(u32 index) const if (!Emu.IsStopped() && (m_title_id.empty() || m_title_id == Emu.GetTitleID())) { std::lock_guard lock(pad::g_pad_mutex); - if (const auto handler = pad::get_current_handler(true)) + if (const auto handler = pad::get_pad_thread(true)) { ensure(index < handler->GetPads().size());