diff options
Diffstat (limited to 'src/devices/bus/dmv/k801.cpp')
-rw-r--r-- | src/devices/bus/dmv/k801.cpp | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/src/devices/bus/dmv/k801.cpp b/src/devices/bus/dmv/k801.cpp index 2e632ca5c95..4465a45227b 100644 --- a/src/devices/bus/dmv/k801.cpp +++ b/src/devices/bus/dmv/k801.cpp @@ -84,7 +84,7 @@ dmv_k801_device::dmv_k801_device(const machine_config &mconfig, const char *tag, dmv_k801_device::dmv_k801_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), device_dmvslot_interface( mconfig, *this ), - m_epci(*this, "epci"), + m_pci(*this, "pci"), m_rs232(*this, "rs232"), m_dsw(*this, "DSW") { @@ -143,38 +143,43 @@ void dmv_k801_device::device_reset() // device_add_mconfig - add device configuration //------------------------------------------------- -void dmv_k801_device::device_add_mconfig(machine_config &config) +void dmv_k801_device::pci_mconfig(machine_config &config, bool epci, const char *default_option) { - MC2661(config, m_epci, XTAL(5'068'800)); - m_epci->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); - m_epci->rts_handler().set("rs232", FUNC(rs232_port_device::write_rts)); - m_epci->dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr)); - m_epci->rxrdy_handler().set(FUNC(dmv_k801_device::epci_irq_w)); - m_epci->txrdy_handler().set(FUNC(dmv_k801_device::epci_irq_w)); + if (epci) + SCN2661C(config, m_pci, XTAL(5'068'800)); + else + SCN2651(config, m_pci, XTAL(5'068'800)); + m_pci->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); + m_pci->rts_handler().set("rs232", FUNC(rs232_port_device::write_rts)); + m_pci->dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr)); + m_pci->rxrdy_handler().set(FUNC(dmv_k801_device::pci_irq_w)); + m_pci->txrdy_handler().set(FUNC(dmv_k801_device::pci_irq_w)); + + RS232_PORT(config, m_rs232, default_rs232_devices, default_option); + m_rs232->rxd_handler().set(m_pci, FUNC(scn_pci_device::rxd_w)); + m_rs232->dcd_handler().set(m_pci, FUNC(scn_pci_device::dcd_w)); + m_rs232->dsr_handler().set(m_pci, FUNC(scn_pci_device::dsr_w)); + m_rs232->cts_handler().set(m_pci, FUNC(scn_pci_device::cts_w)); +} - RS232_PORT(config, m_rs232, default_rs232_devices, "printer"); - m_rs232->rxd_handler().set(m_epci, FUNC(mc2661_device::rx_w)); - m_rs232->dcd_handler().set(m_epci, FUNC(mc2661_device::dcd_w)); - m_rs232->dsr_handler().set(m_epci, FUNC(mc2661_device::dsr_w)); - m_rs232->cts_handler().set(m_epci, FUNC(mc2661_device::cts_w)); +void dmv_k801_device::device_add_mconfig(machine_config &config) +{ + pci_mconfig(config, true, "printer"); } void dmv_k211_device::device_add_mconfig(machine_config &config) { - dmv_k801_device::device_add_mconfig(config); - m_rs232->set_default_option("null_modem"); + pci_mconfig(config, false, "null_modem"); } void dmv_k212_device::device_add_mconfig(machine_config &config) { - dmv_k801_device::device_add_mconfig(config); - m_rs232->set_default_option("printer"); + pci_mconfig(config, false, "printer"); } void dmv_k213_device::device_add_mconfig(machine_config &config) { - dmv_k801_device::device_add_mconfig(config); - m_rs232->set_default_option(nullptr); + pci_mconfig(config, false, nullptr); } //------------------------------------------------- @@ -201,7 +206,7 @@ ioport_constructor dmv_k213_device::device_input_ports() const return INPUT_PORTS_NAME( dmv_k213 ); } -WRITE_LINE_MEMBER(dmv_k801_device::epci_irq_w) +WRITE_LINE_MEMBER(dmv_k801_device::pci_irq_w) { out_irq(state); } @@ -212,9 +217,9 @@ void dmv_k801_device::io_read(int ifsel, offs_t offset, uint8_t &data) if ((dsw >> 1) == ifsel && BIT(offset, 3) == BIT(dsw, 0)) { if (offset & 0x04) - m_epci->write(offset & 0x03, data); + m_pci->write(offset & 0x03, data); else - data = m_epci->read(offset & 0x03); + data = m_pci->read(offset & 0x03); } } @@ -224,9 +229,9 @@ void dmv_k801_device::io_write(int ifsel, offs_t offset, uint8_t data) if ((dsw >> 1) == ifsel && BIT(offset, 3) == BIT(dsw, 0)) { if (offset & 0x04) - m_epci->write(offset & 0x03, data); + m_pci->write(offset & 0x03, data); else - data = m_epci->read(offset & 0x03); + data = m_pci->read(offset & 0x03); } } @@ -236,9 +241,9 @@ void dmv_k211_device::io_read(int ifsel, offs_t offset, uint8_t &data) if ((BIT(jumpers, 0) && ifsel == 0) || (BIT(jumpers, 1) && ifsel == 1)) { if (offset & 0x04) - m_epci->write(offset & 0x03, data); + m_pci->write(offset & 0x03, data); else - data = m_epci->read(offset & 0x03); + data = m_pci->read(offset & 0x03); } } @@ -248,8 +253,8 @@ void dmv_k211_device::io_write(int ifsel, offs_t offset, uint8_t data) if ((BIT(jumpers, 0) && ifsel == 0) || (BIT(jumpers, 1) && ifsel == 1)) { if (offset & 0x04) - m_epci->write(offset & 0x03, data); + m_pci->write(offset & 0x03, data); else - data = m_epci->read(offset & 0x03); + data = m_pci->read(offset & 0x03); } } |