From 602e7f01c7281cc257460da4afd35df3c93d01f5 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 5 Jul 2016 21:15:29 -0400 Subject: [PATCH] Control lines seem to have evolved to pure push. --- Components/6522/6522.hpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Components/6522/6522.hpp b/Components/6522/6522.hpp index 730e21a96..4353c6a6b 100644 --- a/Components/6522/6522.hpp +++ b/Components/6522/6522.hpp @@ -114,17 +114,25 @@ template class MOS6522 { case 0xc: // printf("Peripheral control %02x\n", value); _registers.peripheral_control = value; - switch(value & 0x0e) + + // TODO: simplify below; tryig to avoid improper logging of unimplemented warnings in input mode + if(value & 0x08) { - default: printf("Unimplemented control line mode %d\n", (value >> 1)&7); break; - case 0x0c: static_cast(this)->set_control_line_output(Port::A, Line::Two, false); break; - case 0x0e: static_cast(this)->set_control_line_output(Port::A, Line::Two, true); break; + switch(value & 0x0e) + { + default: printf("Unimplemented control line mode %d\n", (value >> 1)&7); break; + case 0x0c: static_cast(this)->set_control_line_output(Port::A, Line::Two, false); break; + case 0x0e: static_cast(this)->set_control_line_output(Port::A, Line::Two, true); break; + } } - switch(value & 0xe0) + if(value & 0x80) { - default: printf("Unimplemented control line mode %d\n", (value >> 5)&7); break; - case 0xc0: static_cast(this)->set_control_line_output(Port::B, Line::Two, false); break; - case 0xe0: static_cast(this)->set_control_line_output(Port::B, Line::Two, true); break; + switch(value & 0xe0) + { + default: printf("Unimplemented control line mode %d\n", (value >> 5)&7); break; + case 0xc0: static_cast(this)->set_control_line_output(Port::B, Line::Two, false); break; + case 0xe0: static_cast(this)->set_control_line_output(Port::B, Line::Two, true); break; + } } break; @@ -293,9 +301,8 @@ template class MOS6522 { // Expected to be overridden uint8_t get_port_input(Port port) { return 0xff; } void set_port_output(Port port, uint8_t value, uint8_t direction_mask) {} - bool get_control_line(Port port, Line line) { return true; } void set_control_line_output(Port port, Line line, bool value) {} - void set_interrupt_status(bool status) {} + void set_interrupt_status(bool status) {} // Input/output multiplexer uint8_t get_port_input(Port port, uint8_t output_mask, uint8_t output)