1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-09 21:29:53 +00:00

Mostly just random guesses now, to be honest. It's approaching the end of my window for the morning.

This commit is contained in:
Thomas Harte 2016-07-07 07:16:36 -04:00
parent 81e6cc34e5
commit 199c0e27e0

View File

@ -34,9 +34,10 @@ class SerialPortVIA: public MOS::MOS6522<SerialPortVIA>, public MOS::MOS6522IRQD
if(port) { if(port) {
std::shared_ptr<::Commodore::Serial::Port> serialPort = _serialPort.lock(); std::shared_ptr<::Commodore::Serial::Port> serialPort = _serialPort.lock();
if(serialPort) { if(serialPort) {
printf("1540 output: %02x\n", value);
// serialPort->set_output(::Commodore::Serial::Line::Attention, !(value&0x10)); // serialPort->set_output(::Commodore::Serial::Line::Attention, !(value&0x10));
serialPort->set_output(::Commodore::Serial::Line::Clock, (::Commodore::Serial::LineLevel)(value&0x08)); serialPort->set_output(::Commodore::Serial::Line::Clock, (::Commodore::Serial::LineLevel)!(value&0x08));
serialPort->set_output(::Commodore::Serial::Line::Data, (::Commodore::Serial::LineLevel)(value&0x02)); serialPort->set_output(::Commodore::Serial::Line::Data, (::Commodore::Serial::LineLevel)!(value&0x02));
} }
// printf("1540 serial port VIA port B: %02x\n", value); // printf("1540 serial port VIA port B: %02x\n", value);
} }
@ -48,11 +49,11 @@ class SerialPortVIA: public MOS::MOS6522<SerialPortVIA>, public MOS::MOS6522IRQD
// printf("1540 Serial port line %d: %s\n", line, value ? "on" : "off"); // printf("1540 Serial port line %d: %s\n", line, value ? "on" : "off");
switch(line) { switch(line) {
default: break; default: break;
case ::Commodore::Serial::Line::Data: _portB = (_portB & ~0x01) | (value ? 0x01 : 0x00); break; case ::Commodore::Serial::Line::Data: _portB = (_portB & ~0x01) | (value ? 0x00 : 0x01); break;
case ::Commodore::Serial::Line::Clock: _portB = (_portB & ~0x04) | (value ? 0x04 : 0x00); break; case ::Commodore::Serial::Line::Clock: _portB = (_portB & ~0x04) | (value ? 0x00 : 0x04); break;
case ::Commodore::Serial::Line::Attention: case ::Commodore::Serial::Line::Attention:
_portB = (_portB & ~0x80) | (value ? 0x80 : 0x00); _portB = (_portB & ~0x80) | (value ? 0x00 : 0x80);
set_control_line_input(Port::A, Line::One, value); set_control_line_input(Port::A, Line::One, !value);
break; break;
} }
} }