diff --git a/src/arm7tdmi/alu.rs b/src/arm7tdmi/alu.rs index 4598a85..7ab9ead 100644 --- a/src/arm7tdmi/alu.rs +++ b/src/arm7tdmi/alu.rs @@ -201,7 +201,7 @@ impl Core { fn alu_sub_flags(a: i32, b: i32, carry: &mut bool, overflow: &mut bool) -> i32 { let res = a.wrapping_sub(b); - *carry = res > a; + *carry = b <= a; let (_, would_overflow) = a.overflowing_sub(b); *overflow = would_overflow; res