From 62fa0991eda8191824e1366a9d5da4436f86dabd Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 15 Jun 2022 12:59:03 -0400 Subject: [PATCH 1/4] Disallow copying, add some basic asserts. --- Processors/68000Mk2/68000Mk2.hpp | 2 ++ Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp | 2 ++ Processors/68000Mk2/Implementation/68000Mk2Storage.hpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/Processors/68000Mk2/68000Mk2.hpp b/Processors/68000Mk2/68000Mk2.hpp index 5defa8eac..b3f4617af 100644 --- a/Processors/68000Mk2/68000Mk2.hpp +++ b/Processors/68000Mk2/68000Mk2.hpp @@ -394,6 +394,8 @@ template = 0 && next_operand_ < 2); if(!(operand_flags_ & (1 << next_operand_))) { MoveToStateDynamic(perform_state_); } @@ -1099,6 +1100,7 @@ void Processor= 0 && next_operand_ < 2); if(!(operand_flags_ & (1 << next_operand_))) { MoveToStateDynamic(perform_state_); } diff --git a/Processors/68000Mk2/Implementation/68000Mk2Storage.hpp b/Processors/68000Mk2/Implementation/68000Mk2Storage.hpp index 243c0c86b..95e0a7662 100644 --- a/Processors/68000Mk2/Implementation/68000Mk2Storage.hpp +++ b/Processors/68000Mk2/Implementation/68000Mk2Storage.hpp @@ -22,6 +22,8 @@ struct ProcessorBase: public InstructionSet::M68k::NullFlowController { ProcessorBase() { read_program_announce.address = read_program.address = &program_counter_.l; } + ProcessorBase(const ProcessorBase& rhs) = delete; + ProcessorBase& operator=(const ProcessorBase& rhs) = delete; int state_ = std::numeric_limits::min(); From 8ff09a1923cebcc76ab13cb2a570f2423cd970d9 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 15 Jun 2022 17:06:40 -0400 Subject: [PATCH 2/4] Fix `value8_high`. --- Processors/68000Mk2/68000Mk2.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Processors/68000Mk2/68000Mk2.hpp b/Processors/68000Mk2/68000Mk2.hpp index b3f4617af..fafba7f79 100644 --- a/Processors/68000Mk2/68000Mk2.hpp +++ b/Processors/68000Mk2/68000Mk2.hpp @@ -233,7 +233,7 @@ struct Microcycle { @c 0xff otherwise. Assumes this is a write cycle. */ forceinline uint8_t value8_high() const { - const uint8_t values[] = { uint8_t(value->w), value->b}; + const uint8_t values[] = { uint8_t(value->w >> 8), value->b}; return values[operation & SelectByte]; } From 12b058867eb7d2c4b68e54aab6104f3d8c8770f5 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 15 Jun 2022 17:06:56 -0400 Subject: [PATCH 3/4] Correct very minor typo. --- Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp index 2134522b2..9eef84cee 100644 --- a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp +++ b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp @@ -1185,7 +1185,7 @@ void Processor Date: Wed, 15 Jun 2022 21:11:31 -0400 Subject: [PATCH 4/4] Fix upper/lower_data_select; simplify value8_low. --- Processors/68000Mk2/68000Mk2.hpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Processors/68000Mk2/68000Mk2.hpp b/Processors/68000Mk2/68000Mk2.hpp index fafba7f79..3e43de1b8 100644 --- a/Processors/68000Mk2/68000Mk2.hpp +++ b/Processors/68000Mk2/68000Mk2.hpp @@ -175,17 +175,17 @@ struct Microcycle { } /*! - @returns non-zero if this is a byte read and 68000 LDS is asserted. + @returns non-zero if the 68000 LDS is asserted; zero otherwise. */ forceinline int lower_data_select() const { - return (operation & SelectByte) & ((*address & 1) << 3); + return ((operation & SelectByte) & (*address & 1)) | (operation & SelectWord); } /*! - @returns non-zero if this is a byte read and 68000 UDS is asserted. + @returns non-zero if the 68000 UDS is asserted; zero otherwise. */ forceinline int upper_data_select() const { - return (operation & SelectByte) & ~((*address & 1) << 3); + return ((operation & SelectByte) & ~(*address & 1)) | (operation & SelectWord); } /*! @@ -229,8 +229,7 @@ struct Microcycle { } /*! - @returns the value currently on the high 8 lines of the data bus if any; - @c 0xff otherwise. Assumes this is a write cycle. + @returns the value currently on the high 8 lines of the data bus. */ forceinline uint8_t value8_high() const { const uint8_t values[] = { uint8_t(value->w >> 8), value->b}; @@ -238,12 +237,10 @@ struct Microcycle { } /*! - @returns the value currently on the low 8 lines of the data bus if any; - @c 0xff otherwise. Assumes this is a write cycle. + @returns the value currently on the low 8 lines of the data bus. */ forceinline uint8_t value8_low() const { - const uint8_t values[] = { uint8_t(value->w), value->b}; - return values[operation & SelectByte]; + return value->b; } /*!