From 4c068e9bb874f52892433fe0082f73e57c983210 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 15 Dec 2019 14:40:55 -0500 Subject: [PATCH] Corrects flags on CMPA.w. --- Processors/68000/Implementation/68000Implementation.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Processors/68000/Implementation/68000Implementation.hpp b/Processors/68000/Implementation/68000Implementation.hpp index 7d240db46..001f3e138 100644 --- a/Processors/68000/Implementation/68000Implementation.hpp +++ b/Processors/68000/Implementation/68000Implementation.hpp @@ -797,7 +797,7 @@ template void Proces case Operation::CMPAw: { const auto source = uint64_t(u_extend16(source()->halves.low.full)); - const auto destination = uint64_t(u_extend16(destination()->halves.low.full)); + const uint64_t destination = destination()->full; const auto result = destination - source; zero_result_ = uint32_t(result); @@ -1541,7 +1541,7 @@ template void Proces extend_flag_ = carry_flag_ = decltype(carry_flag_)(result & ~0xff); \ negative_flag_ = result & 0x80; \ const int unadjusted_result = destination - source - (extend_flag_ ? 1 : 0); \ - overflow_flag_ = unadjusted_result &~ result & 0x80; \ + overflow_flag_ = unadjusted_result & (~result) & 0x80; \ \ /* Store the result. */ \ destination()->halves.low.halves.low = uint8_t(result);