From 19b16d8894b84ead0a8803e4c4610b6c0a9e099a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 21 Feb 2024 20:45:46 +0100 Subject: sfrj/idpartner.cpp : sortout SIO clocks --- src/mame/sfrj/idpartner.cpp | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/mame/sfrj/idpartner.cpp b/src/mame/sfrj/idpartner.cpp index 8a480db953a..f562b7f87cd 100644 --- a/src/mame/sfrj/idpartner.cpp +++ b/src/mame/sfrj/idpartner.cpp @@ -25,6 +25,7 @@ #include "formats/idpart_dsk.h" #include "machine/mc14411.h" #include "machine/mm58167.h" +#include "machine/timer.h" #include "machine/upd765.h" #include "machine/z80ctc.h" #include "machine/z80dma.h" @@ -179,7 +180,11 @@ private: u8 floppy_motor_r() { return m_floppy_motor; } void update_floppy_motor(); void xx2_w(int state) { if (state) { m_floppy_motor = 0; update_floppy_motor(); } } - void write_f1_clock(int state); + TIMER_DEVICE_CALLBACK_MEMBER(xx1_w) { m_ctc->trg0(param); } + void write_speed1_clock(int state) { m_sio1->txca_w(state); m_sio1->rxca_w(state); } + void write_speed2_clock(int state) { m_sio1->txcb_w(state); m_sio1->rxcb_w(state); } + void write_speed3_clock(int state) { m_sio2->txca_w(state); m_sio2->rxca_w(state); } + void write_speed4_clock(int state) { m_sio2->txcb_w(state); m_sio2->rxcb_w(state); } uint8_t memory_read_byte(offs_t offset) { return m_program.read_byte(offset); } void memory_write_byte(offs_t offset, uint8_t data) { m_program.write_byte(offset, data); } uint8_t io_read_byte(offs_t offset) { if (offset==0xf1) return m_fdc->dma_r(); else return m_io.read_byte(offset); } @@ -316,20 +321,6 @@ static void partner_floppy_formats(format_registration &fr) fr.add(FLOPPY_IDPART_FORMAT); } -void idpartner_state::write_f1_clock(int state) -{ - m_sio1->txca_w(state); - m_sio1->rxca_w(state); - - m_sio1->txcb_w(state); - m_sio1->rxcb_w(state); - - m_sio2->txca_w(state); - m_sio2->rxca_w(state); - - m_sio2->txcb_w(state); - m_sio2->rxcb_w(state); -} static DEVICE_INPUT_DEFAULTS_START(keyboard) DEVICE_INPUT_DEFAULTS("RS232_TXBAUD", 0xff, RS232_BAUD_300) @@ -359,7 +350,12 @@ void idpartner_state::partner_base(machine_config &config) MC14411(config, m_brg, XTAL(1'843'200)); m_brg->rsa_w(0); m_brg->rsb_w(1); - m_brg->out_f<13>().set(m_ctc, FUNC(z80ctc_device::trg0)); // signal XX1 + m_brg->out_f<1>().set(FUNC(idpartner_state::write_speed2_clock)); + m_brg->out_f<1>().append(FUNC(idpartner_state::write_speed3_clock)); + m_brg->out_f<1>().append(FUNC(idpartner_state::write_speed4_clock)); + // TODO: This should be from MC14411 but there are sync issues + //m_brg->out_f<13>().set(m_ctc, FUNC(z80ctc_device::trg0)); // signal XX1 + TIMER(config, "xx1").configure_periodic(FUNC(idpartner_state::xx1_w), attotime::from_hz(110*16)); RS232_PORT(config, m_serial[0], partner_rs232_devices, nullptr); m_serial[0]->rxd_handler().set(m_sio1, FUNC(z80sio_device::rxa_w)); @@ -420,7 +416,7 @@ void idpartner_state::partnerw(machine_config &config) { partner_base(config); - m_brg->out_f<1>().set(FUNC(idpartner_state::write_f1_clock)); + m_brg->out_f<1>().append(FUNC(idpartner_state::write_speed1_clock)); m_serial[0]->set_default_option("idpart_video"); @@ -431,7 +427,7 @@ void idpartner_state::partner1fg(machine_config &config) { partner_base(config); - m_brg->out_f<9>().set(FUNC(idpartner_state::write_f1_clock)); + m_brg->out_f<9>().set(FUNC(idpartner_state::write_speed1_clock)); m_serial[0]->set_default_option("keyboard"); m_serial[0]->set_option_device_input_defaults("keyboard", DEVICE_INPUT_DEFAULTS_NAME(keyboard)); @@ -443,7 +439,7 @@ void idpartner_state::partnerwfg(machine_config &config) { partner_base(config); - m_brg->out_f<9>().set(FUNC(idpartner_state::write_f1_clock)); + m_brg->out_f<9>().set(FUNC(idpartner_state::write_speed1_clock)); m_serial[0]->set_default_option("keyboard"); m_serial[0]->set_option_device_input_defaults("keyboard", DEVICE_INPUT_DEFAULTS_NAME(keyboard)); -- cgit v1.2.3