From 98a8eeaac25a12722fc7f236c59dc6dd372d620c Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 20 Jan 2020 23:40:10 +0300 Subject: [PATCH] SPU: properly support STOP 0x0 instruction --- rpcs3/Emu/Cell/SPURecompiler.cpp | 6 ++++++ rpcs3/Emu/Cell/SPUThread.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index 2f1a6d3a67..549ce2c184 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -1076,6 +1076,12 @@ void spu_recompiler_base::dispatch(spu_thread& spu, void*, u8* rip) spu.jit->init(); // Compile + if (spu._ref(spu.pc) == 0) + { + spu_runtime::g_escape(&spu); + return; + } + const auto func = spu.jit->compile(spu.jit->analyse(spu._ptr(0), spu.pc)); if (!func) diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index 7aa762db5a..12727574f8 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -1148,6 +1148,12 @@ void spu_thread::cpu_task() break; } + if (_ref(pc) == 0x0) + { + spu_thread::stop_and_signal(0x0); + continue; + } + spu_runtime::g_gateway(*this, vm::_ptr(offset), nullptr); }