diff --git a/Machines/Amiga/Blitter.cpp b/Machines/Amiga/Blitter.cpp index e164b9407..361fbe94e 100644 --- a/Machines/Amiga/Blitter.cpp +++ b/Machines/Amiga/Blitter.cpp @@ -220,6 +220,13 @@ 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_; +} + bool Blitter::advance_dma() { if(!height_) return false; @@ -358,12 +365,10 @@ bool Blitter::advance_dma() { transient_a_mask_ = x_ ? 0xffff : a_mask_[0]; // Check whether an entire row was completed in the previous iteration. - // If so then add modulos. + // If so then add modulos. Though this won't capture the move off the + // final line, so that's handled elsewhere. if(!x_ && y_) { - 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_; + add_modulos(); } ++x_; @@ -393,6 +398,7 @@ bool Blitter::advance_dma() { pointer_[2] += direction_; return true; case Channel::FlushPipeline: + add_modulos(); posit_interrupt(InterruptFlag::Blitter); height_ = 0; busy_ = false; diff --git a/Machines/Amiga/Blitter.hpp b/Machines/Amiga/Blitter.hpp index a14da2b6b..21a94a4c1 100644 --- a/Machines/Amiga/Blitter.hpp +++ b/Machines/Amiga/Blitter.hpp @@ -217,6 +217,8 @@ class Blitter: public DMADevice<4, 4> { uint16_t transient_a_mask_; bool busy_ = false; int loop_index_ = -1; + + void add_modulos(); }; }