diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2018-08-20 18:44:59 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2018-08-20 18:44:59 -0400 |
commit | 179e5b84f6ba50b0bd230ac25a68e54f57254d2e (patch) | |
tree | 802b8fc6f31c63684c6fa8af6521197b7a7b7bf8 /src/mame/drivers | |
parent | 9065be185598c817ea544540ab13eb8e2c299c40 (diff) |
mos6551: Eliminate MCFG_ macros (nw)
a2232: Add input merger device to handle IRQs (nw)
superpet: 6809 type identification (nw)
Diffstat (limited to 'src/mame/drivers')
-rw-r--r-- | src/mame/drivers/aim65_40.cpp | 42 | ||||
-rw-r--r-- | src/mame/drivers/apple2e.cpp | 38 | ||||
-rw-r--r-- | src/mame/drivers/cbm2.cpp | 60 | ||||
-rw-r--r-- | src/mame/drivers/cmi.cpp | 99 | ||||
-rw-r--r-- | src/mame/drivers/digel804.cpp | 15 | ||||
-rw-r--r-- | src/mame/drivers/dragon.cpp | 8 | ||||
-rw-r--r-- | src/mame/drivers/ec65.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/hp2620.cpp | 27 | ||||
-rw-r--r-- | src/mame/drivers/microtan.cpp | 8 | ||||
-rw-r--r-- | src/mame/drivers/novag6502.cpp | 19 | ||||
-rw-r--r-- | src/mame/drivers/novag68k.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/rvoice.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/tek440x.cpp | 20 | ||||
-rw-r--r-- | src/mame/drivers/thomson.cpp | 16 | ||||
-rw-r--r-- | src/mame/drivers/tv910.cpp | 20 | ||||
-rw-r--r-- | src/mame/drivers/tv912.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/tv955.cpp | 18 | ||||
-rw-r--r-- | src/mame/drivers/tv965.cpp | 8 |
18 files changed, 196 insertions, 216 deletions
diff --git a/src/mame/drivers/aim65_40.cpp b/src/mame/drivers/aim65_40.cpp index 43a94f841fb..00a9bdee5be 100644 --- a/src/mame/drivers/aim65_40.cpp +++ b/src/mame/drivers/aim65_40.cpp @@ -79,7 +79,7 @@ public: void aim65_40(machine_config &config); private: - void aim65_40_mem(address_map &map); + void mem_map(address_map &map); // devices //device_t *m_via0; //device_t *m_via1; @@ -93,7 +93,7 @@ private: ADDRESS MAPS ***************************************************************************/ -void aim65_40_state::aim65_40_mem(address_map &map) +void aim65_40_state::mem_map(address_map &map) { map(0x0000, 0x3fff).ram(); map(0xa000, 0xcfff).rom().region("roms", 0); @@ -116,10 +116,11 @@ INPUT_PORTS_END MACHINE DRIVERS ***************************************************************************/ -MACHINE_CONFIG_START(aim65_40_state::aim65_40) +void aim65_40_state::aim65_40(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD(M6502_TAG, M6502, 1000000) - MCFG_DEVICE_PROGRAM_MAP(aim65_40_mem) + m6502_device &cpu(M6502(config, M6502_TAG, 1000000)); + cpu.set_addrmap(AS_PROGRAM, &aim65_40_state::mem_map); /* video hardware */ config.set_default_layout(layout_aim65_40); @@ -127,21 +128,22 @@ MACHINE_CONFIG_START(aim65_40_state::aim65_40) /* sound hardware */ /* devices */ - MCFG_DEVICE_ADD(M6522_0_TAG, VIA6522, 1000000) - MCFG_DEVICE_ADD(M6522_1_TAG, VIA6522, 1000000) - MCFG_DEVICE_ADD(M6522_2_TAG, VIA6522, 1000000) - MCFG_DEVICE_ADD(M6551_TAG, MOS6551, 0) - MCFG_MOS6551_XTAL(XTAL(1'843'200)) - MCFG_MOS6551_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd)) - MCFG_MOS6551_RTS_HANDLER(WRITELINE("rs232", rs232_port_device, write_rts)) - MCFG_MOS6551_DTR_HANDLER(WRITELINE("rs232", rs232_port_device, write_dtr)) - - MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "terminal") - MCFG_RS232_RXD_HANDLER(WRITELINE(M6551_TAG, mos6551_device, write_rxd)) - MCFG_RS232_DCD_HANDLER(WRITELINE(M6551_TAG, mos6551_device, write_dcd)) - MCFG_RS232_DSR_HANDLER(WRITELINE(M6551_TAG, mos6551_device, write_dsr)) - MCFG_RS232_CTS_HANDLER(WRITELINE(M6551_TAG, mos6551_device, write_cts)) -MACHINE_CONFIG_END + VIA6522(config, M6522_0_TAG, 1000000); + VIA6522(config, M6522_1_TAG, 1000000); + VIA6522(config, M6522_2_TAG, 1000000); + + mos6551_device &acia(MOS6551(config, M6551_TAG, 0)); + acia.set_xtal(1.8432_MHz_XTAL); + acia.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); + acia.rts_handler().set("rs232", FUNC(rs232_port_device::write_rts)); + acia.dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr)); + + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal")); + rs232.rxd_handler().set(M6551_TAG, FUNC(mos6551_device::write_rxd)); + rs232.dcd_handler().set(M6551_TAG, FUNC(mos6551_device::write_dcd)); + rs232.dsr_handler().set(M6551_TAG, FUNC(mos6551_device::write_dsr)); + rs232.cts_handler().set(M6551_TAG, FUNC(mos6551_device::write_cts)); +} /*************************************************************************** ROM DEFINITIONS diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp index bf141a7cc99..47df7c50b2e 100644 --- a/src/mame/drivers/apple2e.cpp +++ b/src/mame/drivers/apple2e.cpp @@ -4134,25 +4134,25 @@ MACHINE_CONFIG_START(apple2e_state::apple2c) MCFG_DEVICE_REMOVE("sl6") MCFG_DEVICE_REMOVE("sl7") - MCFG_DEVICE_ADD(IIC_ACIA1_TAG, MOS6551, 0) - MCFG_MOS6551_XTAL(XTAL(14'318'181) / 8) // ~1.789 MHz - MCFG_MOS6551_TXD_HANDLER(WRITELINE(PRINTER_PORT_TAG, rs232_port_device, write_txd)) - - MCFG_DEVICE_ADD(IIC_ACIA2_TAG, MOS6551, 0) - MCFG_MOS6551_XTAL(XTAL(1'843'200)) // matches SSC so modem software is compatible - MCFG_MOS6551_TXD_HANDLER(WRITELINE("modem", rs232_port_device, write_txd)) - - MCFG_DEVICE_ADD(PRINTER_PORT_TAG, RS232_PORT, default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(WRITELINE(IIC_ACIA1_TAG, mos6551_device, write_rxd)) - MCFG_RS232_DCD_HANDLER(WRITELINE(IIC_ACIA1_TAG, mos6551_device, write_dcd)) - MCFG_RS232_DSR_HANDLER(WRITELINE(IIC_ACIA1_TAG, mos6551_device, write_dsr)) - MCFG_RS232_CTS_HANDLER(WRITELINE(IIC_ACIA1_TAG, mos6551_device, write_cts)) - - MCFG_DEVICE_ADD(MODEM_PORT_TAG, RS232_PORT, default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(WRITELINE(IIC_ACIA2_TAG, mos6551_device, write_rxd)) - MCFG_RS232_DCD_HANDLER(WRITELINE(IIC_ACIA2_TAG, mos6551_device, write_dcd)) - MCFG_RS232_DSR_HANDLER(WRITELINE(IIC_ACIA2_TAG, mos6551_device, write_dsr)) - MCFG_RS232_CTS_HANDLER(WRITELINE(IIC_ACIA2_TAG, mos6551_device, write_cts)) + MOS6551(config, m_acia1, 0); + m_acia1->set_xtal(XTAL(14'318'181) / 8); // ~1.789 MHz + m_acia1->txd_handler().set(PRINTER_PORT_TAG, FUNC(rs232_port_device::write_txd)); + + MOS6551(config, m_acia2, 0); + m_acia2->set_xtal(XTAL(1'843'200)); // matches SSC so modem software is compatible + m_acia2->txd_handler().set("modem", FUNC(rs232_port_device::write_txd)); + + rs232_port_device &printer(RS232_PORT(config, PRINTER_PORT_TAG, default_rs232_devices, nullptr)); + printer.rxd_handler().set(m_acia1, FUNC(mos6551_device::write_rxd)); + printer.dcd_handler().set(m_acia1, FUNC(mos6551_device::write_dcd)); + printer.dsr_handler().set(m_acia1, FUNC(mos6551_device::write_dsr)); + printer.cts_handler().set(m_acia1, FUNC(mos6551_device::write_cts)); + + rs232_port_device &modem(RS232_PORT(config, MODEM_PORT_TAG, default_rs232_devices, nullptr)); + modem.rxd_handler().set(m_acia2, FUNC(mos6551_device::write_rxd)); + modem.dcd_handler().set(m_acia2, FUNC(mos6551_device::write_dcd)); + modem.dsr_handler().set(m_acia2, FUNC(mos6551_device::write_dsr)); + modem.cts_handler().set(m_acia2, FUNC(mos6551_device::write_cts)); // TODO: populate the IIc's other virtual slots with ONBOARD_ADD A2BUS_MOCKINGBOARD(config, "sl4", A2BUS_7M_CLOCK).set_onboard(m_a2bus); // Mockingboard 4C diff --git a/src/mame/drivers/cbm2.cpp b/src/mame/drivers/cbm2.cpp index 3097aa1fd67..a269635cb87 100644 --- a/src/mame/drivers/cbm2.cpp +++ b/src/mame/drivers/cbm2.cpp @@ -2294,13 +2294,13 @@ MACHINE_CONFIG_START(p500_state::p500_ntsc) m_tpi2->in_pc_cb().set(FUNC(p500_state::tpi2_pc_r)); m_tpi2->out_pc_cb().set(FUNC(p500_state::tpi2_pc_w)); - MCFG_DEVICE_ADD(MOS6551A_TAG, MOS6551, VIC6567_CLOCK) - MCFG_MOS6551_XTAL(XTAL(1'843'200)) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w)) - MCFG_MOS6551_TXD_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_txd)) - MCFG_MOS6551_DTR_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_dtr)) - MCFG_MOS6551_RTS_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_rts)) - MCFG_MOS6551_RXC_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_etc)) + MOS6551(config, m_acia, VIC6567_CLOCK); + m_acia->set_xtal(XTAL(1'843'200)); + m_acia->irq_handler().set(m_tpi1, FUNC(tpi6525_device::i4_w)); + m_acia->txd_handler().set(RS232_TAG, FUNC(rs232_port_device::write_txd)); + m_acia->dtr_handler().set(RS232_TAG, FUNC(rs232_port_device::write_dtr)); + m_acia->rts_handler().set(RS232_TAG, FUNC(rs232_port_device::write_rts)); + m_acia->rxc_handler().set(RS232_TAG, FUNC(rs232_port_device::write_etc)); MCFG_DEVICE_ADD(MOS6526_TAG, MOS6526A, XTAL(14'318'181)/14) MCFG_MOS6526_TOD(60) @@ -2350,11 +2350,11 @@ MACHINE_CONFIG_START(p500_state::p500_ntsc) m_user->cnt_callback().set(MOS6526_TAG, FUNC(mos6526_device::cnt_w)); m_user->flag_callback().set(MOS6526_TAG, FUNC(mos6526_device::flag_w)); - MCFG_DEVICE_ADD(RS232_TAG, RS232_PORT, default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_rxd)) - MCFG_RS232_DCD_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_dcd)) - MCFG_RS232_DSR_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_dsr)) - MCFG_RS232_CTS_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_cts)) + rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr)); + rs232.rxd_handler().set(m_acia, FUNC(mos6551_device::write_rxd)); + rs232.dcd_handler().set(m_acia, FUNC(mos6551_device::write_dcd)); + rs232.dsr_handler().set(m_acia, FUNC(mos6551_device::write_dsr)); + rs232.cts_handler().set(m_acia, FUNC(mos6551_device::write_cts)); MCFG_QUICKLOAD_ADD("quickload", p500_state, p500, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) @@ -2425,10 +2425,10 @@ MACHINE_CONFIG_START(p500_state::p500_pal) m_tpi2->in_pc_cb().set(FUNC(p500_state::tpi2_pc_r)); m_tpi2->out_pc_cb().set(FUNC(p500_state::tpi2_pc_w)); - MCFG_DEVICE_ADD(MOS6551A_TAG, MOS6551, 0) - MCFG_MOS6551_XTAL(XTAL(1'843'200)) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w)) - MCFG_MOS6551_TXD_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_txd)) + MOS6551(config, m_acia, 0); + m_acia->set_xtal(XTAL(1'843'200)); + m_acia->irq_handler().set(m_tpi1, FUNC(tpi6525_device::i4_w)); + m_acia->txd_handler().set(RS232_TAG, FUNC(rs232_port_device::write_txd)); MCFG_DEVICE_ADD(MOS6526_TAG, MOS6526A, XTAL(17'734'472)/18) MCFG_MOS6526_TOD(50) @@ -2477,11 +2477,11 @@ MACHINE_CONFIG_START(p500_state::p500_pal) m_user->cnt_callback().set(MOS6526_TAG, FUNC(mos6526_device::cnt_w)); m_user->flag_callback().set(MOS6526_TAG, FUNC(mos6526_device::flag_w)); - MCFG_DEVICE_ADD(RS232_TAG, RS232_PORT, default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_rxd)) - MCFG_RS232_DCD_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_dcd)) - MCFG_RS232_DSR_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_dsr)) - MCFG_RS232_CTS_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_cts)) + rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr)); + rs232.rxd_handler().set(m_acia, FUNC(mos6551_device::write_rxd)); + rs232.dcd_handler().set(m_acia, FUNC(mos6551_device::write_dcd)); + rs232.dsr_handler().set(m_acia, FUNC(mos6551_device::write_dsr)); + rs232.cts_handler().set(m_acia, FUNC(mos6551_device::write_cts)); MCFG_QUICKLOAD_ADD("quickload", p500_state, p500, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) @@ -2551,10 +2551,10 @@ MACHINE_CONFIG_START(cbm2_state::cbm2lp_ntsc) m_tpi2->out_pb_cb().set(FUNC(cbm2_state::tpi2_pb_w)); m_tpi2->in_pc_cb().set(FUNC(cbm2_state::tpi2_pc_r)); - MCFG_DEVICE_ADD(MOS6551A_TAG, MOS6551, 0) - MCFG_MOS6551_XTAL(XTAL(1'843'200)) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w)) - MCFG_MOS6551_TXD_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_txd)) + MOS6551(config, m_acia, 0); + m_acia->set_xtal(XTAL(1'843'200)); + m_acia->irq_handler().set(m_tpi1, FUNC(tpi6525_device::i4_w)); + m_acia->txd_handler().set(RS232_TAG, FUNC(rs232_port_device::write_txd)); MCFG_DEVICE_ADD(MOS6526_TAG, MOS6526A, XTAL(18'000'000)/9) MCFG_MOS6526_TOD(60) @@ -2602,11 +2602,11 @@ MACHINE_CONFIG_START(cbm2_state::cbm2lp_ntsc) m_user->cnt_callback().set(MOS6526_TAG, FUNC(mos6526_device::cnt_w)); m_user->flag_callback().set(MOS6526_TAG, FUNC(mos6526_device::flag_w)); - MCFG_DEVICE_ADD(RS232_TAG, RS232_PORT, default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_rxd)) - MCFG_RS232_DCD_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_dcd)) - MCFG_RS232_DSR_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_dsr)) - MCFG_RS232_CTS_HANDLER(WRITELINE(MOS6551A_TAG, mos6551_device, write_cts)) + rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr)); + rs232.rxd_handler().set(m_acia, FUNC(mos6551_device::write_rxd)); + rs232.dcd_handler().set(m_acia, FUNC(mos6551_device::write_dcd)); + rs232.dsr_handler().set(m_acia, FUNC(mos6551_device::write_dsr)); + rs232.cts_handler().set(m_acia, FUNC(mos6551_device::write_cts)); MCFG_QUICKLOAD_ADD("quickload", cbm2_state, cbmb, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) diff --git a/src/mame/drivers/cmi.cpp b/src/mame/drivers/cmi.cpp index e59a8531a0b..4f197fcdfff 100644 --- a/src/mame/drivers/cmi.cpp +++ b/src/mame/drivers/cmi.cpp @@ -223,18 +223,13 @@ public: , m_i8214_0(*this, "i8214_1") , m_i8214_1(*this, "i8214_2") , m_i8214_2(*this, "i8214_3") - , m_q133_pia_0(*this, "q133_pia_1") - , m_q133_pia_1(*this, "q133_pia_2") + , m_q133_pia(*this, "q133_pia_%u", 1U) , m_q133_ptm(*this, "q133_ptm") - , m_q133_acia_0(*this, "q133_acia_0") - , m_q133_acia_1(*this, "q133_acia_1") - , m_q133_acia_2(*this, "q133_acia_2") - , m_q133_acia_3(*this, "q133_acia_3") + , m_q133_acia(*this, "q133_acia_%u", 0U) , m_q133_region(*this, "q133") , m_q219_pia(*this, "q219_pia") , m_q219_ptm(*this, "q219_ptm") - , m_cmi02_pia_0(*this, "cmi02_pia_1") - , m_cmi02_pia_1(*this, "cmi02_pia_2") + , m_cmi02_pia(*this, "cmi02_pia_%u", 1U) , m_cmi02_ptm(*this, "cmi02_ptm") , m_ank_pia(*this, "ank_pia") , m_acia_mkbd_kbd(*this, "acia_mkbd_kbd") @@ -385,20 +380,15 @@ protected: required_device<i8214_device> m_i8214_0; required_device<i8214_device> m_i8214_1; required_device<i8214_device> m_i8214_2; - required_device<pia6821_device> m_q133_pia_0; - required_device<pia6821_device> m_q133_pia_1; + required_device_array<pia6821_device, 2> m_q133_pia; required_device<ptm6840_device> m_q133_ptm; - required_device<mos6551_device> m_q133_acia_0; - required_device<mos6551_device> m_q133_acia_1; - required_device<mos6551_device> m_q133_acia_2; - required_device<mos6551_device> m_q133_acia_3; + required_device_array<mos6551_device, 4> m_q133_acia; required_memory_region m_q133_region; required_device<pia6821_device> m_q219_pia; required_device<ptm6840_device> m_q219_ptm; - required_device<pia6821_device> m_cmi02_pia_0; - required_device<pia6821_device> m_cmi02_pia_1; + required_device_array<pia6821_device, 2> m_cmi02_pia; required_device<ptm6840_device> m_cmi02_ptm; required_device<pia6821_device> m_ank_pia; @@ -1526,7 +1516,7 @@ READ8_MEMBER( cmi_state::cmi02_r ) if (offset <= 0x1f) { - int ch_mask = m_cmi02_pia_0->a_output(); + int ch_mask = m_cmi02_pia[0]->a_output(); for (int i = 0; i < 8; ++i) { @@ -1543,7 +1533,7 @@ READ8_MEMBER( cmi_state::cmi02_r ) switch (offset) { case 0x20: case 0x21: case 0x22: case 0x23: - return m_cmi02_pia_0->read(space, offset & 3); + return m_cmi02_pia[0]->read(space, offset & 3); case 0x26: m_maincpu2->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); @@ -1556,7 +1546,7 @@ READ8_MEMBER( cmi_state::cmi02_r ) return 0xff; case 0x28: case 0x29: case 0x2a: case 0x2b: - return m_cmi02_pia_1->read(space, offset & 3); + return m_cmi02_pia[1]->read(space, offset & 3); case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: return m_cmi02_ptm->read(space, offset & 7); @@ -1572,7 +1562,7 @@ WRITE8_MEMBER( cmi_state::cmi02_w ) { if (offset <= 0x1f) { - int ch_mask = m_cmi02_pia_0->a_output(); + int ch_mask = m_cmi02_pia[0]->a_output(); for (int i = 0; i < 8; ++i) { @@ -1585,11 +1575,11 @@ WRITE8_MEMBER( cmi_state::cmi02_w ) switch (offset) { case 0x20: case 0x21: case 0x22: case 0x23: - m_cmi02_pia_0->write(space, offset & 3, data); + m_cmi02_pia[0]->write(space, offset & 3, data); break; case 0x28: case 0x29: case 0x2a: case 0x2b: - m_cmi02_pia_1->write(space, offset & 3, data); + m_cmi02_pia[1]->write(space, offset & 3, data); break; case 0x30: @@ -1687,10 +1677,10 @@ void cmi_state::install_peripherals(int cpunum) else space->install_readwrite_handler(0xfc5f, 0xfc5f, read8_delegate(FUNC(cmi_state::map_r<0>),this), write8_delegate(FUNC(cmi_state::map_w<0>),this)); - space->install_readwrite_handler(0xfc80, 0xfc83, read8_delegate(FUNC(mos6551_device::read),m_q133_acia_0.target()), write8_delegate(FUNC(mos6551_device::write),m_q133_acia_0.target())); - space->install_readwrite_handler(0xfc84, 0xfc87, read8_delegate(FUNC(mos6551_device::read),m_q133_acia_1.target()), write8_delegate(FUNC(mos6551_device::write),m_q133_acia_1.target())); - space->install_readwrite_handler(0xfc88, 0xfc8b, read8_delegate(FUNC(mos6551_device::read),m_q133_acia_2.target()), write8_delegate(FUNC(mos6551_device::write),m_q133_acia_2.target())); - space->install_readwrite_handler(0xfc8c, 0xfc8f, read8_delegate(FUNC(mos6551_device::read),m_q133_acia_3.target()), write8_delegate(FUNC(mos6551_device::write),m_q133_acia_3.target())); + space->install_readwrite_handler(0xfc80, 0xfc83, read8_delegate(FUNC(mos6551_device::read),m_q133_acia[0].target()), write8_delegate(FUNC(mos6551_device::write),m_q133_acia[0].target())); + space->install_readwrite_handler(0xfc84, 0xfc87, read8_delegate(FUNC(mos6551_device::read),m_q133_acia[1].target()), write8_delegate(FUNC(mos6551_device::write),m_q133_acia[1].target())); + space->install_readwrite_handler(0xfc88, 0xfc8b, read8_delegate(FUNC(mos6551_device::read),m_q133_acia[2].target()), write8_delegate(FUNC(mos6551_device::write),m_q133_acia[2].target())); + space->install_readwrite_handler(0xfc8c, 0xfc8f, read8_delegate(FUNC(mos6551_device::read),m_q133_acia[3].target()), write8_delegate(FUNC(mos6551_device::write),m_q133_acia[3].target())); space->install_readwrite_handler(0xfc90, 0xfc97, read8_delegate(FUNC(ptm6840_device::read),m_q133_ptm.target()), write8_delegate(FUNC(ptm6840_device::write),m_q133_ptm.target())); space->install_readwrite_handler(0xfcbc, 0xfcbc, read8_delegate(FUNC(cmi_state::cmi07_r),this), write8_delegate(FUNC(cmi_state::cmi07_w),this)); @@ -1701,8 +1691,8 @@ void cmi_state::install_peripherals(int cpunum) space->install_readwrite_handler(0xfcd0, 0xfcdc, read8_delegate(FUNC(cmi_state::video_r),this), write8_delegate(FUNC(cmi_state::video_w),this)); space->install_readwrite_handler(0xfce0, 0xfce1, read8_delegate(FUNC(cmi_state::fdc_r),this), write8_delegate(FUNC(cmi_state::fdc_w),this)); space->nop_readwrite(0xfce2, 0xfcef); // Monitor ROM will attempt to detect floppy disk controller cards in this entire range - space->install_readwrite_handler(0xfcf0, 0xfcf7, read8_delegate(FUNC(pia6821_device::read),m_q133_pia_0.target()), write8_delegate(FUNC(pia6821_device::write),m_q133_pia_0.target())); - space->install_readwrite_handler(0xfcf8, 0xfcff, read8_delegate(FUNC(pia6821_device::read),m_q133_pia_1.target()), write8_delegate(FUNC(pia6821_device::write),m_q133_pia_1.target())); + space->install_readwrite_handler(0xfcf0, 0xfcf7, read8_delegate(FUNC(pia6821_device::read),m_q133_pia[0].target()), write8_delegate(FUNC(pia6821_device::write),m_q133_pia[0].target())); + space->install_readwrite_handler(0xfcf8, 0xfcff, read8_delegate(FUNC(pia6821_device::read),m_q133_pia[1].target()), write8_delegate(FUNC(pia6821_device::write),m_q133_pia[1].target())); space->install_write_handler(0xfcfc, 0xfcfc, write8_delegate(FUNC(cmi_state::i8214_cpu1_w),this)); space->install_write_handler(0xfcfd, 0xfcfd, write8_delegate(FUNC(cmi_state::i8214_cpu2_w),this)); @@ -1842,7 +1832,7 @@ WRITE_LINE_MEMBER( cmi_state::pia_q219_irqb ) READ8_MEMBER( cmi_state::q133_1_porta_r ) { - if (BIT(m_q133_pia_0->b_output(), 1)) + if (BIT(m_q133_pia[0]->b_output(), 1)) { return m_msm5832->data_r(space, m_msm5832_addr) << 4; } @@ -2025,10 +2015,8 @@ WRITE_LINE_MEMBER( cmi_state::mkbd_acia_clock ) m_acia_mkbd_kbd->write_txc(state); m_acia_mkbd_cmi->write_rxc(state); m_acia_mkbd_cmi->write_txc(state); - m_q133_acia_0->write_rxc(state); - m_q133_acia_1->write_rxc(state); - m_q133_acia_2->write_rxc(state); - m_q133_acia_3->write_rxc(state); + for (auto &acia : m_q133_acia) + acia->write_rxc(state); } WRITE_LINE_MEMBER( cmi_state::msm5832_irq ) @@ -2223,12 +2211,12 @@ MACHINE_CONFIG_START(cmi_state::cmi2x) MCFG_I8214_INT_CALLBACK(WRITELINE(*this, cmi_state, i8214_3_int_w)) MCFG_I8214_ENLG_CALLBACK(WRITELINE(*this, cmi_state, i8214_3_enlg)) - PIA6821(config, m_q133_pia_0, 0); // pia_q133_1_config - m_q133_pia_0->readpa_handler().set(FUNC(cmi_state::q133_1_porta_r)); - m_q133_pia_0->writepa_handler().set(FUNC(cmi_state::q133_1_porta_w)); - m_q133_pia_0->writepb_handler().set(FUNC(cmi_state::q133_1_portb_w)); + PIA6821(config, m_q133_pia[0], 0); // pia_q133_1_config + m_q133_pia[0]->readpa_handler().set(FUNC(cmi_state::q133_1_porta_r)); + m_q133_pia[0]->writepa_handler().set(FUNC(cmi_state::q133_1_porta_w)); + m_q133_pia[0]->writepb_handler().set(FUNC(cmi_state::q133_1_portb_w)); - PIA6821(config, m_q133_pia_1, 0); // pia_q133_2_config + PIA6821(config, m_q133_pia[1], 0); // pia_q133_2_config PTM6840(config, m_q133_ptm, 2000000); // ptm_q133_config m_q133_ptm->set_external_clocks(1024, 1, 111); // Third is todo @@ -2244,10 +2232,10 @@ MACHINE_CONFIG_START(cmi_state::cmi2x) m_q219_ptm->set_external_clocks(HBLANK_FREQ.dvalue(), VBLANK_FREQ.dvalue(), 1'000'000); // TODO: does the third thing come from a crystal? m_q219_ptm->irq_callback().set(FUNC(cmi_state::ptm_q219_irq)); - PIA6821(config, m_cmi02_pia_0, 0); // pia_cmi02_1_config - m_cmi02_pia_0->writepb_handler().set(FUNC(cmi_state::master_tune_w)); + PIA6821(config, m_cmi02_pia[0], 0); // pia_cmi02_1_config + m_cmi02_pia[0]->writepb_handler().set(FUNC(cmi_state::master_tune_w)); - PIA6821(config, m_cmi02_pia_1, 0); // pia_cmi02_2_config + PIA6821(config, m_cmi02_pia[1], 0); // pia_cmi02_2_config PTM6840(config, m_cmi02_ptm, 2000000); // ptm_cmi02_config TODO m_cmi02_ptm->o2_callback().set(FUNC(cmi_state::cmi02_ptm_o2)); @@ -2256,32 +2244,21 @@ MACHINE_CONFIG_START(cmi_state::cmi2x) MCFG_DEVICE_ADD("mkbd_acia_clock", CLOCK, 1.8432_MHz_XTAL / 12) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, cmi_state, mkbd_acia_clock)) - MCFG_DEVICE_ADD("q133_acia_0", MOS6551, 1.8432_MHz_XTAL) - MCFG_MOS6551_XTAL(1.8432_MHz_XTAL) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE("q133_acia_irq", input_merger_device, in_w<0>)) + for (auto &acia : m_q133_acia) + MOS6551(config, acia, 1.8432_MHz_XTAL).set_xtal(1.8432_MHz_XTAL); + m_q133_acia[0]->irq_handler().set("q133_acia_irq", FUNC(input_merger_device::in_w<0>)); + m_q133_acia[1]->irq_handler().set("q133_acia_irq", FUNC(input_merger_device::in_w<1>)); + m_q133_acia[2]->irq_handler().set("q133_acia_irq", FUNC(input_merger_device::in_w<2>)); + m_q133_acia[3]->irq_handler().set("q133_acia_irq", FUNC(input_merger_device::in_w<3>)); - MCFG_DEVICE_ADD("q133_acia_1", MOS6551, 1.8432_MHz_XTAL) - MCFG_MOS6551_XTAL(1.8432_MHz_XTAL) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE("q133_acia_irq", input_merger_device, in_w<1>)) - - MCFG_DEVICE_ADD("q133_acia_2", MOS6551, 1.8432_MHz_XTAL) - MCFG_MOS6551_XTAL(1.8432_MHz_XTAL) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE("q133_acia_irq", input_merger_device, in_w<2>)) - - MCFG_DEVICE_ADD("q133_acia_3", MOS6551, 1.8432_MHz_XTAL) - MCFG_MOS6551_XTAL(1.8432_MHz_XTAL) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE("q133_acia_irq", input_merger_device, in_w<3>)) - - MCFG_INPUT_MERGER_ANY_HIGH("q133_acia_irq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE(*this, cmi_state, q133_acia_irq)) + INPUT_MERGER_ANY_HIGH(config, "q133_acia_irq").output_handler().set(FUNC(cmi_state::q133_acia_irq)); ACIA6850(config, m_acia_mkbd_kbd, 1.8432_MHz_XTAL / 12); // acia_mkbd_kbd ACIA6850(config, m_acia_mkbd_cmi, 1.8432_MHz_XTAL / 12); // acia_mkbd_cmi PIA6821(config, m_ank_pia, 0); // pia_ank_config - MCFG_DEVICE_MODIFY("q133_acia_0") - MCFG_MOS6551_TXD_HANDLER(WRITELINE("acia_mkbd_cmi", acia6850_device, write_rxd)) - MCFG_MOS6551_RTS_HANDLER(WRITELINE("acia_mkbd_cmi", acia6850_device, write_cts)) + m_q133_acia[0]->txd_handler().set(m_acia_mkbd_cmi, FUNC(acia6850_device::write_rxd)); + m_q133_acia[0]->rts_handler().set(m_acia_mkbd_cmi, FUNC(acia6850_device::write_cts)); m_acia_mkbd_cmi->txd_handler().set("q133_acia_0", FUNC(mos6551_device::write_rxd)); m_acia_mkbd_cmi->rts_handler().set("q133_acia_0", FUNC(mos6551_device::write_cts)); diff --git a/src/mame/drivers/digel804.cpp b/src/mame/drivers/digel804.cpp index 16705e82aff..044c123aa54 100644 --- a/src/mame/drivers/digel804.cpp +++ b/src/mame/drivers/digel804.cpp @@ -651,12 +651,12 @@ MACHINE_CONFIG_START(digel804_state::digel804) MCFG_MM74C922_X4_CALLBACK(IOPORT("LINE3")) /* acia */ - MCFG_DEVICE_ADD("acia", MOS6551, 0) - MCFG_MOS6551_XTAL(3.6864_MHz_XTAL/2) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE(*this, digel804_state, acia_irq_w)) - MCFG_MOS6551_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd)) - MCFG_MOS6551_RTS_HANDLER(WRITELINE("rs232", rs232_port_device, write_rts)) - MCFG_MOS6551_DTR_HANDLER(WRITELINE("rs232", rs232_port_device, write_dtr)) + mos6551_device &acia(MOS6551(config, "acia", 0)); + acia.set_xtal(3.6864_MHz_XTAL/2); + acia.irq_handler().set(FUNC(digel804_state::acia_irq_w)); + acia.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); + acia.rts_handler().set("rs232", FUNC(rs232_port_device::write_rts)); + acia.dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr)); MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "null_modem") MCFG_RS232_RXD_HANDLER(WRITELINE("acia", mos6551_device, write_rxd)) @@ -681,8 +681,7 @@ MACHINE_CONFIG_START(ep804_state::ep804) MCFG_DEVICE_PROGRAM_MAP(z80_mem_804_1_2) MCFG_DEVICE_IO_MAP(z80_io_1_2) - MCFG_DEVICE_MODIFY("acia") - MCFG_MOS6551_IRQ_HANDLER(WRITELINE(*this, ep804_state, ep804_acia_irq_w)) + subdevice<mos6551_device>("acia")->irq_handler().set(FUNC(ep804_state::ep804_acia_irq_w)); m_ram->set_default_size("32K").set_extra_options("64K"); MACHINE_CONFIG_END diff --git a/src/mame/drivers/dragon.cpp b/src/mame/drivers/dragon.cpp index 593bb8a594d..216fcacff33 100644 --- a/src/mame/drivers/dragon.cpp +++ b/src/mame/drivers/dragon.cpp @@ -268,8 +268,8 @@ MACHINE_CONFIG_START(dragon64_state::dragon64) cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT); // acia - MCFG_DEVICE_ADD("acia", MOS6551, 0) - MCFG_MOS6551_XTAL(1.8432_MHz_XTAL) + mos6551_device &acia(MOS6551(config, "acia", 0)); + acia.set_xtal(1.8432_MHz_XTAL); // software lists MCFG_SOFTWARE_LIST_ADD("dragon_flex_list", "dragon_flex") @@ -321,8 +321,8 @@ MACHINE_CONFIG_START(dragon_alpha_state::dgnalpha) cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT); // acia - MCFG_DEVICE_ADD("acia", MOS6551, 0) - MCFG_MOS6551_XTAL(1.8432_MHz_XTAL) + mos6551_device &acia(MOS6551(config, "acia", 0)); + acia.set_xtal(1.8432_MHz_XTAL); // floppy MCFG_DEVICE_ADD(WD2797_TAG, WD2797, 1_MHz_XTAL) diff --git a/src/mame/drivers/ec65.cpp b/src/mame/drivers/ec65.cpp index 107892edff8..9f1988407fd 100644 --- a/src/mame/drivers/ec65.cpp +++ b/src/mame/drivers/ec65.cpp @@ -202,8 +202,8 @@ MACHINE_CONFIG_START(ec65_state::ec65) MCFG_DEVICE_ADD(VIA6522_1_TAG, VIA6522, XTAL(4'000'000) / 4) - MCFG_DEVICE_ADD(ACIA6551_TAG, MOS6551, 0) - MCFG_MOS6551_XTAL(XTAL(1'843'200)) + mos6551_device &acia(MOS6551(config, ACIA6551_TAG, 0)); + acia.set_xtal(XTAL(1'843'200)); MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0) MCFG_GENERIC_KEYBOARD_CB(PUT(ec65_state, kbd_put)) diff --git a/src/mame/drivers/hp2620.cpp b/src/mame/drivers/hp2620.cpp index 9e0276d3a69..0bf3e11c1c1 100644 --- a/src/mame/drivers/hp2620.cpp +++ b/src/mame/drivers/hp2620.cpp @@ -98,23 +98,24 @@ void hp2620_state::io_map(address_map &map) static INPUT_PORTS_START( hp2622 ) INPUT_PORTS_END -MACHINE_CONFIG_START(hp2620_state::hp2622) - MCFG_DEVICE_ADD("maincpu", Z80, XTAL(25'771'500) / 7) // 3.68 MHz - MCFG_DEVICE_PROGRAM_MAP(mem_map) - MCFG_DEVICE_IO_MAP(io_map) +void hp2620_state::hp2622(machine_config &config) +{ + Z80(config, m_maincpu, 25.7715_MHz_XTAL / 7); // 3.68 MHz + m_maincpu->set_addrmap(AS_PROGRAM, &hp2620_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &hp2620_state::io_map); - MCFG_NVRAM_ADD_0FILL("nvram") // 5101 (A7 tied to GND) + battery (+ wait states) + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // 5101 (A7 tied to GND) + battery (+ wait states) - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(XTAL(25'771'500), 1035, 0, 720, 415, 0, 390) // 498 total lines in 50 Hz mode - MCFG_SCREEN_UPDATE_DRIVER(hp2620_state, screen_update) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(25.7715_MHz_XTAL, 1035, 0, 720, 415, 0, 390); // 498 total lines in 50 Hz mode + screen.set_screen_update(FUNC(hp2620_state::screen_update)); - //MCFG_DEVICE_ADD("crtc", DP8367, XTAL(25'771'500)) + //DP8367(config, "crtc", 25.7715_MHz_XTAL).set_screen("screen"); - MCFG_DEVICE_ADD("acia", MOS6551, 0) // SY6551 - MCFG_MOS6551_XTAL(XTAL(25'771'500) / 14) // 1.84 MHz - MCFG_MOS6551_IRQ_HANDLER(INPUTLINE("maincpu", 0)) -MACHINE_CONFIG_END + mos6551_device &acia(MOS6551(config, "acia", 0)); // SY6551 + acia.set_xtal(25.7715_MHz_XTAL / 14); // 1.84 MHz + acia.irq_handler().set_inputline("maincpu", INPUT_LINE_IRQ0); +} /************************************************************************************************************** diff --git a/src/mame/drivers/microtan.cpp b/src/mame/drivers/microtan.cpp index 70badf7695d..57231a6fd30 100644 --- a/src/mame/drivers/microtan.cpp +++ b/src/mame/drivers/microtan.cpp @@ -209,7 +209,7 @@ GFXDECODE_END MACHINE_CONFIG_START(microtan_state::microtan) /* basic machine hardware */ - MCFG_DEVICE_ADD(m_maincpu, M6502, XTAL(6'000'000) / 8) // 750 kHz + MCFG_DEVICE_ADD(m_maincpu, M6502, 6_MHz_XTAL / 8) // 750 kHz MCFG_DEVICE_PROGRAM_MAP(main_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", microtan_state, interrupt) @@ -245,8 +245,8 @@ MACHINE_CONFIG_START(microtan_state::microtan) MCFG_CASSETTE_ADD( m_cassette ) /* acia */ - MCFG_DEVICE_ADD("acia", MOS6551, 0) - MCFG_MOS6551_XTAL(XTAL(1'843'200)) + mos6551_device &acia(MOS6551(config, "acia", 0)); + acia.set_xtal(1.8432_MHz_XTAL); /* via */ VIA6522(config, m_via6522[0], 6_MHz_XTAL / 8); @@ -257,7 +257,7 @@ MACHINE_CONFIG_START(microtan_state::microtan) m_via6522[0]->cb2_handler().set(FUNC(microtan_state::via_0_out_cb2)); m_via6522[0]->irq_handler().set(m_irq_line, FUNC(input_merger_device::in_w<IRQ_VIA_0>)); - MCFG_DEVICE_ADD(m_via6522[1], VIA6522, XTAL(6'000'000) / 8) + MCFG_DEVICE_ADD(m_via6522[1], VIA6522, 6_MHz_XTAL / 8) m_via6522[1]->writepa_handler().set(FUNC(microtan_state::via_1_out_a)); m_via6522[1]->writepb_handler().set(FUNC(microtan_state::via_1_out_b)); m_via6522[1]->ca2_handler().set(FUNC(microtan_state::via_1_out_ca2)); diff --git a/src/mame/drivers/novag6502.cpp b/src/mame/drivers/novag6502.cpp index 45115665565..2a2bd38d9fb 100644 --- a/src/mame/drivers/novag6502.cpp +++ b/src/mame/drivers/novag6502.cpp @@ -922,15 +922,16 @@ MACHINE_CONFIG_START(novag6502_state::sexpert) MCFG_TIMER_START_DELAY(attotime::from_hz(32.768_kHz_XTAL/128) - attotime::from_nsec(21500)) // active for 21.5us MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", novag6502_state, irq_off, attotime::from_hz(32.768_kHz_XTAL/128)) - MCFG_DEVICE_ADD("acia", MOS6551, 0) // R65C51P2 - RTS to CTS, DCD to GND - MCFG_MOS6551_XTAL(1.8432_MHz_XTAL) - MCFG_MOS6551_IRQ_HANDLER(INPUTLINE("maincpu", M6502_NMI_LINE)) - MCFG_MOS6551_RTS_HANDLER(WRITELINE("acia", mos6551_device, write_cts)) - MCFG_MOS6551_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd)) - MCFG_MOS6551_DTR_HANDLER(WRITELINE("rs232", rs232_port_device, write_dtr)) - MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(WRITELINE("acia", mos6551_device, write_rxd)) - MCFG_RS232_DSR_HANDLER(WRITELINE("acia", mos6551_device, write_dsr)) + mos6551_device &acia(MOS6551(config, "acia", 0)); // R65C51P2 - RTS to CTS, DCD to GND + acia.set_xtal(1.8432_MHz_XTAL); + acia.irq_handler().set_inputline("maincpu", m65c02_device::NMI_LINE); + acia.rts_handler().set("acia", FUNC(mos6551_device::write_cts)); + acia.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); + acia.dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr)); + + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr)); + rs232.rxd_handler().set("acia", FUNC(mos6551_device::write_rxd)); + rs232.dsr_handler().set("acia", FUNC(mos6551_device::write_dsr)); MCFG_NVRAM_ADD_1FILL("nvram") diff --git a/src/mame/drivers/novag68k.cpp b/src/mame/drivers/novag68k.cpp index 1e553a78fd7..3c1ad078156 100644 --- a/src/mame/drivers/novag68k.cpp +++ b/src/mame/drivers/novag68k.cpp @@ -244,8 +244,8 @@ MACHINE_CONFIG_START(novag68k_state::diablo68k) MCFG_TIMER_START_DELAY(attotime::from_hz(32.768_kHz_XTAL/128) - attotime::from_nsec(1100)) // active for 1.1us MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", novag68k_state, irq_off, attotime::from_hz(32.768_kHz_XTAL/128)) - MCFG_DEVICE_ADD("acia", MOS6551, 0) - MCFG_MOS6551_XTAL(1.8432_MHz_XTAL) + mos6551_device &acia(MOS6551(config, "acia", 0)); + acia.set_xtal(1.8432_MHz_XTAL); MCFG_NVRAM_ADD_0FILL("nvram") diff --git a/src/mame/drivers/rvoice.cpp b/src/mame/drivers/rvoice.cpp index 351ebde9d69..f2cabc9ed8c 100644 --- a/src/mame/drivers/rvoice.cpp +++ b/src/mame/drivers/rvoice.cpp @@ -377,8 +377,8 @@ MACHINE_CONFIG_START(rvoice_state::rvoicepc) //MCFG_DEVICE_IO_MAP(hd63701_slave_io) MCFG_QUANTUM_TIME(attotime::from_hz(60)) - MCFG_DEVICE_ADD("acia65c51", MOS6551, 0) - MCFG_MOS6551_XTAL(XTAL(1'843'200)) + mos6551_device &acia(MOS6551(config, "acia65c51", 0)); + acia.set_xtal(1.8432_MHz_XTAL); /* video hardware */ diff --git a/src/mame/drivers/tek440x.cpp b/src/mame/drivers/tek440x.cpp index fda9931f5fc..187716c028e 100644 --- a/src/mame/drivers/tek440x.cpp +++ b/src/mame/drivers/tek440x.cpp @@ -196,7 +196,7 @@ INPUT_PORTS_END MACHINE_CONFIG_START(tek440x_state::tek4404) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68010, XTAL(40'000'000) / 4) // MC68010L10 + MCFG_DEVICE_ADD("maincpu", M68010, 40_MHz_XTAL / 4) // MC68010L10 MCFG_DEVICE_PROGRAM_MAP(maincpu_map) MCFG_DEVICE_ADD("fdccpu", M6502, 1000000) @@ -213,17 +213,17 @@ MACHINE_CONFIG_START(tek440x_state::tek4404) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD_MONOCHROME("palette") - MCFG_DEVICE_ADD("aica", MOS6551, 0) - MCFG_MOS6551_XTAL(XTAL(1'843'200)) - MCFG_MOS6551_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd)) + mos6551_device &aica(MOS6551(config, "aica", 0)); + aica.set_xtal(1.8432_MHz_XTAL); + aica.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); - MCFG_DEVICE_ADD("timer", AM9513, XTAL(40'000'000) / 4 / 10) // from CPU E output + AM9513(config, "timer", 40_MHz_XTAL / 4 / 10); // from CPU E output - MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(WRITELINE("aica", mos6551_device, write_rxd)) - MCFG_RS232_DCD_HANDLER(WRITELINE("aica", mos6551_device, write_dcd)) - MCFG_RS232_DSR_HANDLER(WRITELINE("aica", mos6551_device, write_dsr)) - MCFG_RS232_CTS_HANDLER(WRITELINE("aica", mos6551_device, write_cts)) + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr)); + rs232.rxd_handler().set("aica", FUNC(mos6551_device::write_rxd)); + rs232.dcd_handler().set("aica", FUNC(mos6551_device::write_dcd)); + rs232.dsr_handler().set("aica", FUNC(mos6551_device::write_dsr)); + rs232.cts_handler().set("aica", FUNC(mos6551_device::write_cts)); SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/thomson.cpp b/src/mame/drivers/thomson.cpp index 8a0da131b73..eaeffae616a 100644 --- a/src/mame/drivers/thomson.cpp +++ b/src/mame/drivers/thomson.cpp @@ -719,16 +719,16 @@ MACHINE_CONFIG_START(thomson_state::to7) m_pia_game->irqb_handler().set("mainirq", FUNC(input_merger_device::in_w<1>)); /* TODO: CONVERT THIS TO A SLOT DEVICE (RF 57-932) */ - MCFG_DEVICE_ADD("acia", MOS6551, 0) - MCFG_MOS6551_XTAL(1.8432_MHz_XTAL) - MCFG_MOS6551_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd)) + mos6551_device &acia(MOS6551(config, "acia", 0)); + acia.set_xtal(1.8432_MHz_XTAL); + acia.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); /// 2400 7N2 - MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(WRITELINE("acia", mos6551_device, write_rxd)) - MCFG_RS232_DCD_HANDLER(WRITELINE("acia", mos6551_device, write_dcd)) - MCFG_RS232_DSR_HANDLER(WRITELINE("acia", mos6551_device, write_dsr)) - MCFG_RS232_CTS_HANDLER(WRITELINE("acia", mos6551_device, write_cts)) + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr)); + rs232.rxd_handler().set("acia", FUNC(mos6551_device::write_rxd)); + rs232.dcd_handler().set("acia", FUNC(mos6551_device::write_dcd)); + rs232.dsr_handler().set("acia", FUNC(mos6551_device::write_dsr)); + rs232.cts_handler().set("acia", FUNC(mos6551_device::write_cts)); /* TODO: CONVERT THIS TO A SLOT DEVICE (CC 90-232) */ diff --git a/src/mame/drivers/tv910.cpp b/src/mame/drivers/tv910.cpp index 3380f785186..42938bbd6a8 100644 --- a/src/mame/drivers/tv910.cpp +++ b/src/mame/drivers/tv910.cpp @@ -39,7 +39,7 @@ #define RS232_TAG "rs232" #define KBDC_TAG "ay3600" -#define MASTER_CLOCK XTAL(13'608'000) +#define MASTER_CLOCK 13.608_MHz_XTAL class tv910_state : public driver_device { @@ -543,16 +543,16 @@ MACHINE_CONFIG_START(tv910_state::tv910) MCFG_AY3600_DATA_READY_CB(WRITELINE(*this, tv910_state, ay3600_data_ready_w)) MCFG_AY3600_AKO_CB(WRITELINE(*this, tv910_state, ay3600_ako_w)) - MCFG_DEVICE_ADD(ACIA_TAG, MOS6551, 0) - MCFG_MOS6551_XTAL(XTAL(1'843'200)) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE("mainirq", input_merger_device, in_w<1>)) - MCFG_MOS6551_TXD_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_txd)) - MCFG_MOS6551_RTS_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_rts)) + mos6551_device &acia(MOS6551(config, ACIA_TAG, 0)); + acia.set_xtal(1.8432_MHz_XTAL); + acia.irq_handler().set("mainirq", FUNC(input_merger_device::in_w<1>)); + acia.txd_handler().set(RS232_TAG, FUNC(rs232_port_device::write_txd)); + acia.rts_handler().set(RS232_TAG, FUNC(rs232_port_device::write_rts)); - MCFG_DEVICE_ADD(RS232_TAG, RS232_PORT, default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(WRITELINE(ACIA_TAG, mos6551_device, write_rxd)) - MCFG_RS232_DCD_HANDLER(WRITELINE(ACIA_TAG, mos6551_device, write_dcd)) - MCFG_RS232_CTS_HANDLER(WRITELINE(ACIA_TAG, mos6551_device, write_cts)) + rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr)); + rs232.rxd_handler().set(ACIA_TAG, FUNC(mos6551_device::write_rxd)); + rs232.dcd_handler().set(ACIA_TAG, FUNC(mos6551_device::write_dcd)); + rs232.cts_handler().set(ACIA_TAG, FUNC(mos6551_device::write_cts)); SPEAKER(config, "mono").front_center(); MCFG_DEVICE_ADD("bell", BEEP, MASTER_CLOCK / 8400) // 1620 Hz (Row 10 signal) diff --git a/src/mame/drivers/tv912.cpp b/src/mame/drivers/tv912.cpp index 8c5c7bc34fa..4fada0f6ec3 100644 --- a/src/mame/drivers/tv912.cpp +++ b/src/mame/drivers/tv912.cpp @@ -255,7 +255,7 @@ void tv912_state::device_timer(emu_timer &timer, device_timer_id id, int param, if (!BIT(sel, b)) { unsigned divisor = 11 * (b < 9 ? 1 << b : 176); - m_baudgen_timer->adjust(attotime::from_hz(XTAL(23'814'000) / 3.5 / divisor), !param); + m_baudgen_timer->adjust(attotime::from_hz(23.814_MHz_XTAL / 3.5 / divisor), !param); break; } } diff --git a/src/mame/drivers/tv955.cpp b/src/mame/drivers/tv955.cpp index 5765a1771b0..3139ada09ff 100644 --- a/src/mame/drivers/tv955.cpp +++ b/src/mame/drivers/tv955.cpp @@ -106,17 +106,17 @@ MACHINE_CONFIG_START(tv955_state::tv955) MCFG_SCN2674_INTR_CALLBACK(INPUTLINE("maincpu", m6502_device::NMI_LINE)) MCFG_VIDEO_SET_SCREEN("screen") - MCFG_DEVICE_ADD("hostuart", MOS6551, 0) - MCFG_MOS6551_XTAL(3.6864_MHz_XTAL) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE("mainirq", input_merger_device, in_w<0>)) + MOS6551(config, m_hostuart, 0); + m_hostuart->set_xtal(3.6864_MHz_XTAL); + m_hostuart->irq_handler().set("mainirq", FUNC(input_merger_device::in_w<0>)); - MCFG_DEVICE_ADD("printuart", MOS6551, 0) - MCFG_MOS6551_XTAL(3.6864_MHz_XTAL / 2) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE("mainirq", input_merger_device, in_w<1>)) + mos6551_device &printuart(MOS6551(config, "printuart", 0)); + printuart.set_xtal(3.6864_MHz_XTAL / 2); + printuart.irq_handler().set("mainirq", FUNC(input_merger_device::in_w<1>)); - MCFG_DEVICE_ADD("keybuart", MOS6551, 0) - MCFG_MOS6551_XTAL(3.6864_MHz_XTAL / 2) - MCFG_MOS6551_IRQ_HANDLER(WRITELINE("mainirq", input_merger_device, in_w<2>)) + mos6551_device &keybuart(MOS6551(config, "keybuart", 0)); + keybuart.set_xtal(3.6864_MHz_XTAL / 2); + keybuart.irq_handler().set("mainirq", FUNC(input_merger_device::in_w<2>)); MACHINE_CONFIG_END /************************************************************************************************************** diff --git a/src/mame/drivers/tv965.cpp b/src/mame/drivers/tv965.cpp index 1d486003fa2..472dc633463 100644 --- a/src/mame/drivers/tv965.cpp +++ b/src/mame/drivers/tv965.cpp @@ -88,11 +88,11 @@ MACHINE_CONFIG_START(tv965_state::tv965) MCFG_SCN2672_INTR_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) MCFG_VIDEO_SET_SCREEN("screen") - MCFG_DEVICE_ADD("acia1", MOS6551, 0) - MCFG_MOS6551_XTAL(3.6864_MHz_XTAL / 2) // divider not verified, possibly even programmable + mos6551_device &acia1(MOS6551(config, "acia1", 0)); + acia1.set_xtal(3.6864_MHz_XTAL / 2); // divider not verified, possibly even programmable - MCFG_DEVICE_ADD("acia2", MOS6551, 0) - MCFG_MOS6551_XTAL(3.6864_MHz_XTAL / 2) // divider not verified, possibly even programmable + mos6551_device &acia2(MOS6551(config, "acia2", 0)); + acia2.set_xtal(3.6864_MHz_XTAL / 2); // divider not verified, possibly even programmable MACHINE_CONFIG_END /************************************************************************************************************** |