diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index ffc31b11ec..d1d4ca3fc7 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -2438,11 +2438,6 @@ void ppu_thread::serialize_common(utils::serial& ar) fmt::throw_exception("Failed to serialize PPU thread ID=0x%x (cia=0x%x, ar=%s)", this->id, cia, ar); } - if (ar.is_writing()) - { - ppu_log.notice("Saving PPU Thread [0x%x: %s]: cia=0x%x, state=%s", id, *ppu_tname.load(), cia, +state); - } - ar(optional_savestate_state, vr); if (!ar.is_writing()) @@ -2514,7 +2509,9 @@ ppu_thread::ppu_thread(utils::serial& ar) } }; - switch (const u32 status = ar.pop()) + const u32 status = ar.pop(); + + switch (status) { case PPU_THREAD_STATUS_IDLE: { @@ -2645,11 +2642,14 @@ ppu_thread::ppu_thread(utils::serial& ar) ppu_tname = make_single(ar.pop()); - ppu_log.notice("Loading PPU Thread [0x%x: %s]: cia=0x%x, state=%s", id, *ppu_tname.load(), cia, +state); + ppu_log.notice("Loading PPU Thread [0x%x: %s]: cia=0x%x, state=%s, status=%s", id, *ppu_tname.load(), cia, +state, ppu_thread_status{status}); } void ppu_thread::save(utils::serial& ar) { + // For debugging purposes, load this as soon as this function enters + const bs_t state_flags = state; + USING_SERIALIZATION_VERSION(ppu); const u64 entry = std::bit_cast(entry_func); @@ -2699,6 +2699,15 @@ void ppu_thread::save(utils::serial& ar) } ar(*ppu_tname.load()); + + if (current_module && current_module[0]) + { + ppu_log.notice("Saving PPU Thread [0x%x: %s]: cia=0x%x, state=%s, statu=%s (at function: %s)", id, *ppu_tname.load(), cia, state_flags, ppu_thread_status{status}, last_function); + } + else + { + ppu_log.notice("Saving PPU Thread [0x%x: %s]: cia=0x%x, state=%s, statu=%s", id, *ppu_tname.load(), cia, state_flags, ppu_thread_status{status}); + } } ppu_thread::thread_name_t::operator std::string() const diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 57ffc0e11f..703c762ae0 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -961,7 +961,7 @@ namespace rsx } // Wait for startup (TODO) - while (!rsx_thread_running || Emu.IsPaused()) + while (!rsx_thread_running || Emu.IsPausedOrReady()) { // Execute backend-local tasks first do_local_task(performance_counters.state); diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 21785a32be..7d60f57cdc 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -3038,6 +3038,11 @@ void Emulator::Kill(bool allow_autoexit, bool savestate, savestate_stage* save_s if (!IsStopped() && savestate) { + if (IsStarting()) + { + return; + } + if (!save_stage || !save_stage->prepared) { if (m_emu_state_close_pending.exchange(true))