mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
Savestates/SPU: Kill emulation when its safe to save SPU state
This commit is contained in:
parent
105781fa76
commit
3e51426379
7 changed files with 114 additions and 18 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include "lv2/sys_prx.h"
|
||||
#include "lv2/sys_overlay.h"
|
||||
#include "lv2/sys_process.h"
|
||||
#include "lv2/sys_spu.h"
|
||||
|
||||
#ifdef LLVM_AVAILABLE
|
||||
#ifdef _MSC_VER
|
||||
|
|
@ -1400,6 +1401,21 @@ void ppu_thread::cpu_task()
|
|||
// (the farther it's postponed, the less accuracy of guest time has been lost)
|
||||
Emu.FixGuestTime();
|
||||
|
||||
// Run SPUs waiting on a syscall (savestates related)
|
||||
idm::select<named_thread<spu_thread>>([&](u32, named_thread<spu_thread>& spu)
|
||||
{
|
||||
if (spu.group && spu.index == spu.group->waiter_spu_index)
|
||||
{
|
||||
if (std::exchange(spu.stop_flag_removal_protection, false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ensure(spu.state.test_and_reset(cpu_flag::stop));
|
||||
spu.state.notify_one(cpu_flag::stop);
|
||||
}
|
||||
});
|
||||
|
||||
// Check if this is the only PPU left to initialize (savestates related)
|
||||
if (lv2_obj::is_scheduler_ready())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue