diff --git a/Components/68901/MFP68901.cpp b/Components/68901/MFP68901.cpp index 6c9f211e8..3d41cb7e9 100644 --- a/Components/68901/MFP68901.cpp +++ b/Components/68901/MFP68901.cpp @@ -321,7 +321,11 @@ bool MFP68901::get_interrupt_line() { return interrupt_line_; } -uint8_t MFP68901::acknowledge_interrupt() { +int MFP68901::acknowledge_interrupt() { + if(!(interrupt_pending_ & interrupt_mask_)) { + return NoAcknowledgement; + } + const int selected = fls(interrupt_pending_ & interrupt_mask_) - 1; const int mask = 1 << selected; diff --git a/Components/68901/MFP68901.hpp b/Components/68901/MFP68901.hpp index a9d4325ff..f1a930820 100644 --- a/Components/68901/MFP68901.hpp +++ b/Components/68901/MFP68901.hpp @@ -36,7 +36,9 @@ class MFP68901: public ClockingHint::Source { uint8_t get_port_output(); bool get_interrupt_line(); - uint8_t acknowledge_interrupt(); + + const int NoAcknowledgement = 0x100; + int acknowledge_interrupt(); struct InterruptDelegate { virtual void mfp68901_did_change_interrupt_status(MFP68901 *) = 0;