diff --git a/Machines/Commodore/1540/Commodore1540.hpp b/Machines/Commodore/1540/Commodore1540.hpp index 378ecb35c..7e57eb2ff 100644 --- a/Machines/Commodore/1540/Commodore1540.hpp +++ b/Machines/Commodore/1540/Commodore1540.hpp @@ -52,7 +52,7 @@ class SerialPortVIA: public MOS::MOS6522, public MOS::MOS6522IRQD case ::Commodore::Serial::Line::Clock: _portB = (_portB & ~0x04) | (value ? 0 : 0x04); break; case ::Commodore::Serial::Line::Attention: _portB = (_portB & ~0x80) | (value ? 0 : 0x80); - set_control_line_input(Port::B, Line::Two, value); + set_control_line_input(Port::B, Line::Two, !value); // from active low to active high break; } } diff --git a/Machines/Commodore/SerialBus.cpp b/Machines/Commodore/SerialBus.cpp index c4e3a3f2c..be76aaef5 100644 --- a/Machines/Commodore/SerialBus.cpp +++ b/Machines/Commodore/SerialBus.cpp @@ -14,7 +14,13 @@ void Bus::add_port(std::shared_ptr port) { _ports.push_back(port); for(int line = (int)ServiceRequest; line <= (int)Reset; line++) + { + // the addition of a new device may change the line output... set_line_output_did_change((Line)line); + + // ... but the new device will need to be told the current state regardless + port->set_input((Line)line, _line_values[line]); + } } void Bus::set_line_output_did_change(Line line)