diff --git a/rpcs3/Emu/Cell/PPUFunction.h b/rpcs3/Emu/Cell/PPUFunction.h index ec58e4b60b..0246038593 100644 --- a/rpcs3/Emu/Cell/PPUFunction.h +++ b/rpcs3/Emu/Cell/PPUFunction.h @@ -9,7 +9,7 @@ using ppu_function_t = bool(*)(ppu_thread&); const auto old_f = ppu.current_function;\ if (!old_f) ppu.last_function = #func;\ ppu.current_function = #func;\ - ppu.syscall_r3 = ppu.gpr[3];\ + std::memcpy(ppu.syscall_args, ppu.gpr + 3, sizeof(ppu.syscall_args)); \ ppu_func_detail::do_call(ppu, func);\ ppu.current_function = old_f;\ ppu.cia += 4;\ diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index e7e8e8341e..8b037a8e7f 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -432,7 +432,9 @@ std::string ppu_thread::dump() const ret += "Current function: "; ret += _func; ret += '\n'; - fmt::append(ret, "syscall r3: 0x%llx\n", syscall_r3); + + for (u32 i = 3; i <= 6; i++) + fmt::append(ret, " ** GPR[%d] = 0x%llx\n", i, syscall_args[i - 3]); } else if (is_paused()) { diff --git a/rpcs3/Emu/Cell/PPUThread.h b/rpcs3/Emu/Cell/PPUThread.h index ce134e3db7..8ea091df1d 100644 --- a/rpcs3/Emu/Cell/PPUThread.h +++ b/rpcs3/Emu/Cell/PPUThread.h @@ -189,7 +189,7 @@ public: cmd64 cmd_get(u32 index) { return cmd_queue[cmd_queue.peek() + index].load(); } u64 start_time{0}; // Sleep start timepoint - u64 syscall_r3{0}; // Save r3 before syscalls + alignas(64) u64 syscall_args[4]{0}; // Last syscall arguments stored const char* current_function{}; // Current function name for diagnosis, optimized for speed. const char* last_function{}; // Sticky copy of current_function, is not cleared on function return