Skip to content

Commit

Permalink
dumpcodetofile bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvita committed Aug 11, 2020
1 parent e0a3458 commit 26932ce
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions source/guis/gui_cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5263,6 +5263,14 @@ bool GuiCheats::dumpcodetofile()
opcode = opcode * 16 + X;
}
}
if (opcode == 10)
{
u8 O = (m_cheats[i].definition.opcodes[j] >> 8) & 0xF;
if (O == 2 || O == 4 || O == 5)
T = 8;
else
T = 4;
}
switch (opcode)
{
case 0:
Expand All @@ -5274,10 +5282,12 @@ bool GuiCheats::dumpcodetofile()
// 2+1
ss << std::uppercase << std::hex << std::setfill('0') << std::setw(8) << m_cheats[i].definition.opcodes[j++] << " ";
case 3:
case 10:
// 1+1
ss << std::uppercase << std::hex << std::setfill('0') << std::setw(8) << m_cheats[i].definition.opcodes[j++] << " ";
if (T == 8 || (T == 1 && opcode == 3))
ss << std::uppercase << std::hex << std::setfill('0') << std::setw(8) << m_cheats[i].definition.opcodes[j] << " ";
if (T == 8 || (T == 0 && opcode == 3))
{
j++;
ss << std::uppercase << std::hex << std::setfill('0') << std::setw(8) << m_cheats[i].definition.opcodes[j] << " ";
}
break;
Expand Down

0 comments on commit 26932ce

Please sign in to comment.