summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/dms86.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/dms86.cpp')
-rw-r--r--src/mame/drivers/dms86.cpp57
1 files changed, 29 insertions, 28 deletions
diff --git a/src/mame/drivers/dms86.cpp b/src/mame/drivers/dms86.cpp
index 40cff98c1d7..20127eb5637 100644
--- a/src/mame/drivers/dms86.cpp
+++ b/src/mame/drivers/dms86.cpp
@@ -135,38 +135,39 @@ void dms86_state::kbd_put(u8 data)
MACHINE_CONFIG_START(dms86_state::dms86)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I8086, XTAL(14'745'600) / 3) // according to the manual... hmm
- MCFG_DEVICE_PROGRAM_MAP(mem_map)
- MCFG_DEVICE_IO_MAP(io_map)
+ I8086(config, m_maincpu, XTAL(14'745'600) / 3); // according to the manual... hmm
+ m_maincpu->set_addrmap(AS_PROGRAM, &dms86_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &dms86_state::io_map);
// According to the manual the clock is 14,765,600 / 4 but that couldn't possibly work.
// By maths, clock should be 9600*32*4*16 = 19,660,800 but not working either
// So, commented out because it makes the whole thing crawl, only get 18% on my machine
- //MCFG_DEVICE_ADD("ctc_clock", CLOCK, 19660800) //XTAL(14'745'600) / 4)
- //MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ctc" ,z80ctc_device, trg0))
- //MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc" ,z80ctc_device, trg1))
- //MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("ctc" ,z80ctc_device, trg2))
-
- MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL(14'745'600) / 3)
- //MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) // frame rate interrupt to maincpu
- MCFG_Z80CTC_ZC0_CB(WRITELINE("sio1", z80sio_device, rxtxcb_w)) // SIO1 Ch B
- MCFG_Z80CTC_ZC1_CB(WRITELINE("sio1", z80sio_device, txca_w)) // SIO1 Ch A
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio1" ,z80sio_device, rxca_w))
- MCFG_Z80CTC_ZC2_CB(WRITELINE("sio2", z80sio_device, rxtxcb_w)) // SIO2
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio2" ,z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio2" ,z80sio_device, rxca_w))
-
- MCFG_DEVICE_ADD("sio1", Z80SIO, XTAL(14'745'600) / 3)
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs232", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs232", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs232", rs232_port_device, write_rts))
-
- MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("sio1", z80sio_device, rxb_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("sio1", z80sio_device, dcdb_w)) // HiNet / Monitor switch
- MCFG_RS232_CTS_HANDLER(WRITELINE("sio1", z80sio_device, ctsb_w)) MCFG_DEVCB_INVERT
-
- MCFG_DEVICE_ADD("sio2", Z80SIO, XTAL(14'745'600) / 3)
+ //clock_device &ctc_clock(CLOCK(config, "ctc_clock", 19660800)); //XTAL(14'745'600) / 4
+ //ctc_clock.signal_handler().set(m_ctc, FUNC(z80ctc_device::trg0));
+ //ctc_clock.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg1));
+ //ctc_clock.signal_handler().append(m_ctc, FUNC(z80ctc_device::trg2));
+
+ Z80CTC(config, m_ctc, XTAL(14'745'600) / 3);
+ //m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); // frame rate interrupt to maincpu
+ m_ctc->zc_callback<0>().set(m_sio[0], FUNC(z80sio_device::rxtxcb_w)); // SIO1 Ch B
+ m_ctc->zc_callback<1>().set(m_sio[0], FUNC(z80sio_device::txca_w)); // SIO1 Ch A
+ m_ctc->zc_callback<1>().append(m_sio[0], FUNC(z80sio_device::rxca_w));
+ m_ctc->zc_callback<2>().set(m_sio[1], FUNC(z80sio_device::rxtxcb_w)); // SIO2
+ m_ctc->zc_callback<2>().append(m_sio[1], FUNC(z80sio_device::rxca_w));
+ m_ctc->zc_callback<2>().append(m_sio[1], FUNC(z80sio_device::rxca_w));
+
+ Z80SIO(config, m_sio[0], XTAL(14'745'600) / 3);
+ m_sio[0]->out_txdb_callback().set("rs232", FUNC(rs232_port_device::write_txd));
+ m_sio[0]->out_dtrb_callback().set("rs232", FUNC(rs232_port_device::write_dtr));
+ m_sio[0]->out_rtsb_callback().set("rs232", FUNC(rs232_port_device::write_rts));
+
+ Z80SIO(config, m_sio[1], XTAL(14'745'600) / 3);
+
+ rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr));
+ rs232.rxd_handler().set(m_sio[0], FUNC(z80sio_device::rxb_w));
+ rs232.dcd_handler().set(m_sio[0], FUNC(z80sio_device::dcdb_w)); // HiNet / Monitor switch
+ rs232.cts_handler().set(m_sio[0], FUNC(z80sio_device::ctsb_w)).invert();
+
MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0)
MCFG_GENERIC_TERMINAL_KEYBOARD_CB(PUT(dms86_state, kbd_put))
MACHINE_CONFIG_END