From 646ad3eed486ba719491e0e53359d8e9fabec7ed Mon Sep 17 00:00:00 2001 From: Eladash Date: Sat, 30 Oct 2021 19:07:14 +0300 Subject: [PATCH] SPU DisAsm: Force decimal point insertion for constant floats --- rpcs3/Emu/Cell/PPUDisAsm.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rpcs3/Emu/Cell/PPUDisAsm.cpp b/rpcs3/Emu/Cell/PPUDisAsm.cpp index ab4ed932a3..8fa48eee8e 100644 --- a/rpcs3/Emu/Cell/PPUDisAsm.cpp +++ b/rpcs3/Emu/Cell/PPUDisAsm.cpp @@ -356,7 +356,15 @@ void comment_constant(std::string& last_opcode, u64 value, bool print_float = fa if (std::isfinite(float_val)) { + const usz old_size = last_opcode.size(); + fmt::append(last_opcode, " (%.6gf)", float_val); + + if (usz pos = last_opcode.find_first_of('.', old_size); pos == umax) + { + // No decimal point has been inserted, force insertion + last_opcode.insert(last_opcode.size() - 2, ".0"sv); + } } else {