aboutsummaryrefslogtreecommitdiff
path: root/src/ARMInterpreter_ALU.cpp
diff options
context:
space:
mode:
authorRSDuck <RSDuck@users.noreply.github.com>2023-01-06 20:17:04 +0100
committerRSDuck <RSDuck@users.noreply.github.com>2023-01-06 20:17:04 +0100
commit8ec8a6ce09923a4bc721f7935cd6b16ad775a983 (patch)
tree08376282766fac8cae44d6e100621c90c6bfd2f0 /src/ARMInterpreter_ALU.cpp
parenteadfeec7abca813ff3c55fcf0fbf5b8fe2938730 (diff)
ehhh got that one wrong, now it should be right
Diffstat (limited to 'src/ARMInterpreter_ALU.cpp')
-rw-r--r--src/ARMInterpreter_ALU.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ARMInterpreter_ALU.cpp b/src/ARMInterpreter_ALU.cpp
index af9c340..95b6f37 100644
--- a/src/ARMInterpreter_ALU.cpp
+++ b/src/ARMInterpreter_ALU.cpp
@@ -46,16 +46,16 @@ inline bool OverflowSub(u32 a, u32 b)
inline bool OverflowAdc(u32 a, u32 b, u32 carry)
{
- s64 fullResult = (s64)(s32)(a) + (s64)(s32)b + carry;
+ s64 fullResult = (s64)(s32)a + (s32)b + carry;
u32 res = a + b + carry;
- return (res & 0x80000000) != ((u32)fullResult & 0x80000000);
+ return (s32)res != fullResult;
}
inline bool OverflowSbc(u32 a, u32 b, u32 carry)
{
- s64 fullResult = (s64)(s32)(a) - (s64)(s32)b - carry;
+ s64 fullResult = (s64)(s32)a - (s32)b - carry;
u32 res = a - b - carry;
- return (res & 0x80000000) != ((u32)fullResult & 0x80000000);
+ return (s32)res != fullResult;
}
#define LSL_IMM(x, s) \