Skip to content

Commit

Permalink
ehhh got that one wrong, now it should be right
Browse files Browse the repository at this point in the history
  • Loading branch information
RSDuck committed Jan 6, 2023
1 parent eadfeec commit 8ec8a6c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ARMInterpreter_ALU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 8ec8a6c

Please sign in to comment.