diff --git a/Components/6850/6850.cpp b/Components/6850/6850.cpp index 80a0afdcf..35c01a85b 100644 --- a/Components/6850/6850.cpp +++ b/Components/6850/6850.cpp @@ -89,6 +89,7 @@ void ACIA::write(int address, uint8_t value) { transmit.write(false); break; } + receive.set_read_delegate(this, Storage::Time(divider_ * 2, receive_clock_rate_.as_int())); receive_interrupt_enabled_ = value & 0x80; } } @@ -174,3 +175,8 @@ ClockingHint::Preference ACIA::preferred_clocking() { bool ACIA::get_interrupt_line() const { return interrupt_request_; } + +bool ACIA::serial_line_did_produce_bit(Serial::Line *line, int bit) { + // TODO: how does this affect signalling? + return false; +} diff --git a/Components/6850/6850.hpp b/Components/6850/6850.hpp index e901814c4..4509cfe5e 100644 --- a/Components/6850/6850.hpp +++ b/Components/6850/6850.hpp @@ -17,7 +17,7 @@ namespace Motorola { namespace ACIA { -class ACIA: public ClockingHint::Source { +class ACIA: public ClockingHint::Source, private Serial::Line::ReadDelegate { public: static constexpr const HalfCycles SameAsTransmit = HalfCycles(0); @@ -85,6 +85,8 @@ class ACIA: public ClockingHint::Source { HalfCycles transmit_clock_rate_; HalfCycles receive_clock_rate_; + + bool serial_line_did_produce_bit(Serial::Line *line, int bit) final; }; } diff --git a/Components/SerialPort/SerialPort.cpp b/Components/SerialPort/SerialPort.cpp index 7ecdde52c..2131e6bf1 100644 --- a/Components/SerialPort/SerialPort.cpp +++ b/Components/SerialPort/SerialPort.cpp @@ -103,6 +103,7 @@ bool Line::read() { void Line::set_read_delegate(ReadDelegate *delegate, Storage::Time bit_length) { read_delegate_ = delegate; read_delegate_bit_length_ = bit_length; + read_delegate_bit_length_.simplify(); write_cycles_since_delegate_call_ = 0; }