Skip to content

Commit

Permalink
SPU MFC: Implement MFC commands execution shuffling
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Sep 10, 2021
1 parent f98595b commit d8f9d3d
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 75 deletions.
5 changes: 5 additions & 0 deletions rpcs3/Emu/CPU/CPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,11 @@ void cpu_thread::cpu_wait(bs_t<cpu_flag> old)

bool cpu_thread::check_state() noexcept
{
if (state & cpu_flag::pending)
{
cpu_work();
}

bool cpu_sleep_called = false;
bool cpu_can_stop = true;
bool escape, retval;
Expand Down
4 changes: 4 additions & 0 deletions rpcs3/Emu/CPU/CPUThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ enum class cpu_flag : u32
ret, // Callback return requested
signal, // Thread received a signal (HLE)
memory, // Thread must unlock memory mutex
pending, // Thread has postponed work

dbg_global_pause, // Emulation paused
dbg_pause, // Thread paused
Expand Down Expand Up @@ -169,6 +170,9 @@ class cpu_thread
// Callback for cpu_flag::suspend
virtual void cpu_sleep() {}

// Callback for cpu_flag::pending
virtual void cpu_work() {}

// Callback for cpu_flag::ret
virtual void cpu_return() {}

Expand Down
5 changes: 4 additions & 1 deletion rpcs3/Emu/Cell/SPUInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ void spu_interpreter::set_interrupt_status(spu_thread& spu, spu_opcode_t op)
spu.set_interrupt_status(false);
}

spu.check_mfc_interrupts(spu.pc);
if (spu.check_mfc_interrupts(spu.pc) && spu.state & cpu_flag::pending)
{
spu.do_mfc();
}
}


Expand Down

0 comments on commit d8f9d3d

Please sign in to comment.