From d8ed8b66f31a23f2d1efae3a0c366cebf9817aa5 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 6 May 2019 21:14:16 -0400 Subject: [PATCH] Improves carry/extend for ROXL and ROXR. --- Processors/68000/Implementation/68000Implementation.hpp | 4 ++-- Processors/68000/Implementation/68000Storage.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Processors/68000/Implementation/68000Implementation.hpp b/Processors/68000/Implementation/68000Implementation.hpp index aad053925..bd84fb09e 100644 --- a/Processors/68000/Implementation/68000Implementation.hpp +++ b/Processors/68000/Implementation/68000Implementation.hpp @@ -1654,7 +1654,7 @@ template void Proces (value << shift_count) | \ (value >> (size + 1 - shift_count)) | \ ((extend_flag_ ? (1 << (size - 1)) : 0) >> (size - shift_count)); \ - carry_flag_ = extend_flag_ = destination & 1; \ + carry_flag_ = extend_flag_ = (value >> (size - shift_count))&1; \ } \ \ set_neg_zero_overflow(destination, 1 << (size - 1)); \ @@ -1683,7 +1683,7 @@ template void Proces (value >> shift_count) | \ (value << (size + 1 - shift_count)) | \ ((extend_flag_ ? 1 : 0) << (size - shift_count)); \ - carry_flag_ = extend_flag_ = destination & 1; \ + carry_flag_ = extend_flag_ = value & (1 << shift_count); \ } \ \ set_neg_zero_overflow(destination, 1 << (size - 1)); \ diff --git a/Processors/68000/Implementation/68000Storage.cpp b/Processors/68000/Implementation/68000Storage.cpp index 4dfd44d0a..899db06f9 100644 --- a/Processors/68000/Implementation/68000Storage.cpp +++ b/Processors/68000/Implementation/68000Storage.cpp @@ -1798,7 +1798,7 @@ struct ProcessorStorageConstructor { op(Action::PerformOperation, is_bclr ? seq("nw", { a(ea_register) }, false) : nullptr); break; - case XXXw: // BTST.b #, (xxx).w + case XXXw: // BTST.b #, (xxx).w case d16An: // BTST.b #, (d16, An) case d8AnXn: // BTST.b #, (d8, An, Xn) case d16PC: // BTST.b #, (d16, PC)