diff --git a/Processors/68000Mk2/68000Mk2.hpp b/Processors/68000Mk2/68000Mk2.hpp index 5defa8eac..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,21 +229,18 @@ 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), value->b}; + const uint8_t values[] = { uint8_t(value->w >> 8), value->b}; return values[operation & SelectByte]; } /*! - @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; } /*! @@ -394,6 +391,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_); } @@ -1183,7 +1185,7 @@ void Processor::min();