From bda52a51a75f0235043fe3a109ba4bfc80a320a3 Mon Sep 17 00:00:00 2001 From: Elad Ashkenazi Date: Tue, 31 May 2022 08:36:10 +0300 Subject: [PATCH] Debugger: Show HEX view of floating-point PPU registers --- rpcs3/Emu/Cell/PPUThread.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index bca2bc9afb..000c9bf62b 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -932,7 +932,15 @@ std::string ppu_thread::dump_regs() const for (uint i = 0; i < 32; ++i) { - fmt::append(ret, "f%d%s: %.6G\n", i, i <= 9 ? " " : "", fpr[i]); + const f64 r = fpr[i]; + + if (!std::bit_cast(r)) + { + fmt::append(ret, "f%d%s: %-12.6G [%-18s] (f32=0x%x)\n", i, i <= 9 ? " " : "", r, "", std::bit_cast(f32(r))); + continue; + } + + fmt::append(ret, "f%d%s: %-12.6G [0x%016x] (f32=0x%x)\n", i, i <= 9 ? " " : "", r, std::bit_cast(r), std::bit_cast(f32(r))); } for (uint i = 0; i < 32; ++i, ret += '\n')