Skip to content

Commit

Permalink
PPU: Sleep after returning from thread entry function
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Jun 6, 2023
1 parent fb0375d commit 7ccb66e
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions rpcs3/Emu/Cell/PPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2055,12 +2055,7 @@ void ppu_thread::fast_call(u32 addr, u64 rtoc)

auto at_ret = [&]()
{
if (std::uncaught_exceptions())
{
cpu_on_stop();
current_function = old_func;
}
else if (old_cia)
if (old_cia)
{
if (state & cpu_flag::again)
{
Expand All @@ -2071,6 +2066,18 @@ void ppu_thread::fast_call(u32 addr, u64 rtoc)
gpr[2] = old_rtoc;
lr = old_lr;
}
else if (state & cpu_flag::ret && cia == g_fxo->get<ppu_function_manager>().func_addr(1, true) + 4)
{
std::string ret;
dump_all(ret);

ppu_log.error("Returning from the thread entry function! (func=0x%x)", entry_func.addr);
ppu_log.notice("Thread context: %s", ret);

lv2_obj::sleep(*this);

state += cpu_flag::again; // For savestates
}

current_function = old_func;
g_tls_log_prefix = old_fmt;
Expand Down

0 comments on commit 7ccb66e

Please sign in to comment.