From d8c3f09c9fcf2f152a4cf6977ab3385092877187 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 16 Jun 2019 19:25:25 -0400 Subject: [PATCH] Common/GekkoDisassembler: Amend disassembly of operations expecting a character literal Due to the lack of cast here, this will actually print out the ascii value, rather than the character itself, due to promoting to integral values. Instead, we can eliminate the use of character operands and just print the value itself directly, given it's equivalent behavior with less code. --- Source/Core/Common/GekkoDisassembler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Common/GekkoDisassembler.cpp b/Source/Core/Common/GekkoDisassembler.cpp index c1cec303a1..2a77d9d985 100644 --- a/Source/Core/Common/GekkoDisassembler.cpp +++ b/Source/Core/Common/GekkoDisassembler.cpp @@ -504,7 +504,7 @@ void GekkoDisassembler::cmpi(u32 in, int uimm) i = (int)PPCGETCRD(in); if (i != 0) { - m_operands += fmt::format("cr{}, ", '0' + i); + m_operands += fmt::format("cr{}, ", i); } m_operands += imm(in, uimm, 2, false); @@ -716,7 +716,7 @@ void GekkoDisassembler::cmp(u32 in) i = (int)PPCGETCRD(in); if (i != 0) - m_operands += fmt::format("cr{},", static_cast('0' + i)); + m_operands += fmt::format("cr{},", i); m_operands += ra_rb(in); } @@ -1220,7 +1220,7 @@ void GekkoDisassembler::ps(u32 inst) int i = (int)PPCGETCRD(inst); if (i != 0) - m_operands += fmt::format("cr{}, ", '0' + i); + m_operands += fmt::format("cr{}, ", i); m_operands += fmt::format("p{}, p{}", FA, FB); return; }