diff --git a/Machines/Amiga/Blitter.cpp b/Machines/Amiga/Blitter.cpp index 361fbe94e..74df53d15 100644 --- a/Machines/Amiga/Blitter.cpp +++ b/Machines/Amiga/Blitter.cpp @@ -126,10 +126,6 @@ void Blitter::set_control(int index, uint16_t value) { fill_carry_ = (value & 0x0004); } else { minterms_ = value & 0xff; - channel_enables_[3] = value & 0x100; - channel_enables_[2] = value & 0x200; - channel_enables_[1] = value & 0x400; - channel_enables_[0] = value & 0x800; sequencer_.set_control(value >> 8); } shifts_[index] = value >> 12; @@ -221,10 +217,10 @@ uint16_t Blitter::get_status() { // Table 6-2: Typical Blitter Cycle Sequence void Blitter::add_modulos() { - pointer_[0] += modulos_[0] * channel_enables_[0] * direction_; - pointer_[1] += modulos_[1] * channel_enables_[1] * direction_; - pointer_[2] += modulos_[2] * channel_enables_[2] * direction_; - pointer_[3] += modulos_[3] * channel_enables_[3] * direction_; + pointer_[0] += modulos_[0] * sequencer_.channel_enabled<0>()* direction_; + pointer_[1] += modulos_[1] * sequencer_.channel_enabled<1>() * direction_; + pointer_[2] += modulos_[2] * sequencer_.channel_enabled<2>() * direction_; + pointer_[3] += modulos_[3] * sequencer_.channel_enabled<3>() * direction_; } bool Blitter::advance_dma() { diff --git a/Machines/Amiga/Blitter.hpp b/Machines/Amiga/Blitter.hpp index 21a94a4c1..389c7b7dd 100644 --- a/Machines/Amiga/Blitter.hpp +++ b/Machines/Amiga/Blitter.hpp @@ -108,6 +108,10 @@ class BlitterSequencer { return std::make_pair(next, loop_); } + template bool channel_enabled() { + return control_ & (8 >> channel); + } + private: static constexpr std::array pattern0 = { Channel::None }; static constexpr std::array pattern1 = { Channel::Write, Channel::None }; @@ -199,8 +203,6 @@ class Blitter: public DMADevice<4, 4> { bool exclusive_fill_ = false; bool fill_carry_ = false; - bool channel_enables_[4]{}; - uint8_t minterms_ = 0; uint32_t a32_ = 0, b32_ = 0; uint16_t a_data_ = 0, b_data_ = 0, c_data_ = 0;