summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2018-09-04 17:22:51 +0200
committer mooglyguy <therealmogminer@gmail.com>2018-09-04 17:23:03 +0200
commitde24e3bfdcd160b348aba60aa43333b1e411a706 (patch)
tree0534ddbbed3538b54ad1a070992a2b05686e90b1
parent9ee8c458e2f57ebbe7f56a4045cc4294b2fef469 (diff)
-ie15kbd, im6402, ins8154: De-MCFG, nw
-rw-r--r--src/devices/machine/ie15.cpp4
-rw-r--r--src/devices/machine/ie15_kbd.h14
-rw-r--r--src/devices/machine/im6402.h44
-rw-r--r--src/devices/machine/ins8154.h40
-rw-r--r--src/mame/drivers/acrnsys.cpp8
-rw-r--r--src/mame/drivers/acrnsys1.cpp8
-rw-r--r--src/mame/drivers/kyocera.cpp21
-rw-r--r--src/mame/drivers/mk14.cpp6
-rw-r--r--src/mame/drivers/vega.cpp10
-rw-r--r--src/mame/drivers/wangpc.cpp8
10 files changed, 48 insertions, 115 deletions
diff --git a/src/devices/machine/ie15.cpp b/src/devices/machine/ie15.cpp
index 6b60489504d..eed7555a657 100644
--- a/src/devices/machine/ie15.cpp
+++ b/src/devices/machine/ie15.cpp
@@ -577,8 +577,8 @@ MACHINE_CONFIG_START(ie15_device::ie15core)
config.set_default_layout(layout_ie15);
/* Devices */
- MCFG_DEVICE_ADD("keyboard", IE15_KEYBOARD, 0)
- MCFG_IE15_KEYBOARD_CB(WRITE16(*this, ie15_device, kbd_put))
+ IE15_KEYBOARD(config, m_keyboard, 0)
+ .keyboard_cb().set(FUNC(ie15_device::kbd_put));
MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "null_modem")
MCFG_RS232_RXD_HANDLER(WRITELINE(*this, ie15_device, serial_rx_callback))
diff --git a/src/devices/machine/ie15_kbd.h b/src/devices/machine/ie15_kbd.h
index d0d38286b8d..9b7a4d802e4 100644
--- a/src/devices/machine/ie15_kbd.h
+++ b/src/devices/machine/ie15_kbd.h
@@ -5,18 +5,6 @@
#pragma once
-
-/***************************************************************************
- DEVICE CONFIGURATION MACROS
-***************************************************************************/
-
-#define MCFG_IE15_KEYBOARD_CB(_devcb) \
- downcast<ie15_keyboard_device &>(*device).set_keyboard_callback(DEVCB_##_devcb);
-
-/***************************************************************************
- FUNCTION PROTOTYPES
-***************************************************************************/
-
class ie15_keyboard_device : public device_t
{
public:
@@ -47,7 +35,7 @@ public:
ie15_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_keyboard_callback(Object &&cb) { return m_keyboard_cb.set_callback(std::forward<Object>(cb)); }
+ auto keyboard_cb() { return m_keyboard_cb.bind(); }
protected:
ie15_keyboard_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/devices/machine/im6402.h b/src/devices/machine/im6402.h
index 7feb7fed1c2..6729b4da984 100644
--- a/src/devices/machine/im6402.h
+++ b/src/devices/machine/im6402.h
@@ -43,49 +43,21 @@
#include "diserial.h"
-
-
-/***************************************************************************
- INTERFACE CONFIGURATION MACROS
-***************************************************************************/
-
-#define MCFG_IM6402_ADD(_tag, _rrc, _trc) \
- MCFG_DEVICE_ADD(_tag, IM6402, 0) \
- downcast<im6402_device &>(*device).set_rrc(_rrc); \
- downcast<im6402_device &>(*device).set_trc(_trc);
-
-#define MCFG_IM6402_TRO_CALLBACK(_write) \
- downcast<im6402_device &>(*device).set_tro_wr_callback(DEVCB_##_write);
-
-#define MCFG_IM6402_DR_CALLBACK(_write) \
- downcast<im6402_device &>(*device).set_dr_wr_callback(DEVCB_##_write);
-
-#define MCFG_IM6402_TBRE_CALLBACK(_write) \
- downcast<im6402_device &>(*device).set_tbre_wr_callback(DEVCB_##_write);
-
-#define MCFG_IM6402_TRE_CALLBACK(_write) \
- downcast<im6402_device &>(*device).set_tre_wr_callback(DEVCB_##_write);
-
-
-
-/***************************************************************************
- TYPE DEFINITIONS
-***************************************************************************/
-
-// ======================> im6402_device
-
class im6402_device : public device_t, public device_serial_interface
{
public:
// construction/destruction
+ im6402_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t rrc, uint32_t trc)
+ : im6402_device(mconfig, tag, owner, 0)
+ {
+ set_rrc(rrc);
+ set_trc(trc);
+ }
+
im6402_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void set_rrc(int rrc) { m_rrc = rrc; }
void set_trc(int trc) { m_trc = trc; }
- template <class Object> devcb_base &set_tro_wr_callback(Object &&cb) { return m_write_tro.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_dr_wr_callback(Object &&cb) { return m_write_dr.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_tbre_wr_callback(Object &&cb) { return m_write_tbre.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_tre_wr_callback(Object &&cb) { return m_write_tre.set_callback(std::forward<Object>(cb)); }
auto tro_callback() { return m_write_tro.bind(); }
auto dr_callback() { return m_write_dr.bind(); }
@@ -164,8 +136,6 @@ private:
int m_trc_count;
};
-
-// device type definition
DECLARE_DEVICE_TYPE(IM6402, im6402_device)
#endif // MAME_MACHINE_IM6402_H
diff --git a/src/devices/machine/ins8154.h b/src/devices/machine/ins8154.h
index 9f401c87f2d..5ba94ab9cda 100644
--- a/src/devices/machine/ins8154.h
+++ b/src/devices/machine/ins8154.h
@@ -35,45 +35,17 @@
#pragma once
-
-
-
-/***************************************************************************
- DEVICE CONFIGURATION MACROS
-***************************************************************************/
-
-#define MCFG_INS8154_IN_A_CB(_devcb) \
- downcast<ins8154_device &>(*device).set_in_a_callback(DEVCB_##_devcb);
-
-#define MCFG_INS8154_OUT_A_CB(_devcb) \
- downcast<ins8154_device &>(*device).set_out_a_callback(DEVCB_##_devcb);
-
-#define MCFG_INS8154_IN_B_CB(_devcb) \
- downcast<ins8154_device &>(*device).set_in_b_callback(DEVCB_##_devcb);
-
-#define MCFG_INS8154_OUT_B_CB(_devcb) \
- downcast<ins8154_device &>(*device).set_out_b_callback(DEVCB_##_devcb);
-
-#define MCFG_INS8154_OUT_IRQ_CB(_devcb) \
- downcast<ins8154_device &>(*device).set_out_irq_callback(DEVCB_##_devcb); //currently unused
-
-/***************************************************************************
- TYPE DEFINITIONS
-***************************************************************************/
-
-// ======================> ins8154_device
-
class ins8154_device : public device_t
{
public:
// construction/destruction
- ins8154_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ ins8154_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
- template <class Object> devcb_base &set_in_a_callback(Object &&cb) { return m_in_a_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_a_callback(Object &&cb) { return m_out_a_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_b_callback(Object &&cb) { return m_in_b_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_b_callback(Object &&cb) { return m_out_b_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
+ auto in_a() { return m_in_a_cb.bind(); }
+ auto out_a() { return m_out_a_cb.bind(); }
+ auto in_b() { return m_in_b_cb.bind(); }
+ auto out_b() { return m_out_b_cb.bind(); }
+ auto out_irq() { return m_out_irq_cb.bind(); }
DECLARE_READ8_MEMBER( ins8154_r );
DECLARE_WRITE8_MEMBER( ins8154_w );
diff --git a/src/mame/drivers/acrnsys.cpp b/src/mame/drivers/acrnsys.cpp
index 94c91935613..dff9c24849e 100644
--- a/src/mame/drivers/acrnsys.cpp
+++ b/src/mame/drivers/acrnsys.cpp
@@ -366,10 +366,10 @@ MACHINE_CONFIG_START(acrnsys_state::a6502)
INPUT_MERGER_ANY_HIGH(config, m_irqs).output_handler().set_inputline(m_maincpu, M6502_IRQ_LINE);
- MCFG_DEVICE_ADD(m_ins8154, INS8154, 0)
- //MCFG_INS8154_IN_A_CB(READ8(*this, acrnsys_state, ins8154_pa_r))
- //MCFG_INS8154_OUT_A_CB(WRITE8(*this, acrnsys_state, ins8154_pa_w))
- MCFG_INS8154_IN_B_CB(READ8(*this, acrnsys_state, kbd_r))
+ INS8154(config, m_ins8154);
+ //m_ins8154->in_a().set(FUNC(acrnsys_state::ins8154_pa_r));
+ //m_ins8154->out_a().set(FUNC(acrnsys_state::ins8154_pa_w));
+ m_ins8154->in_b().set(FUNC(acrnsys_state::kbd_r));
MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0)
MCFG_GENERIC_KEYBOARD_CB(PUT(acrnsys_state, kbd_put))
diff --git a/src/mame/drivers/acrnsys1.cpp b/src/mame/drivers/acrnsys1.cpp
index 4cbd307f9d9..0d33002b5b0 100644
--- a/src/mame/drivers/acrnsys1.cpp
+++ b/src/mame/drivers/acrnsys1.cpp
@@ -276,10 +276,10 @@ MACHINE_CONFIG_START(acrnsys1_state::acrnsys1)
WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25);
/* devices */
- MCFG_DEVICE_ADD("b1", INS8154, 0)
- MCFG_INS8154_IN_A_CB(READ8(*this, acrnsys1_state, ins8154_b1_port_a_r))
- MCFG_INS8154_OUT_A_CB(WRITE8(*this, acrnsys1_state, ins8154_b1_port_a_w))
- MCFG_INS8154_OUT_B_CB(WRITE8(*this, acrnsys1_state, acrnsys1_led_segment_w))
+ ins8154_device &b1(INS8154(config, "b1"));
+ b1.in_a().set(FUNC(acrnsys1_state::ins8154_b1_port_a_r));
+ b1.out_a().set(FUNC(acrnsys1_state::ins8154_b1_port_a_w));
+ b1.out_b().set(FUNC(acrnsys1_state::acrnsys1_led_segment_w));
TTL74145(config, m_ttl74145, 0);
diff --git a/src/mame/drivers/kyocera.cpp b/src/mame/drivers/kyocera.cpp
index e9cd74dbec9..4d76285f6d5 100644
--- a/src/mame/drivers/kyocera.cpp
+++ b/src/mame/drivers/kyocera.cpp
@@ -1371,10 +1371,11 @@ MACHINE_CONFIG_START(kc85_state::kc85)
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL(32'768), NOOP, INPUTLINE(I8085_TAG, I8085_RST75_LINE))
- MCFG_IM6402_ADD(IM6402_TAG, 0, 0)
- MCFG_IM6402_TRO_CALLBACK(WRITELINE(RS232_TAG, rs232_port_device, write_txd))
+ IM6402(config, m_uart, 0, 0);
+ m_uart->tro_callback().set(RS232_TAG, FUNC(rs232_port_device::write_txd));
+
MCFG_DEVICE_ADD(RS232_TAG, RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE(IM6402_TAG, im6402_device, write_rri))
+ MCFG_RS232_RXD_HANDLER(WRITELINE(m_uart, im6402_device, write_rri))
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, kc85_state, write_centronics_busy))
@@ -1419,10 +1420,11 @@ MACHINE_CONFIG_START(pc8201_state::pc8201)
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL(32'768), NOOP, INPUTLINE(I8085_TAG, I8085_RST75_LINE))
- MCFG_IM6402_ADD(IM6402_TAG, 0, 0)
- MCFG_IM6402_TRO_CALLBACK(WRITELINE(RS232_TAG, rs232_port_device, write_txd))
+ IM6402(config, m_uart, 0, 0);
+ m_uart->tro_callback().set(RS232_TAG, FUNC(rs232_port_device::write_txd));
+
MCFG_DEVICE_ADD(RS232_TAG, RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE(IM6402_TAG, im6402_device, write_rri))
+ MCFG_RS232_RXD_HANDLER(WRITELINE(m_uart, im6402_device, write_rri))
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, kc85_state, write_centronics_busy))
@@ -1477,10 +1479,11 @@ MACHINE_CONFIG_START(trsm100_state::trsm100)
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL(32'768), NOOP, INPUTLINE(I8085_TAG, I8085_RST75_LINE))
- MCFG_IM6402_ADD(IM6402_TAG, 0, 0)
- MCFG_IM6402_TRO_CALLBACK(WRITELINE(RS232_TAG, rs232_port_device, write_txd))
+ IM6402(config, m_uart, 0, 0);
+ m_uart->tro_callback().set(RS232_TAG, FUNC(rs232_port_device::write_txd));
+
MCFG_DEVICE_ADD(RS232_TAG, RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE(IM6402_TAG, im6402_device, write_rri))
+ MCFG_RS232_RXD_HANDLER(WRITELINE(m_uart, im6402_device, write_rri))
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
MCFG_CASSETTE_ADD("cassette")
diff --git a/src/mame/drivers/mk14.cpp b/src/mame/drivers/mk14.cpp
index f192a1874e6..118f25be403 100644
--- a/src/mame/drivers/mk14.cpp
+++ b/src/mame/drivers/mk14.cpp
@@ -221,9 +221,9 @@ MACHINE_CONFIG_START(mk14_state::mk14)
MCFG_SOUND_ROUTE(0, "dac8", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac8", -1.0, DAC_VREF_NEG_INPUT)
/* devices */
- MCFG_DEVICE_ADD("ic8", INS8154, 0)
- MCFG_INS8154_OUT_A_CB(WRITE8(*this, mk14_state, port_a_w))
- MCFG_INS8154_OUT_B_CB(WRITE8("dac8", dac_byte_interface, data_w))
+ ins8154_device &ic8(INS8154(config, "ic8"));
+ ic8.out_a().set(FUNC(mk14_state::port_a_w));
+ ic8.out_b().set("dac8", FUNC(dac_byte_interface::data_w));
MCFG_CASSETTE_ADD( "cassette" )
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/vega.cpp b/src/mame/drivers/vega.cpp
index 33f48771b13..bd41fd23800 100644
--- a/src/mame/drivers/vega.cpp
+++ b/src/mame/drivers/vega.cpp
@@ -816,11 +816,11 @@ MACHINE_CONFIG_START(vega_state::vega)
m_i8255->out_pb_callback().set(FUNC(vega_state::ppi_pb_w));
m_i8255->out_pc_callback().set(FUNC(vega_state::ppi_pc_w));
- MCFG_DEVICE_ADD( "ins8154", INS8154, 0 )
- MCFG_INS8154_IN_A_CB(READ8(*this, vega_state, ins8154_pa_r))
- MCFG_INS8154_OUT_A_CB(WRITE8(*this, vega_state, ins8154_pa_w))
- MCFG_INS8154_IN_B_CB(READ8(*this, vega_state, ins8154_pb_r))
- MCFG_INS8154_OUT_B_CB(WRITE8(*this, vega_state, ins8154_pb_w))
+ INS8154(config, m_ins8154);
+ m_ins8154->in_a().set(FUNC(vega_state::ins8154_pa_r));
+ m_ins8154->out_a().set(FUNC(vega_state::ins8154_pa_w));
+ m_ins8154->in_b().set(FUNC(vega_state::ins8154_pb_r));
+ m_ins8154->out_b().set(FUNC(vega_state::ins8154_pb_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/wangpc.cpp b/src/mame/drivers/wangpc.cpp
index f493d97feba..1100b867722 100644
--- a/src/mame/drivers/wangpc.cpp
+++ b/src/mame/drivers/wangpc.cpp
@@ -1314,10 +1314,10 @@ MACHINE_CONFIG_START(wangpc_state::wangpc)
m_pit->set_clk<2>(500000);
m_pit->out_handler<2>().set(FUNC(wangpc_state::pit2_w));
- MCFG_IM6402_ADD(IM6402_TAG, 62500*16, 62500*16)
- MCFG_IM6402_TRO_CALLBACK(WRITELINE("wangpckb", wangpc_keyboard_device, write_rxd))
- MCFG_IM6402_DR_CALLBACK(WRITELINE(*this, wangpc_state, uart_dr_w))
- MCFG_IM6402_TBRE_CALLBACK(WRITELINE(*this, wangpc_state, uart_tbre_w))
+ IM6402(config, m_uart, 62500*16, 62500*16);
+ m_uart->tro_callback().set("wangpckb", FUNC(wangpc_keyboard_device::write_rxd));
+ m_uart->dr_callback().set(FUNC(wangpc_state::uart_dr_w));
+ m_uart->tbre_callback().set(FUNC(wangpc_state::uart_tbre_w));
MCFG_DEVICE_ADD(SCN2661_TAG, MC2661, 0)
MCFG_MC2661_TXD_HANDLER(WRITELINE(RS232_TAG, rs232_port_device, write_txd))