mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-14 13:33:42 +00:00
Added some extra logging while trying to determine what's going on; added interrupt clearing for the control lines.
This commit is contained in:
parent
2a2c3da5d4
commit
843d1fdca7
@ -58,11 +58,17 @@ template <class T> class MOS6522 {
|
|||||||
case 0x0:
|
case 0x0:
|
||||||
_registers.output[1] = value;
|
_registers.output[1] = value;
|
||||||
static_cast<T *>(this)->set_port_output(Port::B, value, _registers.data_direction[1]); // TODO: handshake
|
static_cast<T *>(this)->set_port_output(Port::B, value, _registers.data_direction[1]); // TODO: handshake
|
||||||
|
|
||||||
|
_registers.interrupt_flags &= ~(InterruptFlag::CB1ActiveEdge | InterruptFlag::CB2ActiveEdge);
|
||||||
|
reevaluate_interrupts();
|
||||||
break;
|
break;
|
||||||
case 0xf:
|
case 0xf:
|
||||||
case 0x1:
|
case 0x1:
|
||||||
_registers.output[0] = value;
|
_registers.output[0] = value;
|
||||||
static_cast<T *>(this)->set_port_output(Port::A, value, _registers.data_direction[0]); // TODO: handshake
|
static_cast<T *>(this)->set_port_output(Port::A, value, _registers.data_direction[0]); // TODO: handshake
|
||||||
|
|
||||||
|
_registers.interrupt_flags &= ~(InterruptFlag::CA1ActiveEdge | InterruptFlag::CA2ActiveEdge);
|
||||||
|
reevaluate_interrupts();
|
||||||
break;
|
break;
|
||||||
// // No handshake, so write directly
|
// // No handshake, so write directly
|
||||||
// _registers.output[0] = value;
|
// _registers.output[0] = value;
|
||||||
@ -119,7 +125,7 @@ template <class T> class MOS6522 {
|
|||||||
else
|
else
|
||||||
_registers.interrupt_enable &= ~value;
|
_registers.interrupt_enable &= ~value;
|
||||||
reevaluate_interrupts();
|
reevaluate_interrupts();
|
||||||
printf("Interrupt mask -> %02x\n", _registers.interrupt_enable);
|
printf("[%p] Interrupt mask -> %02x\n", this, _registers.interrupt_enable);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -131,9 +137,15 @@ template <class T> class MOS6522 {
|
|||||||
// printf("6522 %p: %d\n", this, address);
|
// printf("6522 %p: %d\n", this, address);
|
||||||
switch(address)
|
switch(address)
|
||||||
{
|
{
|
||||||
case 0x0: return get_port_input(Port::B, _registers.data_direction[1], _registers.output[1]);
|
case 0x0:
|
||||||
|
_registers.interrupt_flags &= ~(InterruptFlag::CB1ActiveEdge | InterruptFlag::CB2ActiveEdge);
|
||||||
|
reevaluate_interrupts();
|
||||||
|
return get_port_input(Port::B, _registers.data_direction[1], _registers.output[1]);
|
||||||
case 0xf: // TODO: handshake, latching
|
case 0xf: // TODO: handshake, latching
|
||||||
case 0x1: return get_port_input(Port::A, _registers.data_direction[0], _registers.output[0]);
|
case 0x1:
|
||||||
|
_registers.interrupt_flags &= ~(InterruptFlag::CA1ActiveEdge | InterruptFlag::CA2ActiveEdge);
|
||||||
|
reevaluate_interrupts();
|
||||||
|
return get_port_input(Port::A, _registers.data_direction[0], _registers.output[0]);
|
||||||
|
|
||||||
case 0x2: return _registers.data_direction[1];
|
case 0x2: return _registers.data_direction[1];
|
||||||
case 0x3: return _registers.data_direction[0];
|
case 0x3: return _registers.data_direction[0];
|
||||||
|
@ -19,6 +19,9 @@ Machine::Machine() :
|
|||||||
_keyboardVIA.set_delegate(this);
|
_keyboardVIA.set_delegate(this);
|
||||||
_tape.set_delegate(this);
|
_tape.set_delegate(this);
|
||||||
set_reset_line(true);
|
set_reset_line(true);
|
||||||
|
|
||||||
|
printf("User port: %p\n", &_userPortVIA);
|
||||||
|
printf("Keyboard: %p\n", &_keyboardVIA);
|
||||||
}
|
}
|
||||||
|
|
||||||
Machine::~Machine()
|
Machine::~Machine()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user