mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
Fix pad_state_notify_state_change
This commit is contained in:
parent
2398e753bf
commit
e6f1e598a9
2 changed files with 10 additions and 3 deletions
|
@ -60,6 +60,7 @@ pad_info::pad_info(utils::serial& ar)
|
|||
, port_setting(ar)
|
||||
, reported_info(ar)
|
||||
{
|
||||
reported_info = {};
|
||||
sys_io_serialize(ar);
|
||||
}
|
||||
|
||||
|
@ -159,7 +160,7 @@ void cellPad_NotifyStateChange(usz index, u64 /*state*/)
|
|||
|
||||
extern void pad_state_notify_state_change(usz index, u32 state)
|
||||
{
|
||||
cellPad_NotifyStateChange(index, state);
|
||||
send_sys_io_connect_event(index, state);
|
||||
}
|
||||
|
||||
error_code cellPadInit(ppu_thread& ppu, u32 max_connect)
|
||||
|
|
|
@ -33,14 +33,14 @@ struct libio_sys_config
|
|||
extern void sys_io_serialize(utils::serial& ar)
|
||||
{
|
||||
// Do not assign a serialization tag for now, call it from cellPad serialization
|
||||
g_fxo->get<libio_sys_config>().save_or_load(ar);
|
||||
ensure(g_fxo->try_get<libio_sys_config>())->save_or_load(ar);
|
||||
}
|
||||
|
||||
extern void cellPad_NotifyStateChange(usz index, u64 state);
|
||||
|
||||
void config_event_entry(ppu_thread& ppu)
|
||||
{
|
||||
auto& cfg = g_fxo->get<libio_sys_config>();
|
||||
auto& cfg = *ensure(g_fxo->try_get<libio_sys_config>());
|
||||
|
||||
if (!ppu.loaded_from_savestate)
|
||||
{
|
||||
|
@ -106,6 +106,12 @@ std::unique_lock<shared_mutex> lock_lv2_mutex_alike(shared_mutex& mtx, ppu_threa
|
|||
|
||||
extern void send_sys_io_connect_event(usz index, u32 state)
|
||||
{
|
||||
if (Emu.IsStarting() || Emu.IsReady())
|
||||
{
|
||||
cellPad_NotifyStateChange(index, state);
|
||||
return;
|
||||
}
|
||||
|
||||
auto& cfg = g_fxo->get<libio_sys_config>();
|
||||
|
||||
auto lock = lock_lv2_mutex_alike(cfg.mtx, cpu_thread::get_current<ppu_thread>());
|
||||
|
|
Loading…
Add table
Reference in a new issue