Skip to content
Permalink
Browse files

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.
  • Loading branch information...
lioncash committed Jun 16, 2019
1 parent 0cde8ab commit d8c3f09c9fcf2f152a4cf6977ab3385092877187
Showing with 3 additions and 3 deletions.
  1. +3 −3 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<char>('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;
}

0 comments on commit d8c3f09

Please sign in to comment.
You can’t perform that action at this time.