diff options
Diffstat (limited to 'src/mame/drivers/pcd.cpp')
-rw-r--r-- | src/mame/drivers/pcd.cpp | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/src/mame/drivers/pcd.cpp b/src/mame/drivers/pcd.cpp index 2ee64e15f8e..d7bfdbe7e16 100644 --- a/src/mame/drivers/pcd.cpp +++ b/src/mame/drivers/pcd.cpp @@ -44,6 +44,7 @@ public: , m_speaker(*this, "speaker") , m_fdc(*this, "fdc") , m_rtc(*this, "rtc") + , m_usart(*this, "usart%u", 1U) , m_scsi(*this, "scsi") , m_scsi_data_out(*this, "scsi_data_out") , m_scsi_data_in(*this, "scsi_data_in") @@ -99,6 +100,7 @@ private: required_device<speaker_sound_device> m_speaker; required_device<wd2793_device> m_fdc; required_device<mc146818_device> m_rtc; + required_device_array<mc2661_device, 3> m_usart; required_device<scsi_port_device> m_scsi; required_device<output_latch_device> m_scsi_data_out; required_device<input_buffer_device> m_scsi_data_in; @@ -459,9 +461,9 @@ void pcd_state::pcd_io(address_map &map) map(0xf904, 0xf905).rw(FUNC(pcd_state::dskctl_r), FUNC(pcd_state::dskctl_w)); map(0xf940, 0xf943).rw(FUNC(pcd_state::scsi_r), FUNC(pcd_state::scsi_w)); map(0xf980, 0xf9bf).m("video", FUNC(pcdx_video_device::map)); - map(0xf9c0, 0xf9c3).rw("usart1", FUNC(mc2661_device::read), FUNC(mc2661_device::write)); // UARTs - map(0xf9d0, 0xf9d3).rw("usart2", FUNC(mc2661_device::read), FUNC(mc2661_device::write)); - map(0xf9e0, 0xf9e3).rw("usart3", FUNC(mc2661_device::read), FUNC(mc2661_device::write)); + map(0xf9c0, 0xf9c3).rw(m_usart[0], FUNC(mc2661_device::read), FUNC(mc2661_device::write)); // UARTs + map(0xf9d0, 0xf9d3).rw(m_usart[1], FUNC(mc2661_device::read), FUNC(mc2661_device::write)); + map(0xf9e0, 0xf9e3).rw(m_usart[2], FUNC(mc2661_device::read), FUNC(mc2661_device::write)); // AM_RANGE(0xfa00, 0xfa7f) // pcs4-n (peripheral chip select) map(0xfb00, 0xfb00).rw(FUNC(pcd_state::nmi_io_r), FUNC(pcd_state::nmi_io_w)); map(0xfb02, 0xffff).rw(FUNC(pcd_state::nmi_io_r), FUNC(pcd_state::nmi_io_w)); @@ -530,23 +532,25 @@ MACHINE_CONFIG_START(pcd_state::pcd) MCFG_FLOPPY_DRIVE_ADD("fdc:1", pcd_floppies, "55f", pcd_state::floppy_formats) // usart - MCFG_DEVICE_ADD("usart1", MC2661, 4.9152_MHz_XTAL) - MCFG_MC2661_RXRDY_HANDLER(WRITELINE(m_pic1, pic8259_device, ir3_w)) - MCFG_MC2661_TXRDY_HANDLER(WRITELINE(m_pic1, pic8259_device, ir3_w)) - MCFG_MC2661_TXD_HANDLER(WRITELINE("rs232_1", rs232_port_device, write_txd)) - MCFG_DEVICE_ADD("usart2", MC2661, 4.9152_MHz_XTAL) - MCFG_MC2661_RXRDY_HANDLER(WRITELINE(m_pic1, pic8259_device, ir2_w)) - //MCFG_MC2661_TXRDY_HANDLER(WRITELINE(m_pic1, pic8259_device, ir2_w)) // this gets stuck high causing the keyboard to not work - MCFG_MC2661_TXD_HANDLER(WRITELINE("keyboard", pcd_keyboard_device, t0_w)) - MCFG_DEVICE_ADD("usart3", MC2661, 4.9152_MHz_XTAL) - MCFG_MC2661_RXRDY_HANDLER(WRITELINE(m_pic1, pic8259_device, ir4_w)) - MCFG_MC2661_TXRDY_HANDLER(WRITELINE(m_pic1, pic8259_device, ir4_w)) - MCFG_MC2661_TXD_HANDLER(WRITELINE("rs232_2", rs232_port_device, write_txd)) + MC2661(config, m_usart[0], 4.9152_MHz_XTAL); + m_usart[0]->rxrdy_handler().set(m_pic1, FUNC(pic8259_device::ir3_w)); + m_usart[0]->txrdy_handler().set(m_pic1, FUNC(pic8259_device::ir3_w)); + m_usart[0]->txd_handler().set("rs232_1", FUNC(rs232_port_device::write_txd)); + + MC2661(config, m_usart[1], 4.9152_MHz_XTAL); + m_usart[1]->rxrdy_handler().set(m_pic1, FUNC(pic8259_device::ir2_w)); + //m_usart[1]->.txrdy_handler().set(m_pic1, FUNC(pic8259_device::ir2_w)); // this gets stuck high causing the keyboard to not work + m_usart[1]->txd_handler().set("keyboard", FUNC(pcd_keyboard_device::t0_w)); + + MC2661(config, m_usart[2], 4.9152_MHz_XTAL); + m_usart[2]->rxrdy_handler().set(m_pic1, FUNC(pic8259_device::ir4_w)); + m_usart[2]->txrdy_handler().set(m_pic1, FUNC(pic8259_device::ir4_w)); + m_usart[2]->txd_handler().set("rs232_2", FUNC(rs232_port_device::write_txd)); MCFG_DEVICE_ADD("rs232_1", RS232_PORT, default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(WRITELINE("usart1", mc2661_device, rx_w)) + MCFG_RS232_RXD_HANDLER(WRITELINE(m_usart[0], mc2661_device, rx_w)) MCFG_DEVICE_ADD("rs232_2", RS232_PORT, default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(WRITELINE("usart3", mc2661_device, rx_w)) + MCFG_RS232_RXD_HANDLER(WRITELINE(m_usart[2], mc2661_device, rx_w)) // sound hardware SPEAKER(config, "mono").front_center(); @@ -562,7 +566,7 @@ MACHINE_CONFIG_START(pcd_state::pcd) m_rtc->set_24hrs(true); MCFG_DEVICE_ADD("keyboard", PCD_KEYBOARD, 0) - MCFG_PCD_KEYBOARD_OUT_TX_HANDLER(WRITELINE("usart2", mc2661_device, rx_w)) + MCFG_PCD_KEYBOARD_OUT_TX_HANDLER(WRITELINE(m_usart[1], mc2661_device, rx_w)) MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0) MCFG_SCSI_DATA_INPUT_BUFFER("scsi_data_in") @@ -588,8 +592,7 @@ MACHINE_CONFIG_START(pcd_state::pcx) MCFG_DEVICE_MODIFY("keyboard") MCFG_PCD_KEYBOARD_OUT_TX_HANDLER(WRITELINE("video", pcx_video_device, rx_w)) - MCFG_DEVICE_MODIFY("usart2") - MCFG_MC2661_TXD_HANDLER(NOOP) + m_usart[1]->txd_handler().set_nop(); MACHINE_CONFIG_END //************************************************************************** |