Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
smurf3tte committed Dec 5, 2020
1 parent 9ea0e22 commit c3741c6
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions Source/Core/Core/PatchEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,34 +200,16 @@ static void ApplyPatches(const std::vector<Patch>& patches)
switch (entry.type)
{
case PatchType::Patch8Bit:
if (entry.conditional)
{
if (PowerPC::HostRead_U8(addr) != static_cast<u8>(comparand))
{
break;
}
}
PowerPC::HostWrite_U8(static_cast<u8>(value), addr);
if (!entry.conditional || PowerPC::HostRead_U8(addr) == static_cast<u8>(comparand))
PowerPC::HostWrite_U8(static_cast<u8>(value), addr);
break;
case PatchType::Patch16Bit:
if (entry.conditional)
{
if (PowerPC::HostRead_U16(addr) != static_cast<u16>(comparand))
{
break;
}
}
PowerPC::HostWrite_U16(static_cast<u16>(value), addr);
if (!entry.conditional || PowerPC::HostRead_U16(addr) == static_cast<u16>(comparand))
PowerPC::HostWrite_U16(static_cast<u16>(value), addr);
break;
case PatchType::Patch32Bit:
if (entry.conditional)
{
if (PowerPC::HostRead_U32(addr) != comparand)
{
break;
}
}
PowerPC::HostWrite_U32(value, addr);
if (!entry.conditional || PowerPC::HostRead_U32(addr) == comparand)
PowerPC::HostWrite_U32(value, addr);
break;
default:
// unknown patchtype
Expand Down

0 comments on commit c3741c6

Please sign in to comment.