diff --git a/Machines/AmstradCPC/AmstradCPC.cpp b/Machines/AmstradCPC/AmstradCPC.cpp index 796d7b4e8..469473243 100644 --- a/Machines/AmstradCPC/AmstradCPC.cpp +++ b/Machines/AmstradCPC/AmstradCPC.cpp @@ -30,9 +30,9 @@ class InterruptTimer { InterruptTimer() : timer_(0), interrupt_request_(false) {} /*! - Indicates that a new hsync pulse has been recognised. Per documentation - difficulties, it is not presently clear to me whether this should be - the leading or trailing edge of horizontal sync. + Indicates that a new hsync pulse has been recognised. This should be + supplied on the falling edge of the CRTC HSYNC signal, which is the + trailing edge because it is active high. */ inline void signal_hsync() { // Increment the timer and if it has hit 52 then reset it and @@ -49,7 +49,7 @@ class InterruptTimer { if(reset_counter_) { reset_counter_--; if(!reset_counter_) { - if(timer_ < 32) { + if(timer_ & 32) { interrupt_request_ = true; } timer_ = 0; @@ -76,6 +76,7 @@ class InterruptTimer { /// Resets the timer. inline void reset_count() { timer_ = 0; + interrupt_request_ = false; } private: