1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-04-05 04:37:41 +00:00

Control lines seem to have evolved to pure push.

This commit is contained in:
Thomas Harte 2016-07-05 21:15:29 -04:00
parent 93c2bb80a2
commit 602e7f01c7

View File

@ -114,17 +114,25 @@ template <class T> 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<T *>(this)->set_control_line_output(Port::A, Line::Two, false); break;
case 0x0e: static_cast<T *>(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<T *>(this)->set_control_line_output(Port::A, Line::Two, false); break;
case 0x0e: static_cast<T *>(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<T *>(this)->set_control_line_output(Port::B, Line::Two, false); break;
case 0xe0: static_cast<T *>(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<T *>(this)->set_control_line_output(Port::B, Line::Two, false); break;
case 0xe0: static_cast<T *>(this)->set_control_line_output(Port::B, Line::Two, true); break;
}
}
break;
@ -293,9 +301,8 @@ template <class T> 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)