From 2f3142e1920dac6bad750934f842b3c1a7b08f00 Mon Sep 17 00:00:00 2001 From: B3N30 Date: Sun, 18 Nov 2018 14:37:11 +0100 Subject: [PATCH] Fix 16bit comparison operations --- src/core/cheats/gateway_cheat.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/cheats/gateway_cheat.cpp b/src/core/cheats/gateway_cheat.cpp index 18b15e747a..06fb414854 100644 --- a/src/core/cheats/gateway_cheat.cpp +++ b/src/core/cheats/gateway_cheat.cpp @@ -280,25 +280,25 @@ void GatewayCheat::Execute(Core::System& system) { case CheatType::GreaterThan16WithMask: // 7XXXXXXX ZZZZYYYY - Execute next block IF YYYY > ((not ZZZZ) AND half[XXXXXXX]) CompOp(line, state, &Memory::Read16, [&line](u16 val) -> bool { - return static_cast(line.value) > ~(static_cast(~line.value >> 16) & val); + return static_cast(line.value) > (static_cast(~line.value >> 16) & val); }); break; case CheatType::LessThan16WithMask: // 8XXXXXXX ZZZZYYYY - Execute next block IF YYYY < ((not ZZZZ) AND half[XXXXXXX]) CompOp(line, state, &Memory::Read16, [&line](u16 val) -> bool { - return static_cast(line.value) < ~(static_cast(~line.value >> 16) & val); + return static_cast(line.value) < (static_cast(~line.value >> 16) & val); }); break; case CheatType::EqualTo16WithMask: // 9XXXXXXX ZZZZYYYY - Execute next block IF YYYY = ((not ZZZZ) AND half[XXXXXXX]) CompOp(line, state, &Memory::Read16, [&line](u16 val) -> bool { - return static_cast(line.value) == ~(static_cast(~line.value >> 16) & val); + return static_cast(line.value) == (static_cast(~line.value >> 16) & val); }); break; case CheatType::NotEqualTo16WithMask: // AXXXXXXX ZZZZYYYY - Execute next block IF YYYY <> ((not ZZZZ) AND half[XXXXXXX]) CompOp(line, state, &Memory::Read16, [&line](u16 val) -> bool { - return static_cast(line.value) != ~(static_cast(~line.value >> 16) & val); + return static_cast(line.value) != (static_cast(~line.value >> 16) & val); }); break; case CheatType::LoadOffset: