From bd61c72007c96d22a5c18c598be1f003f45fe62c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 12 May 2022 07:22:26 -0400 Subject: [PATCH] Mutate SBCD to correct values, though not yet statuses. --- InstructionSets/M68k/Implementation/PerformImplementation.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InstructionSets/M68k/Implementation/PerformImplementation.hpp b/InstructionSets/M68k/Implementation/PerformImplementation.hpp index 0dddd7077..77c1d751e 100644 --- a/InstructionSets/M68k/Implementation/PerformImplementation.hpp +++ b/InstructionSets/M68k/Implementation/PerformImplementation.hpp @@ -794,7 +794,7 @@ template < if(result & 0xf0) result -= 0x06; \ result += (destination & 0xf0) - (source & 0xf0); \ status.extend_flag_ = status.carry_flag_ = decltype(status.carry_flag_)((result & 0xff) > 0x9f); \ - if(status.carry_flag_) result -= 0x60; \ + if(unadjusted_result & 0x100) result -= 0x60; \ \ /* Set all flags essentially as if this were normal subtraction. */ \ status.zero_result_ |= result & 0xff; \