diff --git a/rpcs3/Emu/Cell/Modules/cellPad.cpp b/rpcs3/Emu/Cell/Modules/cellPad.cpp index f0063b2168..1da0a47206 100644 --- a/rpcs3/Emu/Cell/Modules/cellPad.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPad.cpp @@ -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) diff --git a/rpcs3/Emu/Cell/Modules/sys_io_.cpp b/rpcs3/Emu/Cell/Modules/sys_io_.cpp index 814b8b61b9..7156fd7485 100644 --- a/rpcs3/Emu/Cell/Modules/sys_io_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_io_.cpp @@ -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().save_or_load(ar); + ensure(g_fxo->try_get())->save_or_load(ar); } extern void cellPad_NotifyStateChange(usz index, u64 state); void config_event_entry(ppu_thread& ppu) { - auto& cfg = g_fxo->get(); + auto& cfg = *ensure(g_fxo->try_get()); if (!ppu.loaded_from_savestate) { @@ -106,6 +106,12 @@ std::unique_lock 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(); auto lock = lock_lv2_mutex_alike(cfg.mtx, cpu_thread::get_current());