1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Switch CIA B ports over.

This commit is contained in:
Thomas Harte 2021-10-05 03:38:11 -07:00
parent 6566936be9
commit e47bec2e65

View File

@ -922,9 +922,11 @@ Chipset::CIAAHandler::CIAAHandler(MemoryMap &map, DiskController &controller) :
void Chipset::CIAAHandler::set_port_output(MOS::MOS6526::Port port, uint8_t value) { void Chipset::CIAAHandler::set_port_output(MOS::MOS6526::Port port, uint8_t value) {
if(port) { if(port) {
// Parallel port output. // CIA A, Port B: Parallel port output.
LOG("TODO: parallel output " << PADHEX(2) << +value); LOG("TODO: parallel output " << PADHEX(2) << +value);
} else { } else {
// CIA A, Port A:
//
// b7: /FIR1 // b7: /FIR1
// b6: /FIR0 // b6: /FIR0
// b5: /RDY // b5: /RDY
@ -967,18 +969,8 @@ Chipset::CIABHandler::CIABHandler(DiskController &controller) : controller_(cont
void Chipset::CIABHandler::set_port_output(MOS::MOS6526::Port port, uint8_t value) { void Chipset::CIABHandler::set_port_output(MOS::MOS6526::Port port, uint8_t value) {
if(port) { if(port) {
// Serial port control. // CIA B, Port B:
// //
// b7: /DTR
// b6: /RTS
// b5: /CD
// b4: /CTS
// b3: /DSR
// b2: SEL
// b1: POUT
// b0: BUSY
LOG("TODO: DTR/RTS/etc: " << PADHEX(2) << +value);
} else {
// Disk motor control, drive and head selection, // Disk motor control, drive and head selection,
// and stepper control: // and stepper control:
// //
@ -999,16 +991,24 @@ void Chipset::CIABHandler::set_port_output(MOS::MOS6526::Port port, uint8_t valu
// select signal turns on." — The Hardware Reference Manual. // select signal turns on." — The Hardware Reference Manual.
previous_select_ = value; previous_select_ = value;
} else {
// CIA B, Port A: Serial port control.
//
// b7: /DTR
// b6: /RTS
// b5: /CD
// b4: /CTS
// b3: /DSR
// b2: SEL
// b1: POUT
// b0: BUSY
LOG("TODO: DTR/RTS/etc: " << PADHEX(2) << +value);
} }
} }
uint8_t Chipset::CIABHandler::get_port_input(MOS::MOS6526::Port port) { uint8_t Chipset::CIABHandler::get_port_input(MOS::MOS6526::Port port) {
LOG("Unexpected input for CIA B "); LOG("Unexpected input for CIA B");
if(port) { return 0xff;
return 0xff;
} else {
return previous_select_;
}
} }
// MARK: - Disk Controller. // MARK: - Disk Controller.