summaryrefslogtreecommitdiffstats
path: root/src/mame/machine
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine')
-rw-r--r--src/mame/machine/315_5296.h102
-rw-r--r--src/mame/machine/315_5338a.h83
-rw-r--r--src/mame/machine/315_5649.h52
-rw-r--r--src/mame/machine/6883sam.h2
-rw-r--r--src/mame/machine/abc80kb.h2
-rw-r--r--src/mame/machine/acs8600_ics.cpp122
-rw-r--r--src/mame/machine/acs8600_ics.h43
-rw-r--r--src/mame/machine/apollo.cpp16
-rw-r--r--src/mame/machine/apollo_kbd.h4
-rw-r--r--src/mame/machine/apricotkb.h2
-rw-r--r--src/mame/machine/at.cpp48
-rw-r--r--src/mame/machine/atarigen.h2
-rw-r--r--src/mame/machine/balsente.cpp5
-rw-r--r--src/mame/machine/c117.h2
-rw-r--r--src/mame/machine/cammu.h2
-rw-r--r--src/mame/machine/cat702.h2
-rw-r--r--src/mame/machine/cit101_kbd.h2
-rw-r--r--src/mame/machine/compiskb.h2
-rw-r--r--src/mame/machine/cuda.h8
-rw-r--r--src/mame/machine/dec_lk201.h2
-rw-r--r--src/mame/machine/deco104.h4
-rw-r--r--src/mame/machine/deco146.h12
-rw-r--r--src/mame/machine/deco_irq.h12
-rw-r--r--src/mame/machine/egret.h8
-rw-r--r--src/mame/machine/esqpanel.h4
-rw-r--r--src/mame/machine/fm_scsi.h4
-rw-r--r--src/mame/machine/gaelco3d.h2
-rw-r--r--src/mame/machine/hp9845_printer.h6
-rw-r--r--src/mame/machine/ibm6580_fdc.h6
-rw-r--r--src/mame/machine/ibm6580_kbd.h15
-rw-r--r--src/mame/machine/interpro_ioga.h27
-rw-r--r--src/mame/machine/interpro_sga.h2
-rw-r--r--src/mame/machine/ioptimer.h2
-rw-r--r--src/mame/machine/isbc_208.h2
-rw-r--r--src/mame/machine/isbc_215g.h2
-rw-r--r--src/mame/machine/k573cass.h18
-rw-r--r--src/mame/machine/kay_kbd.h8
-rw-r--r--src/mame/machine/kc_keyb.h2
-rw-r--r--src/mame/machine/km035.h4
-rw-r--r--src/mame/machine/m24_kbd.h2
-rw-r--r--src/mame/machine/m24_z8000.h2
-rw-r--r--src/mame/machine/mackbd.cpp25
-rw-r--r--src/mame/machine/mackbd.h2
-rw-r--r--src/mame/machine/microdrv.h2
-rw-r--r--src/mame/machine/micropolis.h6
-rw-r--r--src/mame/machine/midikbd.h2
-rw-r--r--src/mame/machine/midwayic.h6
-rw-r--r--src/mame/machine/mm1kb.h2
-rw-r--r--src/mame/machine/model1io.cpp49
-rw-r--r--src/mame/machine/model1io.h32
-rw-r--r--src/mame/machine/model1io2.cpp98
-rw-r--r--src/mame/machine/model1io2.h32
-rw-r--r--src/mame/machine/ms7004.h4
-rw-r--r--src/mame/machine/msx_matsushita.h2
-rw-r--r--src/mame/machine/namco06.h24
-rw-r--r--src/mame/machine/namco51.h14
-rw-r--r--src/mame/machine/namco53.h15
-rw-r--r--src/mame/machine/namco62.h12
-rw-r--r--src/mame/machine/namco_c148.h4
-rw-r--r--src/mame/machine/namcoio.h39
-rw-r--r--src/mame/machine/nb1412m2.h2
-rw-r--r--src/mame/machine/nextkbd.h6
-rw-r--r--src/mame/machine/nextmo.h4
-rw-r--r--src/mame/machine/pc1512kb.h4
-rw-r--r--src/mame/machine/pc9801_kbd.h2
-rw-r--r--src/mame/machine/pcd_kbd.h2
-rw-r--r--src/mame/machine/pcshare.cpp4
-rw-r--r--src/mame/machine/ps2timer.h3
-rw-r--r--src/mame/machine/psxcd.h2
-rw-r--r--src/mame/machine/qimi.h2
-rw-r--r--src/mame/machine/rad_eu3a05gpio.h6
-rw-r--r--src/mame/machine/segaic16.h15
-rw-r--r--src/mame/machine/seibucop/seibucop.h4
-rw-r--r--src/mame/machine/tait8741.h8
-rw-r--r--src/mame/machine/taito68705interface.h6
-rw-r--r--src/mame/machine/taitocchip.h14
-rw-r--r--src/mame/machine/taitoio.h140
-rw-r--r--src/mame/machine/taitosjsec.h8
-rw-r--r--src/mame/machine/tandy2kb.h4
-rw-r--r--src/mame/machine/trs80m2kb.h2
-rw-r--r--src/mame/machine/upd65031.h12
-rw-r--r--src/mame/machine/v1050kb.h2
-rw-r--r--src/mame/machine/victor9k_fdc.h21
-rw-r--r--src/mame/machine/victor9k_kb.h4
-rw-r--r--src/mame/machine/vs9209.h68
-rw-r--r--src/mame/machine/vt100_kbd.h2
-rw-r--r--src/mame/machine/wangpckb.h2
-rw-r--r--src/mame/machine/x820kb.h2
-rw-r--r--src/mame/machine/xbox.cpp4
-rw-r--r--src/mame/machine/znmcu.h10
-rw-r--r--src/mame/machine/zx8302.h28
91 files changed, 589 insertions, 821 deletions
diff --git a/src/mame/machine/315_5296.h b/src/mame/machine/315_5296.h
index 053705970ee..7e51589b110 100644
--- a/src/mame/machine/315_5296.h
+++ b/src/mame/machine/315_5296.h
@@ -14,55 +14,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-// A to H 8-bit input ports
-#define MCFG_315_5296_IN_PORTA_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_IN_PORTB_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_IN_PORTC_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_IN_PORTD_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_in_pd_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_IN_PORTE_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_in_pe_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_IN_PORTF_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_in_pf_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_IN_PORTG_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_in_pg_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_IN_PORTH_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_in_ph_callback(DEVCB_##_devcb);
-
-// A to H 8-bit output ports
-#define MCFG_315_5296_OUT_PORTA_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_OUT_PORTB_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_OUT_PORTC_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_OUT_PORTD_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_out_pd_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_OUT_PORTE_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_out_pe_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_OUT_PORTF_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_out_pf_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_OUT_PORTG_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_out_pg_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_OUT_PORTH_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_out_ph_callback(DEVCB_##_devcb);
-
-// CNT output pins
-#define MCFG_315_5296_OUT_CNT0_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_out_cnt0_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_OUT_CNT1_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_out_cnt1_callback(DEVCB_##_devcb);
-#define MCFG_315_5296_OUT_CNT2_CB(_devcb) \
- devcb = &downcast<sega_315_5296_device &>(*device).set_out_cnt2_callback(DEVCB_##_devcb);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -74,32 +25,32 @@ public:
sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration helpers
- template <class Object> devcb_base &set_in_pa_callback(Object &&cb) { return m_in_pa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_pb_callback(Object &&cb) { return m_in_pb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_pc_callback(Object &&cb) { return m_in_pc_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_pd_callback(Object &&cb) { return m_in_pd_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_pe_callback(Object &&cb) { return m_in_pe_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_pf_callback(Object &&cb) { return m_in_pf_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_pg_callback(Object &&cb) { return m_in_pg_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_ph_callback(Object &&cb) { return m_in_ph_cb.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base &set_out_pa_callback(Object &&cb) { return m_out_pa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_pb_callback(Object &&cb) { return m_out_pb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_pc_callback(Object &&cb) { return m_out_pc_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_pd_callback(Object &&cb) { return m_out_pd_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_pe_callback(Object &&cb) { return m_out_pe_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_pf_callback(Object &&cb) { return m_out_pf_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_pg_callback(Object &&cb) { return m_out_pg_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_ph_callback(Object &&cb) { return m_out_ph_cb.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base &set_out_cnt0_callback(Object &&cb) { return m_out_cnt0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_cnt1_callback(Object &&cb) { return m_out_cnt1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_cnt2_callback(Object &&cb) { return m_out_cnt2_cb.set_callback(std::forward<Object>(cb)); }
-
- DECLARE_READ8_MEMBER( read );
- DECLARE_WRITE8_MEMBER( write );
-
- uint8_t debug_peek_output(offs_t offset) { return m_output_latch[offset & 7]; }
+ auto in_pa_callback() { return m_in_pa_cb.bind(); }
+ auto in_pb_callback() { return m_in_pb_cb.bind(); }
+ auto in_pc_callback() { return m_in_pc_cb.bind(); }
+ auto in_pd_callback() { return m_in_pd_cb.bind(); }
+ auto in_pe_callback() { return m_in_pe_cb.bind(); }
+ auto in_pf_callback() { return m_in_pf_cb.bind(); }
+ auto in_pg_callback() { return m_in_pg_cb.bind(); }
+ auto in_ph_callback() { return m_in_ph_cb.bind(); }
+
+ auto out_pa_callback() { return m_out_pa_cb.bind(); }
+ auto out_pb_callback() { return m_out_pb_cb.bind(); }
+ auto out_pc_callback() { return m_out_pc_cb.bind(); }
+ auto out_pd_callback() { return m_out_pd_cb.bind(); }
+ auto out_pe_callback() { return m_out_pe_cb.bind(); }
+ auto out_pf_callback() { return m_out_pf_cb.bind(); }
+ auto out_pg_callback() { return m_out_pg_cb.bind(); }
+ auto out_ph_callback() { return m_out_ph_cb.bind(); }
+
+ auto out_cnt0_callback() { return m_out_cnt0_cb.bind(); }
+ auto out_cnt1_callback() { return m_out_cnt1_cb.bind(); }
+ auto out_cnt2_callback() { return m_out_cnt2_cb.bind(); }
+
+ DECLARE_READ8_MEMBER(read);
+ DECLARE_WRITE8_MEMBER(write);
+
+ uint8_t debug_peek_output(offs_t offset) const { return m_output_latch[offset & 7]; }
protected:
// device-level overrides
@@ -141,5 +92,4 @@ private:
// device type definition
DECLARE_DEVICE_TYPE(SEGA_315_5296, sega_315_5296_device)
-
#endif // MAME_MACHINE_315_5296_H
diff --git a/src/mame/machine/315_5338a.h b/src/mame/machine/315_5338a.h
index c8ece88c109..7c2a7ea04b6 100644
--- a/src/mame/machine/315_5338a.h
+++ b/src/mame/machine/315_5338a.h
@@ -25,59 +25,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_315_5338A_READ_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_read_callback(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_WRITE_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_write_callback(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_IN_PA_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_in_callback<0>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_OUT_PA_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_out_callback<0>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_IN_PB_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_in_callback<1>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_OUT_PB_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_out_callback<1>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_IN_PC_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_in_callback<2>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_OUT_PC_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_out_callback<2>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_IN_PD_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_in_callback<3>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_OUT_PD_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_out_callback<3>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_IN_PE_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_in_callback<4>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_OUT_PE_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_out_callback<4>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_IN_PF_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_in_callback<5>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_OUT_PF_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_out_callback<5>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_IN_PG_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_in_callback<6>(DEVCB_##_devcb);
-
-#define MCFG_315_5338A_OUT_PG_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_out_callback<6>(DEVCB_##_devcb);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -88,17 +35,25 @@ public:
sega_315_5338a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
- template <class Object> devcb_base &set_read_callback(Object &&cb)
- { return m_read_cb.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base &set_write_callback(Object &&cb)
- { return m_write_cb.set_callback(std::forward<Object>(cb)); }
-
- template <int Port, class Object> devcb_base &set_out_callback(Object &&cb)
- { return m_out_port_cb[Port].set_callback(std::forward<Object>(cb)); }
-
- template <int Port, class Object> devcb_base &set_in_callback(Object &&cb)
- { return m_in_port_cb[Port].set_callback(std::forward<Object>(cb)); }
+ auto read_callback() { return m_read_cb.bind(); }
+
+ auto write_callback() { return m_write_cb.bind(); }
+
+ auto in_pa_callback() { return m_in_port_cb[0].bind(); }
+ auto in_pb_callback() { return m_in_port_cb[1].bind(); }
+ auto in_pc_callback() { return m_in_port_cb[2].bind(); }
+ auto in_pd_callback() { return m_in_port_cb[3].bind(); }
+ auto in_pe_callback() { return m_in_port_cb[4].bind(); }
+ auto in_pf_callback() { return m_in_port_cb[5].bind(); }
+ auto in_pg_callback() { return m_in_port_cb[6].bind(); }
+
+ auto out_pa_callback() { return m_out_port_cb[0].bind(); }
+ auto out_pb_callback() { return m_out_port_cb[1].bind(); }
+ auto out_pc_callback() { return m_out_port_cb[2].bind(); }
+ auto out_pd_callback() { return m_out_port_cb[3].bind(); }
+ auto out_pe_callback() { return m_out_port_cb[4].bind(); }
+ auto out_pf_callback() { return m_out_port_cb[5].bind(); }
+ auto out_pg_callback() { return m_out_port_cb[6].bind(); }
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
diff --git a/src/mame/machine/315_5649.h b/src/mame/machine/315_5649.h
index 60037925803..ad3835d0032 100644
--- a/src/mame/machine/315_5649.h
+++ b/src/mame/machine/315_5649.h
@@ -19,82 +19,82 @@
//**************************************************************************
#define MCFG_315_5649_IN_PA_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_in_port_callback<0>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_in_port_callback<0>(DEVCB_##_devcb);
#define MCFG_315_5649_OUT_PA_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_out_port_callback<0>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_out_port_callback<0>(DEVCB_##_devcb);
#define MCFG_315_5649_IN_PB_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_in_port_callback<1>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_in_port_callback<1>(DEVCB_##_devcb);
#define MCFG_315_5649_OUT_PB_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_out_port_callback<1>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_out_port_callback<1>(DEVCB_##_devcb);
#define MCFG_315_5649_IN_PC_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_in_port_callback<2>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_in_port_callback<2>(DEVCB_##_devcb);
#define MCFG_315_5649_OUT_PC_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_out_port_callback<2>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_out_port_callback<2>(DEVCB_##_devcb);
#define MCFG_315_5649_IN_PD_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_in_port_callback<3>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_in_port_callback<3>(DEVCB_##_devcb);
#define MCFG_315_5649_OUT_PD_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_out_port_callback<3>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_out_port_callback<3>(DEVCB_##_devcb);
#define MCFG_315_5649_IN_PE_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_in_port_callback<4>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_in_port_callback<4>(DEVCB_##_devcb);
#define MCFG_315_5649_OUT_PE_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_out_port_callback<4>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_out_port_callback<4>(DEVCB_##_devcb);
#define MCFG_315_5649_IN_PF_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_in_port_callback<5>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_in_port_callback<5>(DEVCB_##_devcb);
#define MCFG_315_5649_OUT_PF_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_out_port_callback<5>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_out_port_callback<5>(DEVCB_##_devcb);
#define MCFG_315_5649_IN_PG_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_in_port_callback<6>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_in_port_callback<6>(DEVCB_##_devcb);
#define MCFG_315_5649_OUT_PG_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_out_port_callback<6>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_out_port_callback<6>(DEVCB_##_devcb);
#define MCFG_315_5649_AN0_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_an_port_callback<0>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_an_port_callback<0>(DEVCB_##_devcb);
#define MCFG_315_5649_AN1_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_an_port_callback<1>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_an_port_callback<1>(DEVCB_##_devcb);
#define MCFG_315_5649_AN2_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_an_port_callback<2>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_an_port_callback<2>(DEVCB_##_devcb);
#define MCFG_315_5649_AN3_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_an_port_callback<3>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_an_port_callback<3>(DEVCB_##_devcb);
#define MCFG_315_5649_AN4_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_an_port_callback<4>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_an_port_callback<4>(DEVCB_##_devcb);
#define MCFG_315_5649_AN5_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_an_port_callback<5>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_an_port_callback<5>(DEVCB_##_devcb);
#define MCFG_315_5649_AN6_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_an_port_callback<6>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_an_port_callback<6>(DEVCB_##_devcb);
#define MCFG_315_5649_AN7_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_an_port_callback<7>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_an_port_callback<7>(DEVCB_##_devcb);
#define MCFG_315_5649_SERIAL_CH1_READ_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_serial_rd_callback<0>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_serial_rd_callback<0>(DEVCB_##_devcb);
#define MCFG_315_5649_SERIAL_CH1_WRITE_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_serial_wr_callback<0>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_serial_wr_callback<0>(DEVCB_##_devcb);
#define MCFG_315_5649_SERIAL_CH2_READ_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_serial_rd_callback<1>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_serial_rd_callback<1>(DEVCB_##_devcb);
#define MCFG_315_5649_SERIAL_CH2_WRITE_CB(_devcb) \
- devcb = &downcast<sega_315_5649_device &>(*device).set_serial_wr_callback<1>(DEVCB_##_devcb);
+ downcast<sega_315_5649_device &>(*device).set_serial_wr_callback<1>(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/mame/machine/6883sam.h b/src/mame/machine/6883sam.h
index 61e5fd27033..1e5669ef246 100644
--- a/src/mame/machine/6883sam.h
+++ b/src/mame/machine/6883sam.h
@@ -15,7 +15,7 @@
#define MCFG_SAM6883_RES_CALLBACK(_read) \
- devcb = &downcast<sam6883_device &>(*device).set_res_rd_callback(DEVCB_##_read);
+ downcast<sam6883_device &>(*device).set_res_rd_callback(DEVCB_##_read);
//**************************************************************************
diff --git a/src/mame/machine/abc80kb.h b/src/mame/machine/abc80kb.h
index b88cf9c8a20..7e26881183d 100644
--- a/src/mame/machine/abc80kb.h
+++ b/src/mame/machine/abc80kb.h
@@ -25,7 +25,7 @@
//**************************************************************************
#define MCFG_ABC80_KEYBOARD_KEYDOWN_CALLBACK(_write) \
- devcb = &downcast<abc80_keyboard_device &>(*device).set_keydown_wr_callback(DEVCB_##_write);
+ downcast<abc80_keyboard_device &>(*device).set_keydown_wr_callback(DEVCB_##_write);
diff --git a/src/mame/machine/acs8600_ics.cpp b/src/mame/machine/acs8600_ics.cpp
index 3b63cc119aa..944ea30c1f7 100644
--- a/src/mame/machine/acs8600_ics.cpp
+++ b/src/mame/machine/acs8600_ics.cpp
@@ -15,9 +15,10 @@ DEFINE_DEVICE_TYPE(ACS8600_ICS, acs8600_ics_device, "acs8600_ics", "Altos ACS860
acs8600_ics_device::acs8600_ics_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ACS8600_ICS, tag, owner, clock),
m_icscpu(*this, "icscpu"),
- m_maincpu(*this, finder_base::DUMMY_TAG),
m_out_irq1_func(*this),
- m_out_irq2_func(*this)
+ m_out_irq2_func(*this),
+ m_host_space_device(*this, finder_base::DUMMY_TAG),
+ m_host_space_index(-1)
{
}
@@ -96,35 +97,37 @@ static const z80_daisy_config ics_daisy_chain[] =
};
MACHINE_CONFIG_START(acs8600_ics_device::device_add_mconfig)
- MCFG_DEVICE_ADD("icscpu", Z80, XTAL(4'000'000))
+ MCFG_DEVICE_ADD(m_icscpu, Z80, 4_MHz_XTAL)
MCFG_DEVICE_PROGRAM_MAP(ics_mem)
MCFG_DEVICE_IO_MAP(ics_io)
MCFG_Z80_DAISY_CHAIN(ics_daisy_chain)
- MCFG_DEVICE_ADD("stc1", AM9513, XTAL(1'843'200))
- MCFG_AM9513_OUT1_CALLBACK(WRITELINE("sio1", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio1", z80sio_device, txca_w))
- MCFG_AM9513_OUT2_CALLBACK(WRITELINE("sio1", z80sio_device, rxtxcb_w))
- MCFG_AM9513_OUT3_CALLBACK(WRITELINE("sio2", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio2", z80sio_device, txca_w))
- MCFG_AM9513_OUT4_CALLBACK(WRITELINE("sio2", z80sio_device, rxtxcb_w))
- MCFG_AM9513_OUT5_CALLBACK(WRITELINE("sio3", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio3", z80sio_device, txca_w))
- MCFG_DEVICE_ADD("stc2", AM9513, XTAL(1'843'200))
- MCFG_AM9513_OUT1_CALLBACK(WRITELINE("sio3", z80sio_device, rxtxcb_w))
- MCFG_AM9513_OUT2_CALLBACK(WRITELINE("sio4", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio4", z80sio_device, txca_w))
- MCFG_AM9513_OUT3_CALLBACK(WRITELINE("sio4", z80sio_device, rxtxcb_w))
-
- MCFG_DEVICE_ADD("sio1", Z80SIO, XTAL(8'000'000)/2)
- MCFG_Z80SIO_OUT_TXDA_CB(WRITELINE("rs2321a", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRA_CB(WRITELINE("rs2321a", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSA_CB(WRITELINE("rs2321a", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs2321b", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs2321b", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs2321b", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("icscpu", INPUT_LINE_IRQ0))
- MCFG_Z80SIO_CPU("icscpu")
+ am9513_device &stc1(AM9513(config, "stc1", 1.8432_MHz_XTAL));
+ stc1.out1_cb().set("sio1", FUNC(z80sio_device::rxca_w));
+ stc1.out1_cb().append("sio1", FUNC(z80sio_device::txca_w));
+ stc1.out2_cb().set("sio1", FUNC(z80sio_device::rxtxcb_w));
+ stc1.out3_cb().set("sio2", FUNC(z80sio_device::rxca_w));
+ stc1.out3_cb().append("sio2", FUNC(z80sio_device::txca_w));
+ stc1.out4_cb().set("sio2", FUNC(z80sio_device::rxtxcb_w));
+ stc1.out5_cb().set("sio3", FUNC(z80sio_device::rxca_w));
+ stc1.out5_cb().append("sio3", FUNC(z80sio_device::txca_w));
+
+ am9513_device &stc2(AM9513(config, "stc2", 1.8432_MHz_XTAL));
+ stc2.out1_cb().set("sio3", FUNC(z80sio_device::rxtxcb_w));
+ stc2.out2_cb().set("sio4", FUNC(z80sio_device::rxca_w));
+ stc2.out2_cb().append("sio4", FUNC(z80sio_device::txca_w));
+ stc2.out3_cb().set("sio4", FUNC(z80sio_device::rxtxcb_w));
+
+ z80sio_device &sio1(Z80SIO(config, "sio1", 8_MHz_XTAL/2));
+ sio1.out_txda_callback().set("rs2321a", FUNC(rs232_port_device::write_txd));
+ sio1.out_dtra_callback().set("rs2321a", FUNC(rs232_port_device::write_dtr));
+ sio1.out_rtsa_callback().set("rs2321a", FUNC(rs232_port_device::write_rts));
+ sio1.out_txdb_callback().set("rs2321b", FUNC(rs232_port_device::write_txd));
+ sio1.out_dtrb_callback().set("rs2321b", FUNC(rs232_port_device::write_dtr));
+ sio1.out_rtsb_callback().set("rs2321b", FUNC(rs232_port_device::write_rts));
+ sio1.out_int_callback().set_inputline(m_icscpu, INPUT_LINE_IRQ0);
+ sio1.set_cputag(m_icscpu);
+
MCFG_DEVICE_ADD("rs2321a", RS232_PORT, default_rs232_devices, "terminal")
MCFG_RS232_RXD_HANDLER(WRITELINE("sio1", z80sio_device, rxa_w))
MCFG_RS232_DCD_HANDLER(WRITELINE("sio1", z80sio_device, dcda_w))
@@ -136,15 +139,16 @@ MACHINE_CONFIG_START(acs8600_ics_device::device_add_mconfig)
MCFG_RS232_DCD_HANDLER(WRITELINE("sio1", z80sio_device, dcdb_w))
MCFG_RS232_CTS_HANDLER(WRITELINE("sio1", z80sio_device, ctsb_w))
- MCFG_DEVICE_ADD("sio2", Z80SIO, XTAL(8'000'000)/2)
- MCFG_Z80SIO_OUT_TXDA_CB(WRITELINE("rs2322a", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRA_CB(WRITELINE("rs2322a", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSA_CB(WRITELINE("rs2322a", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs2322b", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs2322b", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs2322b", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("icscpu", INPUT_LINE_IRQ0))
- MCFG_Z80SIO_CPU("icscpu")
+ z80sio_device &sio2(Z80SIO(config, "sio2", 8_MHz_XTAL/2));
+ sio2.out_txda_callback().set("rs2322a", FUNC(rs232_port_device::write_txd));
+ sio2.out_dtra_callback().set("rs2322a", FUNC(rs232_port_device::write_dtr));
+ sio2.out_rtsa_callback().set("rs2322a", FUNC(rs232_port_device::write_rts));
+ sio2.out_txdb_callback().set("rs2322b", FUNC(rs232_port_device::write_txd));
+ sio2.out_dtrb_callback().set("rs2322b", FUNC(rs232_port_device::write_dtr));
+ sio2.out_rtsb_callback().set("rs2322b", FUNC(rs232_port_device::write_rts));
+ sio2.out_int_callback().set_inputline(m_icscpu, INPUT_LINE_IRQ0);
+ sio2.set_cputag(m_icscpu);
+
MCFG_DEVICE_ADD("rs2322a", RS232_PORT, default_rs232_devices, nullptr)
MCFG_RS232_RXD_HANDLER(WRITELINE("sio2", z80sio_device, rxa_w))
MCFG_RS232_DCD_HANDLER(WRITELINE("sio2", z80sio_device, dcda_w))
@@ -155,15 +159,16 @@ MACHINE_CONFIG_START(acs8600_ics_device::device_add_mconfig)
MCFG_RS232_DCD_HANDLER(WRITELINE("sio2", z80sio_device, dcdb_w))
MCFG_RS232_CTS_HANDLER(WRITELINE("sio2", z80sio_device, ctsb_w))
- MCFG_DEVICE_ADD("sio3", Z80SIO, XTAL(8'000'000)/2)
- MCFG_Z80SIO_OUT_TXDA_CB(WRITELINE("rs2323a", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRA_CB(WRITELINE("rs2323a", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSA_CB(WRITELINE("rs2323a", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs2323b", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs2323b", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs2323b", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("icscpu", INPUT_LINE_IRQ0))
- MCFG_Z80SIO_CPU("icscpu")
+ z80sio_device &sio3(Z80SIO(config, "sio3", 8_MHz_XTAL/2));
+ sio3.out_txda_callback().set("rs2323a", FUNC(rs232_port_device::write_txd));
+ sio3.out_dtra_callback().set("rs2323a", FUNC(rs232_port_device::write_dtr));
+ sio3.out_rtsa_callback().set("rs2323a", FUNC(rs232_port_device::write_rts));
+ sio3.out_txdb_callback().set("rs2323b", FUNC(rs232_port_device::write_txd));
+ sio3.out_dtrb_callback().set("rs2323b", FUNC(rs232_port_device::write_dtr));
+ sio3.out_rtsb_callback().set("rs2323b", FUNC(rs232_port_device::write_rts));
+ sio3.out_int_callback().set_inputline(m_icscpu, INPUT_LINE_IRQ0);
+ sio3.set_cputag(m_icscpu);
+
MCFG_DEVICE_ADD("rs2323a", RS232_PORT, default_rs232_devices, nullptr)
MCFG_RS232_RXD_HANDLER(WRITELINE("sio3", z80sio_device, rxa_w))
MCFG_RS232_DCD_HANDLER(WRITELINE("sio3", z80sio_device, dcda_w))
@@ -174,15 +179,16 @@ MACHINE_CONFIG_START(acs8600_ics_device::device_add_mconfig)
MCFG_RS232_DCD_HANDLER(WRITELINE("sio3", z80sio_device, dcdb_w))
MCFG_RS232_CTS_HANDLER(WRITELINE("sio3", z80sio_device, ctsb_w))
- MCFG_DEVICE_ADD("sio4", Z80SIO, XTAL(8'000'000)/2)
- MCFG_Z80SIO_OUT_TXDA_CB(WRITELINE("rs2324a", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRA_CB(WRITELINE("rs2324a", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSA_CB(WRITELINE("rs2324a", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs2324b", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs2324b", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs2324b", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("icscpu", INPUT_LINE_IRQ0))
- MCFG_Z80SIO_CPU("icscpu")
+ z80sio_device &sio4(Z80SIO(config, "sio4", 8_MHz_XTAL/2));
+ sio4.out_txda_callback().set("rs2324a", FUNC(rs232_port_device::write_txd));
+ sio4.out_dtra_callback().set("rs2324a", FUNC(rs232_port_device::write_dtr));
+ sio4.out_rtsa_callback().set("rs2324a", FUNC(rs232_port_device::write_rts));
+ sio4.out_txdb_callback().set("rs2324b", FUNC(rs232_port_device::write_txd));
+ sio4.out_dtrb_callback().set("rs2324b", FUNC(rs232_port_device::write_dtr));
+ sio4.out_rtsb_callback().set("rs2324b", FUNC(rs232_port_device::write_rts));
+ sio4.out_int_callback().set_inputline(m_icscpu, INPUT_LINE_IRQ0);
+ sio4.set_cputag(m_icscpu);
+
MCFG_DEVICE_ADD("rs2324a", RS232_PORT, default_rs232_devices, nullptr)
MCFG_RS232_RXD_HANDLER(WRITELINE("sio4", z80sio_device, rxa_w))
MCFG_RS232_DCD_HANDLER(WRITELINE("sio4", z80sio_device, dcda_w))
@@ -194,10 +200,14 @@ MACHINE_CONFIG_START(acs8600_ics_device::device_add_mconfig)
MCFG_RS232_CTS_HANDLER(WRITELINE("sio4", z80sio_device, ctsb_w))
MACHINE_CONFIG_END
-void acs8600_ics_device::device_start()
+void acs8600_ics_device::device_resolve_objects()
{
- m_maincpu_mem = &m_maincpu->space(AS_PROGRAM);
+ m_maincpu_mem = &m_host_space_device->space(m_host_space_index);
m_out_irq1_func.resolve_safe();
m_out_irq2_func.resolve_safe();
}
+void acs8600_ics_device::device_start()
+{
+}
+
diff --git a/src/mame/machine/acs8600_ics.h b/src/mame/machine/acs8600_ics.h
index ef8f99c56bd..1ca1f623245 100644
--- a/src/mame/machine/acs8600_ics.h
+++ b/src/mame/machine/acs8600_ics.h
@@ -1,55 +1,48 @@
// license:BSD-3-Clause
// copyright-holders:Carl
-#ifndef MAME_MACHINE_ACS8600_ICS_H_
-#define MAME_MACHINE_ACS8600_ICS_H_
+#ifndef MAME_MACHINE_ACS8600_ICS_H
+#define MAME_MACHINE_ACS8600_ICS_H
#pragma once
+
class acs8600_ics_device : public device_t
{
public:
- template <typename T>
- acs8600_ics_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&maincpu_tag)
- : acs8600_ics_device(mconfig, tag, owner, (uint32_t)0)
- {
- m_maincpu.set_tag(std::forward<T>(maincpu_tag));
- }
-
acs8600_ics_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_WRITE8_MEMBER(hiaddr_w);
- DECLARE_WRITE8_MEMBER(ctrl_w);
- DECLARE_READ8_MEMBER(hostram_r);
- DECLARE_WRITE8_MEMBER(hostram_w);
DECLARE_WRITE_LINE_MEMBER(attn_w);
- template <class Object> devcb_base &set_irq1_callback(Object &&cb) { return m_out_irq1_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_irq2_callback(Object &&cb) { return m_out_irq2_func.set_callback(std::forward<Object>(cb)); }
+ auto irq1_callback() { return m_out_irq1_func.bind(); }
+ auto irq2_callback() { return m_out_irq2_func.bind(); }
+ template <typename T> void set_host_space(T &&tag, int index) { m_host_space_device.set_tag(std::forward<T>(tag)); m_host_space_index = index; }
const tiny_rom_entry *device_rom_region() const override;
- void ics_io(address_map &map);
- void ics_mem(address_map &map);
protected:
+ virtual void device_resolve_objects() override;
virtual void device_start() override;
virtual void device_add_mconfig(machine_config &config) override;
+ DECLARE_WRITE8_MEMBER(hiaddr_w);
+ DECLARE_WRITE8_MEMBER(ctrl_w);
+ DECLARE_READ8_MEMBER(hostram_r);
+ DECLARE_WRITE8_MEMBER(hostram_w);
+
+ void ics_io(address_map &map);
+ void ics_mem(address_map &map);
+
private:
required_device<cpu_device> m_icscpu;
- required_device<cpu_device> m_maincpu;
devcb_write_line m_out_irq1_func;
devcb_write_line m_out_irq2_func;
+ required_device<device_memory_interface> m_host_space_device;
+ int m_host_space_index;
address_space *m_maincpu_mem;
u8 m_hiaddr;
u8 m_ctrl;
};
-#define MCFG_ACS8600_ICS_IRQ1(_irq_line) \
- devcb = &downcast<acs8600_ics_device &>(*device).set_irq1_callback(DEVCB_##_irq_line);
-
-#define MCFG_ACS8600_ICS_IRQ2(_irq_line) \
- devcb = &downcast<acs8600_ics_device &>(*device).set_irq2_callback(DEVCB_##_irq_line);
-
DECLARE_DEVICE_TYPE(ACS8600_ICS, acs8600_ics_device)
-#endif
+#endif // MAME_MACHINE_ACS8600_ICS_H
diff --git a/src/mame/machine/apollo.cpp b/src/mame/machine/apollo.cpp
index 323e487f108..5fad90fa5d5 100644
--- a/src/mame/machine/apollo.cpp
+++ b/src/mame/machine/apollo.cpp
@@ -1084,14 +1084,14 @@ MACHINE_CONFIG_START(apollo_state::common)
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(*this, apollo_state, pc_dack6_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(*this, apollo_state, pc_dack7_w))
- MCFG_DEVICE_ADD(APOLLO_PIC1_TAG, PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(WRITELINE(*this, apollo_state, apollo_pic8259_master_set_int_line))
- MCFG_PIC8259_IN_SP_CB(VCC)
- MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, apollo_state, apollo_pic8259_get_slave_ack))
-
- MCFG_DEVICE_ADD(APOLLO_PIC2_TAG, PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(WRITELINE(*this, apollo_state, apollo_pic8259_slave_set_int_line))
- MCFG_PIC8259_IN_SP_CB(GND)
+ PIC8259(config, m_pic8259_master, 0);
+ m_pic8259_master->out_int_callback().set(FUNC(apollo_state::apollo_pic8259_master_set_int_line));
+ m_pic8259_master->in_sp_callback().set_constant(1);
+ m_pic8259_master->read_slave_ack_callback().set(FUNC(apollo_state::apollo_pic8259_get_slave_ack));
+
+ PIC8259(config, m_pic8259_slave, 0);
+ m_pic8259_slave->out_int_callback().set(FUNC(apollo_state::apollo_pic8259_slave_set_int_line));
+ m_pic8259_slave->in_sp_callback().set_constant(0);
MCFG_DEVICE_ADD(APOLLO_PTM_TAG, PTM6840, 0)
MCFG_PTM6840_EXTERNAL_CLOCKS(250000, 125000, 62500)
diff --git a/src/mame/machine/apollo_kbd.h b/src/mame/machine/apollo_kbd.h
index aba8281ba3a..97221e62fa9 100644
--- a/src/mame/machine/apollo_kbd.h
+++ b/src/mame/machine/apollo_kbd.h
@@ -32,10 +32,10 @@
//**************************************************************************
#define MCFG_APOLLO_KBD_TX_CALLBACK(_cb) \
- devcb = &downcast<apollo_kbd_device &>(*device).set_tx_cb(DEVCB_##_cb);
+ downcast<apollo_kbd_device &>(*device).set_tx_cb(DEVCB_##_cb);
#define MCFG_APOLLO_KBD_GERMAN_CALLBACK(_cb) \
- devcb = &downcast<apollo_kbd_device &>(*device).set_german_cb(DEVCB_##_cb);
+ downcast<apollo_kbd_device &>(*device).set_german_cb(DEVCB_##_cb);
//**************************************************************************
diff --git a/src/mame/machine/apricotkb.h b/src/mame/machine/apricotkb.h
index 50c6a9cfb15..530346608fd 100644
--- a/src/mame/machine/apricotkb.h
+++ b/src/mame/machine/apricotkb.h
@@ -27,7 +27,7 @@
//**************************************************************************
#define MCFG_APRICOT_KEYBOARD_TXD_CALLBACK(_write) \
- devcb = &downcast<apricot_keyboard_device &>(*device).set_tcd_wr_callback(DEVCB_##_write);
+ downcast<apricot_keyboard_device &>(*device).set_tcd_wr_callback(DEVCB_##_write);
diff --git a/src/mame/machine/at.cpp b/src/mame/machine/at.cpp
index 6057d870502..97ea32b571d 100644
--- a/src/mame/machine/at.cpp
+++ b/src/mame/machine/at.cpp
@@ -95,39 +95,39 @@ MACHINE_CONFIG_START(at_mb_device::device_add_mconfig)
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(*this, at_mb_device, dack6_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(*this, at_mb_device, dack7_w))
- MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(INPUTLINE(":maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
- MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, at_mb_device, get_slave_ack))
+ pic8259_device &pic8259_master(PIC8259(config, "pic8259_master", 0));
+ pic8259_master.out_int_callback().set_inputline(":maincpu", 0);
+ pic8259_master.in_sp_callback().set_constant(1);
+ pic8259_master.read_slave_ack_callback().set(FUNC(at_mb_device::get_slave_ack));
- MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
- MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic8259_master", pic8259_device, ir2_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ PIC8259(config, m_pic8259_slave, 0);
+ m_pic8259_slave->out_int_callback().set("pic8259_master", FUNC(pic8259_device::ir2_w));
+ m_pic8259_slave->in_sp_callback().set_constant(0);
MCFG_DEVICE_ADD("isabus", ISA16, 0)
MCFG_ISA16_CPU(":maincpu")
- MCFG_ISA_OUT_IRQ2_CB(WRITELINE("pic8259_slave", pic8259_device, ir2_w)) // in place of irq 2 on at irq 9 is used
+ MCFG_ISA_OUT_IRQ2_CB(WRITELINE(m_pic8259_slave, pic8259_device, ir2_w)) // in place of irq 2 on at irq 9 is used
MCFG_ISA_OUT_IRQ3_CB(WRITELINE("pic8259_master", pic8259_device, ir3_w))
MCFG_ISA_OUT_IRQ4_CB(WRITELINE("pic8259_master", pic8259_device, ir4_w))
MCFG_ISA_OUT_IRQ5_CB(WRITELINE("pic8259_master", pic8259_device, ir5_w))
MCFG_ISA_OUT_IRQ6_CB(WRITELINE("pic8259_master", pic8259_device, ir6_w))
MCFG_ISA_OUT_IRQ7_CB(WRITELINE("pic8259_master", pic8259_device, ir7_w))
- MCFG_ISA_OUT_IRQ10_CB(WRITELINE("pic8259_slave", pic8259_device, ir3_w))
- MCFG_ISA_OUT_IRQ11_CB(WRITELINE("pic8259_slave", pic8259_device, ir4_w))
- MCFG_ISA_OUT_IRQ12_CB(WRITELINE("pic8259_slave", pic8259_device, ir5_w))
- MCFG_ISA_OUT_IRQ14_CB(WRITELINE("pic8259_slave", pic8259_device, ir6_w))
- MCFG_ISA_OUT_IRQ15_CB(WRITELINE("pic8259_slave", pic8259_device, ir7_w))
- MCFG_ISA_OUT_DRQ0_CB(WRITELINE("dma8237_1", am9517a_device, dreq0_w))
- MCFG_ISA_OUT_DRQ1_CB(WRITELINE("dma8237_1", am9517a_device, dreq1_w))
- MCFG_ISA_OUT_DRQ2_CB(WRITELINE("dma8237_1", am9517a_device, dreq2_w))
- MCFG_ISA_OUT_DRQ3_CB(WRITELINE("dma8237_1", am9517a_device, dreq3_w))
- MCFG_ISA_OUT_DRQ5_CB(WRITELINE("dma8237_2", am9517a_device, dreq1_w))
- MCFG_ISA_OUT_DRQ6_CB(WRITELINE("dma8237_2", am9517a_device, dreq2_w))
- MCFG_ISA_OUT_DRQ7_CB(WRITELINE("dma8237_2", am9517a_device, dreq3_w))
-
- MCFG_DEVICE_ADD("rtc", MC146818, 32.768_kHz_XTAL)
- MCFG_MC146818_IRQ_HANDLER(WRITELINE("pic8259_slave", pic8259_device, ir0_w))
- MCFG_MC146818_CENTURY_INDEX(0x32)
+ MCFG_ISA_OUT_IRQ10_CB(WRITELINE(m_pic8259_slave, pic8259_device, ir3_w))
+ MCFG_ISA_OUT_IRQ11_CB(WRITELINE(m_pic8259_slave, pic8259_device, ir4_w))
+ MCFG_ISA_OUT_IRQ12_CB(WRITELINE(m_pic8259_slave, pic8259_device, ir5_w))
+ MCFG_ISA_OUT_IRQ14_CB(WRITELINE(m_pic8259_slave, pic8259_device, ir6_w))
+ MCFG_ISA_OUT_IRQ15_CB(WRITELINE(m_pic8259_slave, pic8259_device, ir7_w))
+ MCFG_ISA_OUT_DRQ0_CB(WRITELINE(m_dma8237_1, am9517a_device, dreq0_w))
+ MCFG_ISA_OUT_DRQ1_CB(WRITELINE(m_dma8237_1, am9517a_device, dreq1_w))
+ MCFG_ISA_OUT_DRQ2_CB(WRITELINE(m_dma8237_1, am9517a_device, dreq2_w))
+ MCFG_ISA_OUT_DRQ3_CB(WRITELINE(m_dma8237_1, am9517a_device, dreq3_w))
+ MCFG_ISA_OUT_DRQ5_CB(WRITELINE(m_dma8237_2, am9517a_device, dreq1_w))
+ MCFG_ISA_OUT_DRQ6_CB(WRITELINE(m_dma8237_2, am9517a_device, dreq2_w))
+ MCFG_ISA_OUT_DRQ7_CB(WRITELINE(m_dma8237_2, am9517a_device, dreq3_w))
+
+ MC146818(config, m_mc146818, 32.768_kHz_XTAL);
+ m_mc146818->irq_callback().set(m_pic8259_slave, FUNC(pic8259_device::ir0_w));
+ m_mc146818->set_century_index(0x32);
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h
index 56edee0ec77..f7a17481c2a 100644
--- a/src/mame/machine/atarigen.h
+++ b/src/mame/machine/atarigen.h
@@ -35,7 +35,7 @@
#define MCFG_ATARI_SOUND_COMM_ADD(_tag, _soundcpu, _intcb) \
MCFG_DEVICE_ADD(_tag, ATARI_SOUND_COMM, 0) \
downcast<atari_sound_comm_device &>(*device).set_sound_cpu(_soundcpu); \
- devcb = &downcast<atari_sound_comm_device &>(*device).set_main_int_cb(DEVCB_##_intcb);
+ downcast<atari_sound_comm_device &>(*device).set_main_int_cb(DEVCB_##_intcb);
diff --git a/src/mame/machine/balsente.cpp b/src/mame/machine/balsente.cpp
index 465b2c5a27e..6a59c4231c3 100644
--- a/src/mame/machine/balsente.cpp
+++ b/src/mame/machine/balsente.cpp
@@ -333,11 +333,6 @@ WRITE8_MEMBER(balsente_state::acia_w)
m_acia->write(space, offset, (BIT(offset, 0) && data == 0xe0) ? 0 : data);
}
-WRITE_LINE_MEMBER(balsente_state::uint_w)
-{
- m_uint = bool(state);
-}
-
WRITE_LINE_MEMBER(balsente_state::uint_propagate_w)
{
if (state && BIT(m_counter_control, 5))
diff --git a/src/mame/machine/c117.h b/src/mame/machine/c117.h
index bbe8d3ca5c1..9432aa845c2 100644
--- a/src/mame/machine/c117.h
+++ b/src/mame/machine/c117.h
@@ -17,7 +17,7 @@
downcast<namco_c117_device &>(*device).set_cpu_tags(_maincpu, _subcpu);
#define MCFG_CUS117_SUBRES_CB(_devcb) \
- devcb = &downcast<namco_c117_device &>(*device).set_subres_cb(DEVCB_##_devcb);
+ downcast<namco_c117_device &>(*device).set_subres_cb(DEVCB_##_devcb);
//***************************************************************************
diff --git a/src/mame/machine/cammu.h b/src/mame/machine/cammu.h
index efd08061d4f..e852beb4c37 100644
--- a/src/mame/machine/cammu.h
+++ b/src/mame/machine/cammu.h
@@ -12,7 +12,7 @@
downcast<cammu_c4_device &>(*device).set_cammu_id(_id);
#define MCFG_CAMMU_EXCEPTION_CB(_exceptioncb) \
- devcb = &downcast<cammu_device &>(*device).set_exception_callback(DEVCB_##_exceptioncb);
+ downcast<cammu_device &>(*device).set_exception_callback(DEVCB_##_exceptioncb);
#define MCFG_CAMMU_LINK(_tag) \
downcast<cammu_c3_device &>(*device).add_linked(_tag);
diff --git a/src/mame/machine/cat702.h b/src/mame/machine/cat702.h
index 4c66568b817..4d25407e4a6 100644
--- a/src/mame/machine/cat702.h
+++ b/src/mame/machine/cat702.h
@@ -11,7 +11,7 @@
DECLARE_DEVICE_TYPE(CAT702, cat702_device)
#define MCFG_CAT702_DATAOUT_HANDLER(_devcb) \
- devcb = &downcast<cat702_device &>(*device).set_dataout_handler(DEVCB_##_devcb);
+ downcast<cat702_device &>(*device).set_dataout_handler(DEVCB_##_devcb);
class cat702_device : public device_t
{
diff --git a/src/mame/machine/cit101_kbd.h b/src/mame/machine/cit101_kbd.h
index 9404d0ea4a6..4ffc070e269 100644
--- a/src/mame/machine/cit101_kbd.h
+++ b/src/mame/machine/cit101_kbd.h
@@ -21,7 +21,7 @@
//**************************************************************************
#define MCFG_CIT101_HLE_KEYBOARD_TXD_CALLBACK(_devcb) \
- devcb = &downcast<cit101_hle_keyboard_device &>(*device).set_txd_callback(DEVCB_##_devcb);
+ downcast<cit101_hle_keyboard_device &>(*device).set_txd_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/mame/machine/compiskb.h b/src/mame/machine/compiskb.h
index 3d13cb2fcbb..a6e9093973f 100644
--- a/src/mame/machine/compiskb.h
+++ b/src/mame/machine/compiskb.h
@@ -20,7 +20,7 @@
//**************************************************************************
#define MCFG_COMPIS_KEYBOARD_OUT_TX_HANDLER(_devcb) \
- devcb = &downcast<compis_keyboard_device &>(*device).set_out_tx_handler(DEVCB_##_devcb);
+ downcast<compis_keyboard_device &>(*device).set_out_tx_handler(DEVCB_##_devcb);
diff --git a/src/mame/machine/cuda.h b/src/mame/machine/cuda.h
index f7984087b33..99f786908b2 100644
--- a/src/mame/machine/cuda.h
+++ b/src/mame/machine/cuda.h
@@ -38,16 +38,16 @@
MCFG_DEVICE_REMOVE(CUDA_TAG)
#define MCFG_CUDA_RESET_CALLBACK(_cb) \
- devcb = &downcast<cuda_device &>(*device).set_reset_cb(DEVCB_##_cb);
+ downcast<cuda_device &>(*device).set_reset_cb(DEVCB_##_cb);
#define MCFG_CUDA_LINECHANGE_CALLBACK(_cb) \
- devcb = &downcast<cuda_device &>(*device).set_linechange_cb(DEVCB_##_cb);
+ downcast<cuda_device &>(*device).set_linechange_cb(DEVCB_##_cb);
#define MCFG_CUDA_VIA_CLOCK_CALLBACK(_cb) \
- devcb = &downcast<cuda_device &>(*device).set_via_clock_cb(DEVCB_##_cb);
+ downcast<cuda_device &>(*device).set_via_clock_cb(DEVCB_##_cb);
#define MCFG_CUDA_VIA_DATA_CALLBACK(_cb) \
- devcb = &downcast<cuda_device &>(*device).set_via_data_cb(DEVCB_##_cb);
+ downcast<cuda_device &>(*device).set_via_data_cb(DEVCB_##_cb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/mame/machine/dec_lk201.h b/src/mame/machine/dec_lk201.h
index 06c0d29beef..9d1bc423722 100644
--- a/src/mame/machine/dec_lk201.h
+++ b/src/mame/machine/dec_lk201.h
@@ -38,7 +38,7 @@
//**************************************************************************
#define MCFG_LK201_TX_HANDLER(_cb) \
- devcb = &downcast<lk201_device &>(*device).set_tx_handler(DEVCB_##_cb);
+ downcast<lk201_device &>(*device).set_tx_handler(DEVCB_##_cb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/mame/machine/deco104.h b/src/mame/machine/deco104.h
index e9bde950888..aa2957437b9 100644
--- a/src/mame/machine/deco104.h
+++ b/src/mame/machine/deco104.h
@@ -22,8 +22,4 @@ protected:
DECLARE_DEVICE_TYPE(DECO104PROT, deco104_device)
-
-#define MCFG_DECO104_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, DECO104PROT, 0)
-
#endif // MAME_MACHINE_DECO104_H
diff --git a/src/mame/machine/deco146.h b/src/mame/machine/deco146.h
index fd9bc753154..2ac17aed197 100644
--- a/src/mame/machine/deco146.h
+++ b/src/mame/machine/deco146.h
@@ -9,16 +9,16 @@
#define MCFG_DECO146_IN_PORTA_CB(_devcb) \
- devcb = &downcast<deco_146_base_device &>(*device).set_port_a_cb(DEVCB_##_devcb);
+ downcast<deco_146_base_device &>(*device).set_port_a_cb(DEVCB_##_devcb);
#define MCFG_DECO146_IN_PORTB_CB(_devcb) \
- devcb = &downcast<deco_146_base_device &>(*device).set_port_b_cb(DEVCB_##_devcb);
+ downcast<deco_146_base_device &>(*device).set_port_b_cb(DEVCB_##_devcb);
#define MCFG_DECO146_IN_PORTC_CB(_devcb) \
- devcb = &downcast<deco_146_base_device &>(*device).set_port_c_cb(DEVCB_##_devcb);
+ downcast<deco_146_base_device &>(*device).set_port_c_cb(DEVCB_##_devcb);
#define MCFG_DECO146_SOUNDLATCH_IRQ_CB(_devcb) \
- devcb = &downcast<deco_146_base_device &>(*device).set_soundlatch_irq_callback(DEVCB_##_devcb);
+ downcast<deco_146_base_device &>(*device).set_soundlatch_irq_callback(DEVCB_##_devcb);
// there are some standard ways the chip gets hooked up, so have them here ready to use
#define MCFG_DECO146_SET_INTERFACE_SCRAMBLE( a9,a8,a7,a6,a5,a4,a3,a2,a1,a0 ) \
@@ -85,6 +85,9 @@ public:
template<class Object> devcb_base &set_port_a_cb(Object &&object) { return m_port_a_r.set_callback(std::forward<Object>(object)); }
template<class Object> devcb_base &set_port_b_cb(Object &&object) { return m_port_b_r.set_callback(std::forward<Object>(object)); }
template<class Object> devcb_base &set_port_c_cb(Object &&object) { return m_port_c_r.set_callback(std::forward<Object>(object)); }
+ auto port_a_cb() { return m_port_a_r.bind(); }
+ auto port_b_cb() { return m_port_b_r.bind(); }
+ auto port_c_cb() { return m_port_c_r.bind(); }
void set_interface_scramble(uint8_t a9, uint8_t a8, uint8_t a7, uint8_t a6, uint8_t a5, uint8_t a4, uint8_t a3,uint8_t a2,uint8_t a1,uint8_t a0)
{
m_external_addrswap[9] = a9;
@@ -103,6 +106,7 @@ public:
void set_use_magic_read_address_xor(bool use_xor) { m_magic_read_address_xor_enabled = use_xor; }
template <class Object> devcb_base &set_soundlatch_irq_callback(Object &&cb) { return m_soundlatch_irq_cb.set_callback(std::forward<Object>(cb)); }
+ auto soundlatch_irq_cb() { return m_soundlatch_irq_cb.bind(); }
DECLARE_READ8_MEMBER( soundlatch_r );
diff --git a/src/mame/machine/deco_irq.h b/src/mame/machine/deco_irq.h
index bc559c9cbf0..78a44d21741 100644
--- a/src/mame/machine/deco_irq.h
+++ b/src/mame/machine/deco_irq.h
@@ -23,22 +23,22 @@
downcast<deco_irq_device &>(*device).set_screen_tag(_screen_tag);
#define MCFG_DECO_IRQ_LIGHTGUN1_CB(_devcb) \
- devcb = &downcast<deco_irq_device &>(*device).set_lightgun1_callback(DEVCB_##_devcb);
+ downcast<deco_irq_device &>(*device).set_lightgun1_callback(DEVCB_##_devcb);
#define MCFG_DECO_IRQ_LIGHTGUN2_CB(_devcb) \
- devcb = &downcast<deco_irq_device &>(*device).set_lightgun2_callback(DEVCB_##_devcb);
+ downcast<deco_irq_device &>(*device).set_lightgun2_callback(DEVCB_##_devcb);
#define MCFG_DECO_IRQ_LIGHTGUN_IRQ_CB(_devcb) \
- devcb = &downcast<deco_irq_device &>(*device).set_lightgun_irq_callback(DEVCB_##_devcb);
+ downcast<deco_irq_device &>(*device).set_lightgun_irq_callback(DEVCB_##_devcb);
#define MCFG_DECO_IRQ_RASTER1_IRQ_CB(_devcb) \
- devcb = &downcast<deco_irq_device &>(*device).set_raster1_irq_callback(DEVCB_##_devcb);
+ downcast<deco_irq_device &>(*device).set_raster1_irq_callback(DEVCB_##_devcb);
#define MCFG_DECO_IRQ_RASTER2_IRQ_CB(_devcb) \
- devcb = &downcast<deco_irq_device &>(*device).set_raster2_irq_callback(DEVCB_##_devcb);
+ downcast<deco_irq_device &>(*device).set_raster2_irq_callback(DEVCB_##_devcb);
#define MCFG_DECO_IRQ_VBLANK_IRQ_CB(_devcb) \
- devcb = &downcast<deco_irq_device &>(*device).set_vblank_irq_callback(DEVCB_##_devcb);
+ downcast<deco_irq_device &>(*device).set_vblank_irq_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/mame/machine/egret.h b/src/mame/machine/egret.h
index a6bb3bc6fc8..c94cf56be0f 100644
--- a/src/mame/machine/egret.h
+++ b/src/mame/machine/egret.h
@@ -36,16 +36,16 @@
MCFG_DEVICE_REMOVE(EGRET_TAG)
#define MCFG_EGRET_RESET_CALLBACK(_cb) \
- devcb = &downcast<egret_device &>(*device).set_reset_cb(DEVCB_##_cb);
+ downcast<egret_device &>(*device).set_reset_cb(DEVCB_##_cb);
#define MCFG_EGRET_LINECHANGE_CALLBACK(_cb) \
- devcb = &downcast<egret_device &>(*device).set_linechange_cb(DEVCB_##_cb);
+ downcast<egret_device &>(*device).set_linechange_cb(DEVCB_##_cb);
#define MCFG_EGRET_VIA_CLOCK_CALLBACK(_cb) \
- devcb = &downcast<egret_device &>(*device).set_via_clock_cb(DEVCB_##_cb);
+ downcast<egret_device &>(*device).set_via_clock_cb(DEVCB_##_cb);
#define MCFG_EGRET_VIA_DATA_CALLBACK(_cb) \
- devcb = &downcast<egret_device &>(*device).set_via_data_cb(DEVCB_##_cb);
+ downcast<egret_device &>(*device).set_via_data_cb(DEVCB_##_cb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/mame/machine/esqpanel.h b/src/mame/machine/esqpanel.h
index 730a46b2bc8..05221f2745c 100644
--- a/src/mame/machine/esqpanel.h
+++ b/src/mame/machine/esqpanel.h
@@ -53,10 +53,10 @@
MCFG_DEVICE_REMOVE(_tag)
#define MCFG_ESQPANEL_TX_CALLBACK(_write) \
- devcb = &downcast<esqpanel_device &>(*device).set_tx_wr_callback(DEVCB_##_write);
+ downcast<esqpanel_device &>(*device).set_tx_wr_callback(DEVCB_##_write);
#define MCFG_ESQPANEL_ANALOG_CALLBACK(_write) \
- devcb = &downcast<esqpanel_device &>(*device).set_analog_wr_callback(DEVCB_##_write);
+ downcast<esqpanel_device &>(*device).set_analog_wr_callback(DEVCB_##_write);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/mame/machine/fm_scsi.h b/src/mame/machine/fm_scsi.h
index 2fcd1950fbd..c93b2d0ae4c 100644
--- a/src/mame/machine/fm_scsi.h
+++ b/src/mame/machine/fm_scsi.h
@@ -16,9 +16,9 @@
MCFG_DEVICE_ADD(_tag, FMSCSI, 0)
#define MCFG_FMSCSI_IRQ_HANDLER(_devcb) \
- devcb = &downcast<fmscsi_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<fmscsi_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_FMSCSI_DRQ_HANDLER(_devcb) \
- devcb = &downcast<fmscsi_device &>(*device).set_drq_handler(DEVCB_##_devcb);
+ downcast<fmscsi_device &>(*device).set_drq_handler(DEVCB_##_devcb);
class fmscsi_device : public legacy_scsi_host_adapter
{
diff --git a/src/mame/machine/gaelco3d.h b/src/mame/machine/gaelco3d.h
index 4a30d708322..21a37195445 100644
--- a/src/mame/machine/gaelco3d.h
+++ b/src/mame/machine/gaelco3d.h
@@ -16,7 +16,7 @@
***************************************************************************/
#define MCFG_GAELCO_SERIAL_IRQ_HANDLER(_devcb) \
- devcb = &downcast<gaelco_serial_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<gaelco_serial_device &>(*device).set_irq_handler(DEVCB_##_devcb);
diff --git a/src/mame/machine/hp9845_printer.h b/src/mame/machine/hp9845_printer.h
index 0c8aea9e594..c7752b24c03 100644
--- a/src/mame/machine/hp9845_printer.h
+++ b/src/mame/machine/hp9845_printer.h
@@ -16,13 +16,13 @@
#include "imagedev/bitbngr.h"
#define MCFG_9845PRT_IRL_HANDLER(_devcb) \
- devcb = &downcast<hp9845_printer_device &>(*device).set_irl_handler(DEVCB_##_devcb);
+ downcast<hp9845_printer_device &>(*device).set_irl_handler(DEVCB_##_devcb);
#define MCFG_9845PRT_FLG_HANDLER(_devcb) \
- devcb = &downcast<hp9845_printer_device &>(*device).set_flg_handler(DEVCB_##_devcb);
+ downcast<hp9845_printer_device &>(*device).set_flg_handler(DEVCB_##_devcb);
#define MCFG_9845PRT_STS_HANDLER(_devcb) \
- devcb = &downcast<hp9845_printer_device &>(*device).set_sts_handler(DEVCB_##_devcb);
+ downcast<hp9845_printer_device &>(*device).set_sts_handler(DEVCB_##_devcb);
class hp9845_printer_device : public device_t
{
diff --git a/src/mame/machine/ibm6580_fdc.h b/src/mame/machine/ibm6580_fdc.h
index 30bbb2c9b6f..92a85fb9a7d 100644
--- a/src/mame/machine/ibm6580_fdc.h
+++ b/src/mame/machine/ibm6580_fdc.h
@@ -10,13 +10,13 @@
#define MCFG_DW_FDC_OUT_DATA_HANDLER(_devcb) \
- devcb = &downcast<dw_fdc_device &>(*device).set_out_data_handler(DEVCB_##_devcb);
+ downcast<dw_fdc_device &>(*device).set_out_data_handler(DEVCB_##_devcb);
#define MCFG_DW_FDC_OUT_CLOCK_HANDLER(_devcb) \
- devcb = &downcast<dw_fdc_device &>(*device).set_out_clock_handler(DEVCB_##_devcb);
+ downcast<dw_fdc_device &>(*device).set_out_clock_handler(DEVCB_##_devcb);
#define MCFG_DW_FDC_OUT_STROBE_HANDLER(_devcb) \
- devcb = &downcast<dw_fdc_device &>(*device).set_out_strobe_handler(DEVCB_##_devcb);
+ downcast<dw_fdc_device &>(*device).set_out_strobe_handler(DEVCB_##_devcb);
class dw_fdc_device : public device_t
diff --git a/src/mame/machine/ibm6580_kbd.h b/src/mame/machine/ibm6580_kbd.h
index f39ce79857b..4796503ba58 100644
--- a/src/mame/machine/ibm6580_kbd.h
+++ b/src/mame/machine/ibm6580_kbd.h
@@ -6,23 +6,14 @@
#pragma once
-#define MCFG_DW_KEYBOARD_OUT_DATA_HANDLER(_devcb) \
- devcb = &downcast<dw_keyboard_device &>(*device).set_out_data_handler(DEVCB_##_devcb);
-
-#define MCFG_DW_KEYBOARD_OUT_CLOCK_HANDLER(_devcb) \
- devcb = &downcast<dw_keyboard_device &>(*device).set_out_clock_handler(DEVCB_##_devcb);
-
-#define MCFG_DW_KEYBOARD_OUT_STROBE_HANDLER(_devcb) \
- devcb = &downcast<dw_keyboard_device &>(*device).set_out_strobe_handler(DEVCB_##_devcb);
-
class dw_keyboard_device : public device_t
{
public:
dw_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_out_data_handler(Object &&cb) { return m_out_data.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_clock_handler(Object &&cb) { return m_out_clock.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_strobe_handler(Object &&cb) { return m_out_strobe.set_callback(std::forward<Object>(cb)); }
+ auto out_data_handler() { return m_out_data.bind(); }
+ auto out_clock_handler() { return m_out_clock.bind(); }
+ auto out_strobe_handler() { return m_out_strobe.bind(); }
DECLARE_WRITE_LINE_MEMBER(reset_w);
DECLARE_WRITE_LINE_MEMBER(ack_w);
diff --git a/src/mame/machine/interpro_ioga.h b/src/mame/machine/interpro_ioga.h
index cb7b8529788..dee30060b17 100644
--- a/src/mame/machine/interpro_ioga.h
+++ b/src/mame/machine/interpro_ioga.h
@@ -7,27 +7,27 @@
#pragma once
#define MCFG_INTERPRO_IOGA_NMI_CB(_out_nmi) \
- devcb = &downcast<interpro_ioga_device &>(*device).set_out_nmi_callback(DEVCB_##_out_nmi);
+ downcast<interpro_ioga_device &>(*device).set_out_nmi_callback(DEVCB_##_out_nmi);
#define MCFG_INTERPRO_IOGA_IRQ_CB(_out_irq) \
- devcb = &downcast<interpro_ioga_device &>(*device).set_out_irq_callback(DEVCB_##_out_irq);
+ downcast<interpro_ioga_device &>(*device).set_out_irq_callback(DEVCB_##_out_irq);
#define MCFG_INTERPRO_IOGA_IVEC_CB(_out_ivec) \
- devcb = &downcast<interpro_ioga_device &>(*device).set_out_irq_vector_callback(DEVCB_##_out_ivec);
+ downcast<interpro_ioga_device &>(*device).set_out_irq_vector_callback(DEVCB_##_out_ivec);
#define MCFG_INTERPRO_IOGA_DMA_CB(_channel, _dma_r, _dma_w) \
- devcb = &downcast<interpro_ioga_device &>(*device).set_dma_r_callback(_channel, DEVCB_##_dma_r); \
- devcb = &downcast<interpro_ioga_device &>(*device).set_dma_w_callback(_channel, DEVCB_##_dma_w);
+ downcast<interpro_ioga_device &>(*device).set_dma_r_callback(_channel, DEVCB_##_dma_r); \
+ downcast<interpro_ioga_device &>(*device).set_dma_w_callback(_channel, DEVCB_##_dma_w);
#define MCFG_INTERPRO_IOGA_SERIAL_DMA_CB(_channel, _dma_r, _dma_w) \
- devcb = &downcast<interpro_ioga_device &>(*device).set_serial_dma_r_callback(_channel, DEVCB_##_dma_r); \
- devcb = &downcast<interpro_ioga_device &>(*device).set_serial_dma_w_callback(_channel, DEVCB_##_dma_w);
+ downcast<interpro_ioga_device &>(*device).set_serial_dma_r_callback(_channel, DEVCB_##_dma_r); \
+ downcast<interpro_ioga_device &>(*device).set_serial_dma_w_callback(_channel, DEVCB_##_dma_w);
#define MCFG_INTERPRO_IOGA_FDCTC_CB(_tc) \
- devcb = &downcast<interpro_ioga_device &>(*device).set_fdc_tc_callback(DEVCB_##_tc);
+ downcast<interpro_ioga_device &>(*device).set_fdc_tc_callback(DEVCB_##_tc);
#define MCFG_INTERPRO_IOGA_ETH_CA_CB(_ca) \
- devcb = &downcast<interpro_ioga_device &>(*device).set_eth_ca_callback(DEVCB_##_ca);
+ downcast<interpro_ioga_device &>(*device).set_eth_ca_callback(DEVCB_##_ca);
#define MCFG_INTERPRO_IOGA_MEMORY(_tag, _spacenum) \
downcast<interpro_ioga_device &>(*device).set_memory(_tag, _spacenum);
@@ -85,6 +85,15 @@ public:
template <class Object> devcb_base &set_serial_dma_w_callback(int channel, Object &&cb) { return m_serial_dma_channel[channel].device_w.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_fdc_tc_callback(Object &&cb) { return m_fdc_tc_func.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_eth_ca_callback(Object &&cb) { return m_eth_ca_func.set_callback(std::forward<Object>(cb)); }
+ auto out_nmi_callback() { return m_out_nmi_func.bind(); }
+ auto out_irq_callback() { return m_out_irq_func.bind(); }
+ auto out_irq_vector_callback() { return m_out_irq_vector_func.bind(); }
+ template <unsigned Chan> auto dma_r_callback() { return m_dma_channel[Chan].device_r.bind(); }
+ template <unsigned Chan> auto dma_w_callback() { return m_dma_channel[Chan].device_w.bind(); }
+ template <unsigned Chan> auto serial_dma_r_callback() { return m_serial_dma_channel[Chan].device_r.bind(); }
+ template <unsigned Chan> auto serial_dma_w_callback() { return m_serial_dma_channel[Chan].device_w.bind(); }
+ auto fdc_tc_callback() { return m_fdc_tc_func.bind(); }
+ auto eth_ca_callback() { return m_eth_ca_func.bind(); }
void set_memory(const char *const tag, const int spacenum)
{
diff --git a/src/mame/machine/interpro_sga.h b/src/mame/machine/interpro_sga.h
index d9753bb5533..c845722eb0e 100644
--- a/src/mame/machine/interpro_sga.h
+++ b/src/mame/machine/interpro_sga.h
@@ -7,7 +7,7 @@
#pragma once
#define MCFG_INTERPRO_SGA_BERR_CB(_out_berr) \
- devcb = &downcast<interpro_sga_device &>(*device).set_out_berr_callback(DEVCB_##_out_berr);
+ downcast<interpro_sga_device &>(*device).set_out_berr_callback(DEVCB_##_out_berr);
class interpro_sga_device : public device_t
{
diff --git a/src/mame/machine/ioptimer.h b/src/mame/machine/ioptimer.h
index e3a45ca2a0b..a109474d5ce 100644
--- a/src/mame/machine/ioptimer.h
+++ b/src/mame/machine/ioptimer.h
@@ -16,7 +16,7 @@
#define MCFG_IOP_TIMER_IRQ_CALLBACK(_write) \
- devcb = &downcast<iop_timer_device &>(*device).set_int_cb(DEVCB_##_write);
+ downcast<iop_timer_device &>(*device).set_int_cb(DEVCB_##_write);
class iop_timer_device : public device_t
{
diff --git a/src/mame/machine/isbc_208.h b/src/mame/machine/isbc_208.h
index f05cd797907..792b9c72306 100644
--- a/src/mame/machine/isbc_208.h
+++ b/src/mame/machine/isbc_208.h
@@ -51,7 +51,7 @@ private:
};
#define MCFG_ISBC_208_IRQ(_irq_line) \
- devcb = &downcast<isbc_208_device &>(*device).set_irq_callback(DEVCB_##_irq_line);
+ downcast<isbc_208_device &>(*device).set_irq_callback(DEVCB_##_irq_line);
DECLARE_DEVICE_TYPE(ISBC_208, isbc_208_device)
diff --git a/src/mame/machine/isbc_215g.h b/src/mame/machine/isbc_215g.h
index 565d742f1de..76336b85dab 100644
--- a/src/mame/machine/isbc_215g.h
+++ b/src/mame/machine/isbc_215g.h
@@ -85,7 +85,7 @@ private:
};
#define MCFG_ISBC_215_IRQ(_irq_line) \
- devcb = &downcast<isbc_215g_device &>(*device).set_irq_callback(DEVCB_##_irq_line);
+ downcast<isbc_215g_device &>(*device).set_irq_callback(DEVCB_##_irq_line);
DECLARE_DEVICE_TYPE(ISBC_215G, isbc_215g_device)
diff --git a/src/mame/machine/k573cass.h b/src/mame/machine/k573cass.h
index c317ef2aaf2..4a623f35bfc 100644
--- a/src/mame/machine/k573cass.h
+++ b/src/mame/machine/k573cass.h
@@ -17,7 +17,7 @@
#include "machine/zs01.h"
#define MCFG_KONAMI573_CASSETTE_DSR_HANDLER(_devcb) \
- devcb = &downcast<konami573_cassette_slot_device &>(*device).set_dsr_handler(DEVCB_##_devcb);
+ downcast<konami573_cassette_slot_device &>(*device).set_dsr_handler(DEVCB_##_devcb);
DECLARE_DEVICE_TYPE(KONAMI573_CASSETTE_SLOT, konami573_cassette_slot_device)
@@ -143,28 +143,28 @@ DECLARE_DEVICE_TYPE(KONAMI573_CASSETTE_Y, konami573_cassette_y_device)
#define MCFG_KONAMI573_CASSETTE_Y_D0_HANDLER(_devcb) \
- devcb = &downcast<konami573_cassette_y_device &>(*device).set_d0_handler(DEVCB_##_devcb);
+ downcast<konami573_cassette_y_device &>(*device).set_d0_handler(DEVCB_##_devcb);
#define MCFG_KONAMI573_CASSETTE_Y_D1_HANDLER(_devcb) \
- devcb = &downcast<konami573_cassette_y_device &>(*device).set_d1_handler(DEVCB_##_devcb);
+ downcast<konami573_cassette_y_device &>(*device).set_d1_handler(DEVCB_##_devcb);
#define MCFG_KONAMI573_CASSETTE_Y_D2_HANDLER(_devcb) \
- devcb = &downcast<konami573_cassette_y_device &>(*device).set_d2_handler(DEVCB_##_devcb);
+ downcast<konami573_cassette_y_device &>(*device).set_d2_handler(DEVCB_##_devcb);
#define MCFG_KONAMI573_CASSETTE_Y_D3_HANDLER(_devcb) \
- devcb = &downcast<konami573_cassette_y_device &>(*device).set_d3_handler(DEVCB_##_devcb);
+ downcast<konami573_cassette_y_device &>(*device).set_d3_handler(DEVCB_##_devcb);
#define MCFG_KONAMI573_CASSETTE_Y_D4_HANDLER(_devcb) \
- devcb = &downcast<konami573_cassette_y_device &>(*device).set_d4_handler(DEVCB_##_devcb);
+ downcast<konami573_cassette_y_device &>(*device).set_d4_handler(DEVCB_##_devcb);
#define MCFG_KONAMI573_CASSETTE_Y_D5_HANDLER(_devcb) \
- devcb = &downcast<konami573_cassette_y_device &>(*device).set_d5_handler(DEVCB_##_devcb);
+ downcast<konami573_cassette_y_device &>(*device).set_d5_handler(DEVCB_##_devcb);
#define MCFG_KONAMI573_CASSETTE_Y_D6_HANDLER(_devcb) \
- devcb = &downcast<konami573_cassette_y_device &>(*device).set_d6_handler(DEVCB_##_devcb);
+ downcast<konami573_cassette_y_device &>(*device).set_d6_handler(DEVCB_##_devcb);
#define MCFG_KONAMI573_CASSETTE_Y_D7_HANDLER(_devcb) \
- devcb = &downcast<konami573_cassette_y_device &>(*device).set_d7_handler(DEVCB_##_devcb);
+ downcast<konami573_cassette_y_device &>(*device).set_d7_handler(DEVCB_##_devcb);
class konami573_cassette_y_device: public device_t,
public konami573_cassette_interface
diff --git a/src/mame/machine/kay_kbd.h b/src/mame/machine/kay_kbd.h
index 689fdb1e32e..4274f7f3199 100644
--- a/src/mame/machine/kay_kbd.h
+++ b/src/mame/machine/kay_kbd.h
@@ -8,10 +8,6 @@
#include "sound/spkrdev.h"
-#define MCFG_KAYPRO10KBD_RXD_CB(cb) \
- devcb = &downcast<kaypro_10_keyboard_device &>(*device).set_rxd_cb(DEVCB_##cb);
-
-
class kaypro_10_keyboard_device : public device_t
{
public:
@@ -19,9 +15,9 @@ public:
machine_config const &mconfig,
char const *tag,
device_t *owner,
- std::uint32_t clock);
+ std::uint32_t clock = 0);
- template <class Object> devcb_base &set_rxd_cb(Object &&cb) { return m_rxd_cb.set_callback(std::forward<Object>(cb)); }
+ auto rxd_cb() { return m_rxd_cb.bind(); }
DECLARE_WRITE_LINE_MEMBER(txd_w) { m_txd = state ? 1U : 0U; }
diff --git a/src/mame/machine/kc_keyb.h b/src/mame/machine/kc_keyb.h
index 08d23773372..1ccef297e9f 100644
--- a/src/mame/machine/kc_keyb.h
+++ b/src/mame/machine/kc_keyb.h
@@ -12,7 +12,7 @@
#pragma once
#define MCFG_KC_KEYBOARD_OUT_CALLBACK(_write) \
- devcb = &downcast<kc_keyboard_device &>(*device).set_out_wr_callback(DEVCB_##_write);
+ downcast<kc_keyboard_device &>(*device).set_out_wr_callback(DEVCB_##_write);
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/mame/machine/km035.h b/src/mame/machine/km035.h
index 2f932fdd586..ad8dc58d21b 100644
--- a/src/mame/machine/km035.h
+++ b/src/mame/machine/km035.h
@@ -18,10 +18,10 @@
//**************************************************************************
#define MCFG_KM035_TX_HANDLER(_cb) \
- devcb = &downcast<km035_device &>(*device).set_tx_handler(DEVCB_##_cb);
+ downcast<km035_device &>(*device).set_tx_handler(DEVCB_##_cb);
#define MCFG_KM035_RTS_HANDLER(_cb) \
- devcb = &downcast<km035_device &>(*device).set_rts_handler(DEVCB_##_cb);
+ downcast<km035_device &>(*device).set_rts_handler(DEVCB_##_cb);
//**************************************************************************
diff --git a/src/mame/machine/m24_kbd.h b/src/mame/machine/m24_kbd.h
index cf3c7df39f4..5aa4fe3ccae 100644
--- a/src/mame/machine/m24_kbd.h
+++ b/src/mame/machine/m24_kbd.h
@@ -8,7 +8,7 @@
#include "cpu/mcs48/mcs48.h"
#define MCFG_M24_KEYBOARD_OUT_DATA_HANDLER(_devcb) \
- devcb = &downcast<m24_keyboard_device &>(*device).set_out_data_handler(DEVCB_##_devcb);
+ downcast<m24_keyboard_device &>(*device).set_out_data_handler(DEVCB_##_devcb);
class m24_keyboard_device : public device_t
{
diff --git a/src/mame/machine/m24_z8000.h b/src/mame/machine/m24_z8000.h
index 970f5aa273c..df226b87926 100644
--- a/src/mame/machine/m24_z8000.h
+++ b/src/mame/machine/m24_z8000.h
@@ -11,7 +11,7 @@
#include "machine/pic8259.h"
#define MCFG_M24_Z8000_HALT(_devcb) \
- devcb = &downcast<m24_z8000_device &>(*device).set_halt_callback(DEVCB_##_devcb);
+ downcast<m24_z8000_device &>(*device).set_halt_callback(DEVCB_##_devcb);
class m24_z8000_device : public device_t
{
diff --git a/src/mame/machine/mackbd.cpp b/src/mame/machine/mackbd.cpp
index c5af275772d..741226a7e84 100644
--- a/src/mame/machine/mackbd.cpp
+++ b/src/mame/machine/mackbd.cpp
@@ -160,16 +160,17 @@ INPUT_PORTS_END
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(mackbd_device::device_add_mconfig)
- MCFG_DEVICE_ADD(MACKBD_CPU_TAG, I8021, 3000000) // "the approximate clock rate of the MPU is 3 MHz"
- MCFG_MCS48_PORT_BUS_IN_CB(READ8(*this, mackbd_device, p0_r))
- MCFG_MCS48_PORT_BUS_OUT_CB(WRITE8(*this, mackbd_device, p0_w))
- MCFG_MCS48_PORT_P1_IN_CB(READ8(*this, mackbd_device, p1_r))
- MCFG_MCS48_PORT_P1_OUT_CB(WRITE8(*this, mackbd_device, p1_w))
- MCFG_MCS48_PORT_P2_IN_CB(READ8(*this, mackbd_device, p2_r))
- MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, mackbd_device, p2_w))
- MCFG_MCS48_PORT_T1_IN_CB(IOPORT("MODS")) MCFG_DEVCB_RSHIFT(1) // option
-MACHINE_CONFIG_END
+void mackbd_device::device_add_mconfig(machine_config &config)
+{
+ mcs48_cpu_device &cpu(I8021(config, m_maincpu, 3000000)); // "the approximate clock rate of the MPU is 3 MHz"
+ cpu.bus_in_cb().set(FUNC(mackbd_device::p0_r));
+ cpu.bus_out_cb().set(FUNC(mackbd_device::p0_w));
+ cpu.p1_in_cb().set(FUNC(mackbd_device::p1_r));
+ cpu.p1_out_cb().set(FUNC(mackbd_device::p1_w));
+ cpu.p2_in_cb().set(FUNC(mackbd_device::p2_r));
+ cpu.p2_out_cb().set(FUNC(mackbd_device::p2_w));
+ cpu.t1_in_cb().set_ioport("MODS").bit(1); // option
+}
const tiny_rom_entry *mackbd_device::device_rom_region() const
{
@@ -189,8 +190,8 @@ ioport_constructor mackbd_device::device_input_ports() const
// mackbd_device - constructor
//-------------------------------------------------
-mackbd_device::mackbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, MACKBD, tag, owner, clock),
+mackbd_device::mackbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, MACKBD, tag, owner, clock),
m_maincpu(*this, MACKBD_CPU_TAG),
m_clkout_handler(*this),
m_dataout_handler(*this)
diff --git a/src/mame/machine/mackbd.h b/src/mame/machine/mackbd.h
index 0a1178d51be..4fba653cfc4 100644
--- a/src/mame/machine/mackbd.h
+++ b/src/mame/machine/mackbd.h
@@ -24,7 +24,7 @@
devcb = downcast<mackbd_device &>(*device).set_clkout_handler(DEVCB_##_devcb);
#define MCFG_MACKBD_DATAOUT_HANDLER(_devcb) \
- devcb = &downcast<mackbd_device &>(*device).set_dataout_handler(DEVCB_##_devcb);
+ downcast<mackbd_device &>(*device).set_dataout_handler(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/mame/machine/microdrv.h b/src/mame/machine/microdrv.h
index ced4d175223..7fa62714adb 100644
--- a/src/mame/machine/microdrv.h
+++ b/src/mame/machine/microdrv.h
@@ -28,7 +28,7 @@
MCFG_DEVICE_ADD(_tag, MICRODRIVE, 0)
#define MCFG_MICRODRIVE_COMMS_OUT_CALLBACK(_write) \
- devcb = &downcast<microdrive_image_device &>(*device).set_comms_out_wr_callback(DEVCB_##_write);
+ downcast<microdrive_image_device &>(*device).set_comms_out_wr_callback(DEVCB_##_write);
diff --git a/src/mame/machine/micropolis.h b/src/mame/machine/micropolis.h
index 7474e77cbaf..5f2dd3f7b08 100644
--- a/src/mame/machine/micropolis.h
+++ b/src/mame/machine/micropolis.h
@@ -28,13 +28,13 @@
MCFG_MICROPOLIS_DRIVE_TAGS(FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3)
#define MCFG_MICROPOLIS_DDEN_CALLBACK(_read) \
- devcb = &downcast<micropolis_device &>(*device).set_dden_rd_callback(DEVCB_##_read);
+ downcast<micropolis_device &>(*device).set_dden_rd_callback(DEVCB_##_read);
#define MCFG_MICROPOLIS_INTRQ_CALLBACK(_write) \
- devcb = &downcast<micropolis_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
+ downcast<micropolis_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
#define MCFG_MICROPOLIS_DRQ_CALLBACK(_write) \
- devcb = &downcast<micropolis_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
+ downcast<micropolis_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
/***************************************************************************
MACROS
diff --git a/src/mame/machine/midikbd.h b/src/mame/machine/midikbd.h
index 993003cbd80..d3c77dec6ab 100644
--- a/src/mame/machine/midikbd.h
+++ b/src/mame/machine/midikbd.h
@@ -10,7 +10,7 @@
#define MCFG_MIDI_KBD_ADD(_tag, _devcb, _clock) \
MCFG_DEVICE_ADD(_tag, MIDI_KBD, _clock) \
- devcb = &downcast<midi_keyboard_device &>(*device).set_tx_callback(DEVCB_##_devcb);
+ downcast<midi_keyboard_device &>(*device).set_tx_callback(DEVCB_##_devcb);
class midi_keyboard_device : public device_t, public device_serial_interface
{
diff --git a/src/mame/machine/midwayic.h b/src/mame/machine/midwayic.h
index 0b7e3e6e820..8d764d34999 100644
--- a/src/mame/machine/midwayic.h
+++ b/src/mame/machine/midwayic.h
@@ -239,16 +239,16 @@ DECLARE_DEVICE_TYPE(MIDWAY_IOASIC, midway_ioasic_device)
downcast<midway_ioasic_device &>(*device).set_shuffle_default(_shuffle);
#define MCFG_MIDWAY_IOASIC_IRQ_CALLBACK(_write) \
- devcb = &downcast<midway_ioasic_device &>(*device).set_irqhandler_callback(DEVCB_##_write);
+ downcast<midway_ioasic_device &>(*device).set_irqhandler_callback(DEVCB_##_write);
#define MCFG_MIDWAY_IOASIC_AUTO_ACK(_ack) \
downcast<midway_ioasic_device &>(*device).set_auto_ack(_ack);
#define MCFG_MIDWAY_IOASIC_OUT_TX_CB(_devcb) \
- devcb = &downcast<midway_ioasic_device &>(*device).set_serial_tx_callback(DEVCB_##_devcb);
+ downcast<midway_ioasic_device &>(*device).set_serial_tx_callback(DEVCB_##_devcb);
#define MCFG_MIDWAY_IOASIC_AUX_OUT_CB(_devcb) \
- devcb = &downcast<midway_ioasic_device &>(*device).set_aux_output_callback(DEVCB_##_devcb);
+ downcast<midway_ioasic_device &>(*device).set_aux_output_callback(DEVCB_##_devcb);
enum
diff --git a/src/mame/machine/mm1kb.h b/src/mame/machine/mm1kb.h
index 9cf08ecd942..d9204ae3f69 100644
--- a/src/mame/machine/mm1kb.h
+++ b/src/mame/machine/mm1kb.h
@@ -20,7 +20,7 @@
//**************************************************************************
#define MCFG_MM1_KEYBOARD_KBST_CALLBACK(_write) \
- devcb = &downcast<mm1_keyboard_device &>(*device).set_kbst_wr_callback(DEVCB_##_write);
+ downcast<mm1_keyboard_device &>(*device).set_kbst_wr_callback(DEVCB_##_write);
diff --git a/src/mame/machine/model1io.cpp b/src/mame/machine/model1io.cpp
index dadc2e026dd..8fef843c855 100644
--- a/src/mame/machine/model1io.cpp
+++ b/src/mame/machine/model1io.cpp
@@ -128,30 +128,31 @@ const tiny_rom_entry *model1io_device::device_rom_region() const
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START( model1io_device::device_add_mconfig )
- MCFG_DEVICE_ADD("iocpu", Z80, 32_MHz_XTAL/8)
- MCFG_DEVICE_PROGRAM_MAP(mem_map)
-
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT) // 93C45
-
- MCFG_DEVICE_ADD("io", SEGA_315_5338A, 32_MHz_XTAL)
- MCFG_315_5338A_READ_CB(READ8(*this, model1io_device, io_r))
- MCFG_315_5338A_WRITE_CB(WRITE8(*this, model1io_device, io_w))
- MCFG_315_5338A_OUT_PA_CB(WRITE8(*this, model1io_device, io_pa_w))
- MCFG_315_5338A_IN_PB_CB(READ8(*this, model1io_device, io_pb_r))
- MCFG_315_5338A_IN_PC_CB(READ8(*this, model1io_device, io_pc_r))
- MCFG_315_5338A_IN_PD_CB(READ8(*this, model1io_device, io_pd_r))
- MCFG_315_5338A_IN_PE_CB(READ8(*this, model1io_device, io_pe_r))
- MCFG_315_5338A_OUT_PE_CB(WRITE8(*this, model1io_device, io_pe_w))
- MCFG_315_5338A_OUT_PF_CB(WRITE8(*this, model1io_device, io_pf_w))
- MCFG_315_5338A_IN_PG_CB(READ8(*this, model1io_device, io_pg_r))
-
- MCFG_DEVICE_ADD("adc", MSM6253, 0)
- MCFG_MSM6253_IN0_ANALOG_READ(model1io_device, analog0_r)
- MCFG_MSM6253_IN1_ANALOG_READ(model1io_device, analog1_r)
- MCFG_MSM6253_IN2_ANALOG_READ(model1io_device, analog2_r)
- MCFG_MSM6253_IN3_ANALOG_READ(model1io_device, analog3_r)
-MACHINE_CONFIG_END
+void model1io_device::device_add_mconfig(machine_config &config)
+{
+ z80_device &iocpu(Z80(config, "iocpu", 32_MHz_XTAL/8));
+ iocpu.set_addrmap(AS_PROGRAM, &model1io_device::mem_map);
+
+ EEPROM_SERIAL_93C46_16BIT(config, m_eeprom); // 93C45
+
+ sega_315_5338a_device &io(SEGA_315_5338A(config, "io", 32_MHz_XTAL));
+ io.read_callback().set(FUNC(model1io_device::io_r));
+ io.write_callback().set(FUNC(model1io_device::io_w));
+ io.out_pa_callback().set(FUNC(model1io_device::io_pa_w));
+ io.in_pb_callback().set(FUNC(model1io_device::io_pb_r));
+ io.in_pc_callback().set(FUNC(model1io_device::io_pc_r));
+ io.in_pd_callback().set(FUNC(model1io_device::io_pd_r));
+ io.in_pe_callback().set(FUNC(model1io_device::io_pe_r));
+ io.out_pe_callback().set(FUNC(model1io_device::io_pe_w));
+ io.out_pf_callback().set(FUNC(model1io_device::io_pf_w));
+ io.in_pg_callback().set(FUNC(model1io_device::io_pg_r));
+
+ msm6253_device &adc(MSM6253(config, "adc", 0));
+ adc.set_input_cb<0>(FUNC(model1io_device::analog0_r), this);
+ adc.set_input_cb<1>(FUNC(model1io_device::analog1_r), this);
+ adc.set_input_cb<2>(FUNC(model1io_device::analog2_r), this);
+ adc.set_input_cb<3>(FUNC(model1io_device::analog3_r), this);
+}
//**************************************************************************
diff --git a/src/mame/machine/model1io.h b/src/mame/machine/model1io.h
index 78434ff5adb..7c78ab2cf18 100644
--- a/src/mame/machine/model1io.h
+++ b/src/mame/machine/model1io.h
@@ -23,52 +23,52 @@
//**************************************************************************
#define MCFG_MODEL1IO_READ_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_read_callback(DEVCB_##_devcb);
+ downcast<model1io_device &>(*device).set_read_callback(DEVCB_##_devcb);
#define MCFG_MODEL1IO_WRITE_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_write_callback(DEVCB_##_devcb);
+ downcast<model1io_device &>(*device).set_write_callback(DEVCB_##_devcb);
#define MCFG_MODEL1IO_IN0_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_in_callback(DEVCB_##_devcb, 0);
+ downcast<model1io_device &>(*device).set_in_callback(DEVCB_##_devcb, 0);
#define MCFG_MODEL1IO_IN1_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_in_callback(DEVCB_##_devcb, 1);
+ downcast<model1io_device &>(*device).set_in_callback(DEVCB_##_devcb, 1);
#define MCFG_MODEL1IO_IN2_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_in_callback(DEVCB_##_devcb, 2);
+ downcast<model1io_device &>(*device).set_in_callback(DEVCB_##_devcb, 2);
#define MCFG_MODEL1IO_DRIVE_READ_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_drive_read_callback(DEVCB_##_devcb);
+ downcast<model1io_device &>(*device).set_drive_read_callback(DEVCB_##_devcb);
#define MCFG_MODEL1IO_DRIVE_WRITE_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_drive_write_callback(DEVCB_##_devcb);
+ downcast<model1io_device &>(*device).set_drive_write_callback(DEVCB_##_devcb);
#define MCFG_MODEL1IO_AN0_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 0);
+ downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 0);
#define MCFG_MODEL1IO_AN1_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 1);
+ downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 1);
#define MCFG_MODEL1IO_AN2_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 2);
+ downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 2);
#define MCFG_MODEL1IO_AN3_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 3);
+ downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 3);
#define MCFG_MODEL1IO_AN4_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 4);
+ downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 4);
#define MCFG_MODEL1IO_AN5_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 5);
+ downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 5);
#define MCFG_MODEL1IO_AN6_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 6);
+ downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 6);
#define MCFG_MODEL1IO_AN7_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 7);
+ downcast<model1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 7);
#define MCFG_MODEL1IO_OUTPUT_CB(_devcb) \
- devcb = &downcast<model1io_device &>(*device).set_output_callback(DEVCB_##_devcb);
+ downcast<model1io_device &>(*device).set_output_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/mame/machine/model1io2.cpp b/src/mame/machine/model1io2.cpp
index 4a793bf63bb..4d142f5c5a8 100644
--- a/src/mame/machine/model1io2.cpp
+++ b/src/mame/machine/model1io2.cpp
@@ -135,57 +135,57 @@ const tiny_rom_entry *model1io2_device::device_rom_region() const
//-------------------------------------------------
MACHINE_CONFIG_START( model1io2_device::device_add_mconfig )
- MCFG_DEVICE_ADD("iocpu", TMPZ84C015, 19.6608_MHz_XTAL / 2) // TMPZ84C015AF-12
- MCFG_DEVICE_PROGRAM_MAP(mem_map)
+ tmpz84c015_device &iocpu(TMPZ84C015(config, "iocpu", 19.6608_MHz_XTAL / 2)); // TMPZ84C015AF-12
+ iocpu.set_addrmap(AS_PROGRAM, &model1io2_device::mem_map);
// SIO channel a baud rate adjusted by dsw1 1+2: 38400, 19200, 9600, 4800
- MCFG_TMPZ84C015_ZC2_CB(WRITELINE("iocpu", tmpz84c015_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("iocpu", tmpz84c015_device, txca_w))
- MCFG_TMPZ84C015_ZC3_CB(WRITELINE("iocpu", tmpz84c015_device, rxcb_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("iocpu", tmpz84c015_device, txcb_w))
-
- MCFG_TMPZ84C015_OUT_TXDA_CB(WRITELINE("cn7", rs232_port_device, write_txd))
- MCFG_TMPZ84C015_OUT_RTSA_CB(WRITELINE("cn7", rs232_port_device, write_rts))
- MCFG_TMPZ84C015_OUT_DTRA_CB(WRITELINE("cn7", rs232_port_device, write_dtr))
-
- MCFG_TMPZ84C015_OUT_TXDB_CB(WRITELINE("cn8", rs232_port_device, write_txd))
- MCFG_TMPZ84C015_OUT_RTSB_CB(WRITELINE("cn8", rs232_port_device, write_rts))
- MCFG_TMPZ84C015_OUT_DTRB_CB(WRITELINE("cn8", rs232_port_device, write_dtr))
-
- MCFG_TMPZ84C015_IN_PA_CB(IOPORT("dsw2"))
- MCFG_TMPZ84C015_IN_PB_CB(IOPORT("dsw3"))
-
- MCFG_DEVICE_ADD("cn7", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("iocpu", tmpz84c015_device, rxa_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("iocpu", tmpz84c015_device, ctsa_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("iocpu", tmpz84c015_device, dcda_w))
-
- MCFG_DEVICE_ADD("cn8", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("iocpu", tmpz84c015_device, rxb_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("iocpu", tmpz84c015_device, ctsb_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("iocpu", tmpz84c015_device, dcdb_w))
-
- MCFG_DEVICE_ADD("io", SEGA_315_5338A, 32_MHz_XTAL)
- MCFG_315_5338A_READ_CB(READ8(*this, model1io2_device, io_r))
- MCFG_315_5338A_WRITE_CB(WRITE8(*this, model1io2_device, io_w))
- MCFG_315_5338A_IN_PA_CB(READ8(*this, model1io2_device, io_pa_r))
- MCFG_315_5338A_IN_PB_CB(READ8(*this, model1io2_device, io_pb_r))
- MCFG_315_5338A_IN_PC_CB(READ8(*this, model1io2_device, io_pc_r))
- MCFG_315_5338A_OUT_PD_CB(WRITE8(*this, model1io2_device, io_pd_w))
- MCFG_315_5338A_IN_PE_CB(READ8(*this, model1io2_device, io_pe_r))
- MCFG_315_5338A_OUT_PE_CB(WRITE8(*this, model1io2_device, io_pe_w))
- MCFG_315_5338A_OUT_PF_CB(WRITE8(*this, model1io2_device, io_pf_w))
- MCFG_315_5338A_OUT_PG_CB(WRITE8(*this, model1io2_device, io_pg_w))
-
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT) // 93C45
-
- MCFG_DEVICE_ADD("watchdog", MB3773, 0)
-
- MCFG_DEVICE_ADD("adc", MSM6253, 32_MHz_XTAL / 16 / 4)
- MCFG_MSM6253_IN0_ANALOG_READ(model1io2_device, analog0_r)
- MCFG_MSM6253_IN1_ANALOG_READ(model1io2_device, analog1_r)
- MCFG_MSM6253_IN2_ANALOG_READ(model1io2_device, analog2_r)
- MCFG_MSM6253_IN3_ANALOG_READ(model1io2_device, analog3_r)
+ iocpu.zc_callback<2>().set("iocpu", FUNC(tmpz84c015_device::rxca_w));
+ iocpu.zc_callback<2>().append("iocpu", FUNC(tmpz84c015_device::txca_w));
+ iocpu.zc_callback<3>().set("iocpu", FUNC(tmpz84c015_device::rxcb_w));
+ iocpu.zc_callback<3>().append("iocpu", FUNC(tmpz84c015_device::txcb_w));
+
+ iocpu.out_txda_callback().set("cn7", FUNC(rs232_port_device::write_txd));
+ iocpu.out_rtsa_callback().set("cn7", FUNC(rs232_port_device::write_rts));
+ iocpu.out_dtra_callback().set("cn7", FUNC(rs232_port_device::write_dtr));
+
+ iocpu.out_txdb_callback().set("cn8", FUNC(rs232_port_device::write_txd));
+ iocpu.out_rtsb_callback().set("cn8", FUNC(rs232_port_device::write_rts));
+ iocpu.out_dtrb_callback().set("cn8", FUNC(rs232_port_device::write_dtr));
+
+ iocpu.in_pa_callback().set_ioport("dsw2");
+ iocpu.in_pb_callback().set_ioport("dsw3");
+
+ rs232_port_device &cn7(RS232_PORT(config, "cn7", default_rs232_devices, nullptr));
+ cn7.rxd_handler().set("iocpu", FUNC(tmpz84c015_device::rxa_w));
+ cn7.cts_handler().set("iocpu", FUNC(tmpz84c015_device::ctsa_w));
+ cn7.dcd_handler().set("iocpu", FUNC(tmpz84c015_device::dcda_w));
+
+ rs232_port_device &cn8(RS232_PORT(config, "cn8", default_rs232_devices, nullptr));
+ cn8.rxd_handler().set("iocpu", FUNC(tmpz84c015_device::rxb_w));
+ cn8.cts_handler().set("iocpu", FUNC(tmpz84c015_device::ctsb_w));
+ cn8.dcd_handler().set("iocpu", FUNC(tmpz84c015_device::dcdb_w));
+
+ sega_315_5338a_device &io(SEGA_315_5338A(config, "io", 32_MHz_XTAL));
+ io.read_callback().set(FUNC(model1io2_device::io_r));
+ io.write_callback().set(FUNC(model1io2_device::io_w));
+ io.in_pa_callback().set(FUNC(model1io2_device::io_pa_r));
+ io.in_pb_callback().set(FUNC(model1io2_device::io_pb_r));
+ io.in_pc_callback().set(FUNC(model1io2_device::io_pc_r));
+ io.out_pd_callback().set(FUNC(model1io2_device::io_pd_w));
+ io.in_pe_callback().set(FUNC(model1io2_device::io_pe_r));
+ io.out_pe_callback().set(FUNC(model1io2_device::io_pe_w));
+ io.out_pf_callback().set(FUNC(model1io2_device::io_pf_w));
+ io.out_pg_callback().set(FUNC(model1io2_device::io_pg_w));
+
+ EEPROM_SERIAL_93C46_16BIT(config, m_eeprom); // 93C45
+
+ MB3773(config, m_watchdog, 0);
+
+ msm6253_device &adc(MSM6253(config, "adc", 32_MHz_XTAL / 16 / 4));
+ adc.set_input_cb<0>(FUNC(model1io2_device::analog0_r), this);
+ adc.set_input_cb<1>(FUNC(model1io2_device::analog1_r), this);
+ adc.set_input_cb<2>(FUNC(model1io2_device::analog2_r), this);
+ adc.set_input_cb<3>(FUNC(model1io2_device::analog3_r), this);
// diagnostic lcd display
MCFG_SCREEN_ADD("screen", LCD)
diff --git a/src/mame/machine/model1io2.h b/src/mame/machine/model1io2.h
index f9e26a1ca3d..90e43430ff9 100644
--- a/src/mame/machine/model1io2.h
+++ b/src/mame/machine/model1io2.h
@@ -22,52 +22,52 @@
//**************************************************************************
#define MCFG_MODEL1IO2_READ_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_read_callback(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_read_callback(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_WRITE_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_write_callback(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_write_callback(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_IN0_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_in_callback<0>(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_in_callback<0>(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_IN1_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_in_callback<1>(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_in_callback<1>(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_IN2_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_in_callback<2>(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_in_callback<2>(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_DRIVE_READ_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_drive_read_callback(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_drive_read_callback(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_DRIVE_WRITE_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_drive_write_callback(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_drive_write_callback(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_AN0_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_an_callback<0>(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_an_callback<0>(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_AN1_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_an_callback<1>(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_an_callback<1>(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_AN2_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_an_callback<2>(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_an_callback<2>(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_AN3_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_an_callback<3>(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_an_callback<3>(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_AN4_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_an_callback<4>(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_an_callback<4>(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_AN5_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_an_callback<5>(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_an_callback<5>(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_AN6_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_an_callback<6>(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_an_callback<6>(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_AN7_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_an_callback<7>(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_an_callback<7>(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_OUTPUT_CB(_devcb) \
- devcb = &downcast<model1io2_device &>(*device).set_output_callback(DEVCB_##_devcb);
+ downcast<model1io2_device &>(*device).set_output_callback(DEVCB_##_devcb);
#define MCFG_MODEL1IO2_LIGHTGUN_P1Y_TAG(_tag) \
downcast<model1io2_device &>(*device).set_lightgun_tag<0>(_tag);
diff --git a/src/mame/machine/ms7004.h b/src/mame/machine/ms7004.h
index 608ba702723..4c6979a486e 100644
--- a/src/mame/machine/ms7004.h
+++ b/src/mame/machine/ms7004.h
@@ -17,10 +17,10 @@
//**************************************************************************
#define MCFG_MS7004_TX_HANDLER(_cb) \
- devcb = &downcast<ms7004_device &>(*device).set_tx_handler(DEVCB_##_cb);
+ downcast<ms7004_device &>(*device).set_tx_handler(DEVCB_##_cb);
#define MCFG_MS7004_RTS_HANDLER(_cb) \
- devcb = &downcast<ms7004_device &>(*device).set_rts_handler(DEVCB_##_cb);
+ downcast<ms7004_device &>(*device).set_rts_handler(DEVCB_##_cb);
//**************************************************************************
diff --git a/src/mame/machine/msx_matsushita.h b/src/mame/machine/msx_matsushita.h
index 8e155e2b399..0cf24e8bcdb 100644
--- a/src/mame/machine/msx_matsushita.h
+++ b/src/mame/machine/msx_matsushita.h
@@ -14,7 +14,7 @@ DECLARE_DEVICE_TYPE(MSX_MATSUSHITA, msx_matsushita_device)
MCFG_DEVICE_ADD(_tag, MSX_MATSUSHITA, 0)
#define MCFG_MSX_MATSUSHITA_TURBO_CB(_devcb) \
- devcb = &downcast<msx_matsushita_device &>(*device).set_turbo_callback(DEVCB_##_devcb);
+ downcast<msx_matsushita_device &>(*device).set_turbo_callback(DEVCB_##_devcb);
class msx_matsushita_device : public device_t,
diff --git a/src/mame/machine/namco06.h b/src/mame/machine/namco06.h
index a6a411be3ce..bce93495248 100644
--- a/src/mame/machine/namco06.h
+++ b/src/mame/machine/namco06.h
@@ -23,42 +23,42 @@ struct namco_06xx_config
downcast<namco_06xx_device &>(*device).set_maincpu(_tag);
#define MCFG_NAMCO_06XX_READ_0_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_read_callback<0>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_read_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO_06XX_READ_1_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_read_callback<1>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_read_callback<1>(DEVCB_##_devcb);
#define MCFG_NAMCO_06XX_READ_2_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_read_callback<2>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_read_callback<2>(DEVCB_##_devcb);
#define MCFG_NAMCO_06XX_READ_3_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_read_callback<3>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_read_callback<3>(DEVCB_##_devcb);
#define MCFG_NAMCO_06XX_READ_REQUEST_0_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_read_request_callback<0>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_read_request_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO_06XX_READ_REQUEST_1_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_read_request_callback<1>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_read_request_callback<1>(DEVCB_##_devcb);
#define MCFG_NAMCO_06XX_READ_REQUEST_2_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_read_request_callback<2>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_read_request_callback<2>(DEVCB_##_devcb);
#define MCFG_NAMCO_06XX_READ_REQUEST_3_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_read_request_callback<3>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_read_request_callback<3>(DEVCB_##_devcb);
#define MCFG_NAMCO_06XX_WRITE_0_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_write_callback<0>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_write_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO_06XX_WRITE_1_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_write_callback<1>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_write_callback<1>(DEVCB_##_devcb);
#define MCFG_NAMCO_06XX_WRITE_2_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_write_callback<2>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_write_callback<2>(DEVCB_##_devcb);
#define MCFG_NAMCO_06XX_WRITE_3_CB(_devcb) \
- devcb = &downcast<namco_06xx_device &>(*device).set_write_callback<3>(DEVCB_##_devcb);
+ downcast<namco_06xx_device &>(*device).set_write_callback<3>(DEVCB_##_devcb);
/* device get info callback */
diff --git a/src/mame/machine/namco51.h b/src/mame/machine/namco51.h
index 3f94482c9ce..0ee64727137 100644
--- a/src/mame/machine/namco51.h
+++ b/src/mame/machine/namco51.h
@@ -15,22 +15,22 @@
downcast<namco_51xx_device &>(*device).set_screen_tag(screen_tag);
#define MCFG_NAMCO_51XX_INPUT_0_CB(_devcb) \
- devcb = &downcast<namco_51xx_device &>(*device).set_input_callback<0>(DEVCB_##_devcb);
+ downcast<namco_51xx_device &>(*device).set_input_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO_51XX_INPUT_1_CB(_devcb) \
- devcb = &downcast<namco_51xx_device &>(*device).set_input_callback<1>(DEVCB_##_devcb);
+ downcast<namco_51xx_device &>(*device).set_input_callback<1>(DEVCB_##_devcb);
#define MCFG_NAMCO_51XX_INPUT_2_CB(_devcb) \
- devcb = &downcast<namco_51xx_device &>(*device).set_input_callback<2>(DEVCB_##_devcb);
+ downcast<namco_51xx_device &>(*device).set_input_callback<2>(DEVCB_##_devcb);
#define MCFG_NAMCO_51XX_INPUT_3_CB(_devcb) \
- devcb = &downcast<namco_51xx_device &>(*device).set_input_callback<3>(DEVCB_##_devcb);
+ downcast<namco_51xx_device &>(*device).set_input_callback<3>(DEVCB_##_devcb);
#define MCFG_NAMCO_51XX_OUTPUT_0_CB(_devcb) \
- devcb = &downcast<namco_51xx_device &>(*device).set_output_callback<0>(DEVCB_##_devcb);
+ downcast<namco_51xx_device &>(*device).set_output_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO_51XX_OUTPUT_1_CB(_devcb) \
- devcb = &downcast<namco_51xx_device &>(*device).set_output_callback<1>(DEVCB_##_devcb);
+ downcast<namco_51xx_device &>(*device).set_output_callback<1>(DEVCB_##_devcb);
class namco_51xx_device : public device_t
{
@@ -40,6 +40,8 @@ public:
template <typename T> void set_screen_tag(T &&tag) { m_screen.set_tag(std::forward<T>(tag)); }
template <unsigned N, class Object> devcb_base &set_input_callback(Object &&cb) { return m_in[N].set_callback(std::forward<Object>(cb)); }
template <unsigned N, class Object> devcb_base &set_output_callback(Object &&cb) { return m_out[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N> auto input_callback() { return m_in[N].bind(); }
+ template <unsigned N> auto output_callback() { return m_out[N].bind(); }
DECLARE_WRITE8_MEMBER( write );
DECLARE_READ8_MEMBER( read );
diff --git a/src/mame/machine/namco53.h b/src/mame/machine/namco53.h
index 7b8852bc738..ec2be4d9330 100644
--- a/src/mame/machine/namco53.h
+++ b/src/mame/machine/namco53.h
@@ -11,22 +11,22 @@
MCFG_DEVICE_ADD(_tag, NAMCO_53XX, _clock)
#define MCFG_NAMCO_53XX_K_CB(_devcb) \
- devcb = &downcast<namco_53xx_device &>(*device).set_k_port_callback(DEVCB_##_devcb);
+ downcast<namco_53xx_device &>(*device).set_k_port_callback(DEVCB_##_devcb);
#define MCFG_NAMCO_53XX_INPUT_0_CB(_devcb) \
- devcb = &downcast<namco_53xx_device &>(*device).set_input_callback<0>(DEVCB_##_devcb);
+ downcast<namco_53xx_device &>(*device).set_input_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO_53XX_INPUT_1_CB(_devcb) \
- devcb = &downcast<namco_53xx_device &>(*device).set_input_callback<1>(DEVCB_##_devcb);
+ downcast<namco_53xx_device &>(*device).set_input_callback<1>(DEVCB_##_devcb);
#define MCFG_NAMCO_53XX_INPUT_2_CB(_devcb) \
- devcb = &downcast<namco_53xx_device &>(*device).set_input_callback<2>(DEVCB_##_devcb);
+ downcast<namco_53xx_device &>(*device).set_input_callback<2>(DEVCB_##_devcb);
#define MCFG_NAMCO_53XX_INPUT_3_CB(_devcb) \
- devcb = &downcast<namco_53xx_device &>(*device).set_input_callback<3>(DEVCB_##_devcb);
+ downcast<namco_53xx_device &>(*device).set_input_callback<3>(DEVCB_##_devcb);
#define MCFG_NAMCO_53XX_P_CB(_devcb) \
- devcb = &downcast<namco_53xx_device &>(*device).set_p_port_callback(DEVCB_##_devcb);
+ downcast<namco_53xx_device &>(*device).set_p_port_callback(DEVCB_##_devcb);
class namco_53xx_device : public device_t
@@ -35,9 +35,12 @@ public:
namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <unsigned N, class Object> devcb_base &set_input_callback(Object &&cb) { return m_in[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N> auto input_callback() { return m_in[N].bind(); }
template <class Object> devcb_base &set_k_port_callback(Object &&cb) { return m_k.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_p_port_callback(Object &&cb) { return m_p.set_callback(std::forward<Object>(cb)); }
+ auto k_port_callback() { return m_k.bind(); }
+ auto p_port_callback() { return m_p.bind(); }
DECLARE_READ8_MEMBER( K_r );
DECLARE_READ8_MEMBER( R0_r );
diff --git a/src/mame/machine/namco62.h b/src/mame/machine/namco62.h
index c4bffda3ab9..5a2778ec572 100644
--- a/src/mame/machine/namco62.h
+++ b/src/mame/machine/namco62.h
@@ -9,22 +9,22 @@
MCFG_DEVICE_ADD(_tag, NAMCO_62XX, _clock)
#define MCFG_NAMCO_62XX_INPUT_0_CB(_devcb) \
- devcb = &downcast<namco_62xx_device &>(*device).set_input_callback<0>(DEVCB_##_devcb);
+ downcast<namco_62xx_device &>(*device).set_input_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO_62XX_INPUT_1_CB(_devcb) \
- devcb = &downcast<namco_62xx_device &>(*device).set_input_callback<1>(DEVCB_##_devcb);
+ downcast<namco_62xx_device &>(*device).set_input_callback<1>(DEVCB_##_devcb);
#define MCFG_NAMCO_62XX_INPUT_2_CB(_devcb) \
- devcb = &downcast<namco_62xx_device &>(*device).set_input_callback<2>(DEVCB_##_devcb);
+ downcast<namco_62xx_device &>(*device).set_input_callback<2>(DEVCB_##_devcb);
#define MCFG_NAMCO_62XX_INPUT_3_CB(_devcb) \
- devcb = &downcast<namco_62xx_device &>(*device).set_input_callback<3>(DEVCB_##_devcb);
+ downcast<namco_62xx_device &>(*device).set_input_callback<3>(DEVCB_##_devcb);
#define MCFG_NAMCO_62XX_OUTPUT_0_CB(_devcb) \
- devcb = &downcast<namco_62xx_device &>(*device).set_output_callback<0>(DEVCB_##_devcb);
+ downcast<namco_62xx_device &>(*device).set_output_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO_62XX_OUTPUT_1_CB(_devcb) \
- devcb = &downcast<namco_62xx_device &>(*device).set_output_callback<1>(DEVCB_##_devcb);
+ downcast<namco_62xx_device &>(*device).set_output_callback<1>(DEVCB_##_devcb);
class namco_62xx_device : public device_t
diff --git a/src/mame/machine/namco_c148.h b/src/mame/machine/namco_c148.h
index c2e2cab4e50..f63d958a0af 100644
--- a/src/mame/machine/namco_c148.h
+++ b/src/mame/machine/namco_c148.h
@@ -25,10 +25,10 @@
downcast<namco_c148_device &>(*device).link_c148_device(_tag);
#define MCFG_NAMCO_C148_EXT1_CB(_cb) \
- devcb = &downcast<namco_c148_device &>(*device).set_out_ext1_callback(DEVCB_##_cb);
+ downcast<namco_c148_device &>(*device).set_out_ext1_callback(DEVCB_##_cb);
#define MCFG_NAMCO_C148_EXT2_CB(_cb) \
- devcb = &downcast<namco_c148_device &>(*device).set_out_ext2_callback(DEVCB_##_cb);
+ downcast<namco_c148_device &>(*device).set_out_ext2_callback(DEVCB_##_cb);
//**************************************************************************
diff --git a/src/mame/machine/namcoio.h b/src/mame/machine/namcoio.h
index a0fd950369e..b788fd452a6 100644
--- a/src/mame/machine/namcoio.h
+++ b/src/mame/machine/namcoio.h
@@ -13,7 +13,8 @@ class namcoio_device : public device_t
public:
template <unsigned N, class Object> devcb_base &set_in_callback(Object &&cb) { return m_in_cb[N].set_callback(std::forward<Object>(cb)); }
template <unsigned N, class Object> devcb_base &set_out_callback(Object &&cb) { return m_out_cb[N].set_callback(std::forward<Object>(cb)); }
-
+ template <unsigned N> auto in_callback() { return m_in_cb[N].bind(); }
+ template <unsigned N> auto out_callback() { return m_out_cb[N].bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -89,59 +90,59 @@ DECLARE_DEVICE_TYPE(NAMCO_59XX, namco59xx_device)
***************************************************************************/
#define MCFG_NAMCO56XX_IN_0_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<0>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO56XX_IN_1_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<1>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<1>(DEVCB_##_devcb);
#define MCFG_NAMCO56XX_IN_2_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<2>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<2>(DEVCB_##_devcb);
#define MCFG_NAMCO56XX_IN_3_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<3>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<3>(DEVCB_##_devcb);
#define MCFG_NAMCO56XX_OUT_0_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_out_callback<0>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_out_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO56XX_OUT_1_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_out_callback<1>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_out_callback<1>(DEVCB_##_devcb);
#define MCFG_NAMCO58XX_IN_0_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<0>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO58XX_IN_1_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<1>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<1>(DEVCB_##_devcb);
#define MCFG_NAMCO58XX_IN_2_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<2>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<2>(DEVCB_##_devcb);
#define MCFG_NAMCO58XX_IN_3_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<3>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<3>(DEVCB_##_devcb);
#define MCFG_NAMCO58XX_OUT_0_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_out_callback<0>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_out_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO58XX_OUT_1_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_out_callback<1>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_out_callback<1>(DEVCB_##_devcb);
#define MCFG_NAMCO59XX_IN_0_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<0>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO59XX_IN_1_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<1>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<1>(DEVCB_##_devcb);
#define MCFG_NAMCO59XX_IN_2_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<2>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<2>(DEVCB_##_devcb);
#define MCFG_NAMCO59XX_IN_3_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_in_callback<3>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_in_callback<3>(DEVCB_##_devcb);
#define MCFG_NAMCO59XX_OUT_0_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_out_callback<0>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_out_callback<0>(DEVCB_##_devcb);
#define MCFG_NAMCO59XX_OUT_1_CB(_devcb) \
- devcb = &downcast<namcoio_device &>(*device).set_out_callback<1>(DEVCB_##_devcb);
+ downcast<namcoio_device &>(*device).set_out_callback<1>(DEVCB_##_devcb);
#endif // MAME_MACHINE_NAMCOIO_H
diff --git a/src/mame/machine/nb1412m2.h b/src/mame/machine/nb1412m2.h
index a570a7a4021..ae57cf2a1bb 100644
--- a/src/mame/machine/nb1412m2.h
+++ b/src/mame/machine/nb1412m2.h
@@ -21,7 +21,7 @@ Nichibutsu 1412M2 device emulation
MCFG_DEVICE_ADD((tag), NB1412M2, (freq))
#define MCFG_NB1412M2_DAC_CB(_devcb) \
- devcb = &downcast<nb1412m2_device &>(*device).set_dac_callback(DEVCB_##_devcb);
+ downcast<nb1412m2_device &>(*device).set_dac_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/mame/machine/nextkbd.h b/src/mame/machine/nextkbd.h
index 7e04b5e1ba6..7ec98122c56 100644
--- a/src/mame/machine/nextkbd.h
+++ b/src/mame/machine/nextkbd.h
@@ -7,13 +7,13 @@
#define MCFG_NEXTKBD_INT_CHANGE_CALLBACK(_write) \
- devcb = &downcast<nextkbd_device &>(*device).set_int_change_wr_callback(DEVCB_##_write);
+ downcast<nextkbd_device &>(*device).set_int_change_wr_callback(DEVCB_##_write);
#define MCFG_NEXTKBD_INT_POWER_CALLBACK(_write) \
- devcb = &downcast<nextkbd_device &>(*device).set_int_power_wr_callback(DEVCB_##_write);
+ downcast<nextkbd_device &>(*device).set_int_power_wr_callback(DEVCB_##_write);
#define MCFG_NEXTKBD_INT_NMI_CALLBACK(_write) \
- devcb = &downcast<nextkbd_device &>(*device).set_int_nmi_wr_callback(DEVCB_##_write);
+ downcast<nextkbd_device &>(*device).set_int_nmi_wr_callback(DEVCB_##_write);
class nextkbd_device : public device_t {
public:
diff --git a/src/mame/machine/nextmo.h b/src/mame/machine/nextmo.h
index 90d778f2877..af88f690f9d 100644
--- a/src/mame/machine/nextmo.h
+++ b/src/mame/machine/nextmo.h
@@ -6,10 +6,10 @@
#pragma once
#define MCFG_NEXTMO_IRQ_CALLBACK(_write) \
- devcb = &downcast<nextmo_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
+ downcast<nextmo_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_NEXTMO_DRQ_CALLBACK(_write) \
- devcb = &downcast<nextmo_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
+ downcast<nextmo_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
class nextmo_device : public device_t
{
diff --git a/src/mame/machine/pc1512kb.h b/src/mame/machine/pc1512kb.h
index fe5f7c5b30a..f4830b9221d 100644
--- a/src/mame/machine/pc1512kb.h
+++ b/src/mame/machine/pc1512kb.h
@@ -30,10 +30,10 @@
//**************************************************************************
#define MCFG_PC1512_KEYBOARD_CLOCK_CALLBACK(_write) \
- devcb = &downcast<pc1512_keyboard_device &>(*device).set_clock_wr_callback(DEVCB_##_write);
+ downcast<pc1512_keyboard_device &>(*device).set_clock_wr_callback(DEVCB_##_write);
#define MCFG_PC1512_KEYBOARD_DATA_CALLBACK(_write) \
- devcb = &downcast<pc1512_keyboard_device &>(*device).set_data_wr_callback(DEVCB_##_write);
+ downcast<pc1512_keyboard_device &>(*device).set_data_wr_callback(DEVCB_##_write);
diff --git a/src/mame/machine/pc9801_kbd.h b/src/mame/machine/pc9801_kbd.h
index 140a8c326e5..7275bf99666 100644
--- a/src/mame/machine/pc9801_kbd.h
+++ b/src/mame/machine/pc9801_kbd.h
@@ -17,7 +17,7 @@
//**************************************************************************
#define MCFG_PC9801_KBD_IRQ_CALLBACK(_write) \
- devcb = &downcast<pc9801_kbd_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
+ downcast<pc9801_kbd_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
//**************************************************************************
diff --git a/src/mame/machine/pcd_kbd.h b/src/mame/machine/pcd_kbd.h
index b8f95c2853a..2fce6e8e31e 100644
--- a/src/mame/machine/pcd_kbd.h
+++ b/src/mame/machine/pcd_kbd.h
@@ -6,7 +6,7 @@
#pragma once
#define MCFG_PCD_KEYBOARD_OUT_TX_HANDLER(_devcb) \
- devcb = &downcast<pcd_keyboard_device &>(*device).set_out_tx_handler(DEVCB_##_devcb);
+ downcast<pcd_keyboard_device &>(*device).set_out_tx_handler(DEVCB_##_devcb);
class pcd_keyboard_device : public device_t
{
diff --git a/src/mame/machine/pcshare.cpp b/src/mame/machine/pcshare.cpp
index 0ab2e7f20bc..67caa8e7415 100644
--- a/src/mame/machine/pcshare.cpp
+++ b/src/mame/machine/pcshare.cpp
@@ -190,12 +190,12 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(pcat_base_state::pcat_common)
MCFG_DEVICE_ADD("pic8259_1", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, pcat_base_state, get_slave_ack))
MCFG_DEVICE_ADD("pic8259_2", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic8259_1", pic8259_device, ir2_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("dma8237_1", AM9517A, 14.318181_MHz_XTAL / 3)
MCFG_I8237_OUT_HREQ_CB(WRITELINE(*this, pcat_base_state, pc_dma_hrq_changed))
diff --git a/src/mame/machine/ps2timer.h b/src/mame/machine/ps2timer.h
index 879526f1d92..902bf93af0a 100644
--- a/src/mame/machine/ps2timer.h
+++ b/src/mame/machine/ps2timer.h
@@ -14,7 +14,6 @@
#pragma once
-#include "emu.h"
class ps2_timer_device : public device_t
{
@@ -115,4 +114,4 @@ protected:
DECLARE_DEVICE_TYPE(SONYPS2_TIMER, ps2_timer_device)
-#endif // MAME_MACHINE_PS2TIMER_H \ No newline at end of file
+#endif // MAME_MACHINE_PS2TIMER_H
diff --git a/src/mame/machine/psxcd.h b/src/mame/machine/psxcd.h
index dd9b19dfbe4..2a32e094ff9 100644
--- a/src/mame/machine/psxcd.h
+++ b/src/mame/machine/psxcd.h
@@ -13,7 +13,7 @@
//**************************************************************************
#define MCFG_PSXCD_IRQ_HANDLER(_devcb) \
- devcb = &downcast<psxcd_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<psxcd_device &>(*device).set_irq_handler(DEVCB_##_devcb);
class psxcd_device : public cdrom_image_device
{
diff --git a/src/mame/machine/qimi.h b/src/mame/machine/qimi.h
index baef9984218..0ebfad9a8a5 100644
--- a/src/mame/machine/qimi.h
+++ b/src/mame/machine/qimi.h
@@ -19,7 +19,7 @@
//**************************************************************************
#define MCFG_QIMI_EXTINT_CALLBACK(_write) \
- devcb = &downcast<qimi_device &>(*device).set_exting_wr_callback(DEVCB_##_write);
+ downcast<qimi_device &>(*device).set_exting_wr_callback(DEVCB_##_write);
diff --git a/src/mame/machine/rad_eu3a05gpio.h b/src/mame/machine/rad_eu3a05gpio.h
index 435e09be56f..329ac588940 100644
--- a/src/mame/machine/rad_eu3a05gpio.h
+++ b/src/mame/machine/rad_eu3a05gpio.h
@@ -5,13 +5,13 @@
#define MAME_AUDIO_RAD_EU3A05GPIO_H
#define MCFG_RADICA6502_GPIO_READ_PORT0_CB(_devcb) \
- devcb = &downcast<radica6502_gpio_device &>(*device).set_gpio_read_0_callback(DEVCB_##_devcb);
+ downcast<radica6502_gpio_device &>(*device).set_gpio_read_0_callback(DEVCB_##_devcb);
#define MCFG_RADICA6502_GPIO_READ_PORT1_CB(_devcb) \
- devcb = &downcast<radica6502_gpio_device &>(*device).set_gpio_read_1_callback(DEVCB_##_devcb);
+ downcast<radica6502_gpio_device &>(*device).set_gpio_read_1_callback(DEVCB_##_devcb);
#define MCFG_RADICA6502_GPIO_READ_PORT2_CB(_devcb) \
- devcb = &downcast<radica6502_gpio_device &>(*device).set_gpio_read_2_callback(DEVCB_##_devcb);
+ downcast<radica6502_gpio_device &>(*device).set_gpio_read_2_callback(DEVCB_##_devcb);
class radica6502_gpio_device : public device_t
diff --git a/src/mame/machine/segaic16.h b/src/mame/machine/segaic16.h
index 4cd2c64cbd7..48b6c0c3b59 100644
--- a/src/mame/machine/segaic16.h
+++ b/src/mame/machine/segaic16.h
@@ -27,9 +27,9 @@
#define MCFG_SEGA_315_5195_MAPPER_HANDLER(_class, _mapper) \
downcast<sega_315_5195_mapper_device &>(*device).set_mapper(sega_315_5195_mapper_device::mapper_delegate(&_class::_mapper, #_class "::" #_mapper, nullptr, (_class *)nullptr));
#define MCFG_SEGA_315_5195_PBF_CALLBACK(_devcb) \
- devcb = &downcast<sega_315_5195_mapper_device &>(*device).set_pbf_callback(DEVCB_##_devcb);
+ downcast<sega_315_5195_mapper_device &>(*device).set_pbf_callback(DEVCB_##_devcb);
#define MCFG_SEGA_315_5195_MCU_INT_CALLBACK(_devcb) \
- devcb = &downcast<sega_315_5195_mapper_device &>(*device).set_mcu_int_callback(DEVCB_##_devcb);
+ downcast<sega_315_5195_mapper_device &>(*device).set_mcu_int_callback(DEVCB_##_devcb);
#define MCFG_SEGA_315_5248_MULTIPLIER_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, SEGA_315_5248_MULTIPLIER, 0)
@@ -37,13 +37,6 @@
#define MCFG_SEGA_315_5249_DIVIDER_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, SEGA_315_5249_DIVIDER, 0)
-#define MCFG_SEGA_315_5250_COMPARE_TIMER_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, SEGA_315_5250_COMPARE_TIMER, 0)
-#define MCFG_SEGA_315_5250_68KINT_CALLBACK(_devcb) \
- devcb = &downcast<sega_315_5250_compare_timer_device &>(*device).set_68kint_callback(DEVCB_##_devcb);
-#define MCFG_SEGA_315_5250_ZINT_CALLBACK(_devcb) \
- devcb = &downcast<sega_315_5250_compare_timer_device &>(*device).set_zint_callback(DEVCB_##_devcb);
-
//**************************************************************************
// TYPE DEFINITIONS
@@ -252,8 +245,8 @@ public:
sega_315_5250_compare_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration helpers
- template<class Object> devcb_base &set_68kint_callback(Object &&object) { return m_68kint_callback.set_callback(std::forward<Object>(object)); }
- template<class Object> devcb_base &set_zint_callback(Object &&object) { return m_zint_callback.set_callback(std::forward<Object>(object)); }
+ auto m68kint_callback() { return m_68kint_callback.bind(); }
+ auto zint_callback() { return m_zint_callback.bind(); }
// public interface
DECLARE_WRITE_LINE_MEMBER(exck_w);
diff --git a/src/mame/machine/seibucop/seibucop.h b/src/mame/machine/seibucop/seibucop.h
index 7bd5809d9bf..2ab5e2ab6b6 100644
--- a/src/mame/machine/seibucop/seibucop.h
+++ b/src/mame/machine/seibucop/seibucop.h
@@ -17,10 +17,10 @@
#define LOG_Move0905 0
#define MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(_devcb) \
- devcb = &downcast<raiden2cop_device &>(*device).set_videoramout_cb(DEVCB_##_devcb);
+ downcast<raiden2cop_device &>(*device).set_videoramout_cb(DEVCB_##_devcb);
#define MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(_devcb) \
- devcb = &downcast<raiden2cop_device &>(*device).set_paletteramout_cb(DEVCB_##_devcb);
+ downcast<raiden2cop_device &>(*device).set_paletteramout_cb(DEVCB_##_devcb);
#define MCFG_RAIDEN2COP_HOST_CPU(_tag) \
downcast<raiden2cop_device &>(*device).set_host_cpu_tag(_tag);
diff --git a/src/mame/machine/tait8741.h b/src/mame/machine/tait8741.h
index 5da76a49d7a..ceb9b39e823 100644
--- a/src/mame/machine/tait8741.h
+++ b/src/mame/machine/tait8741.h
@@ -18,10 +18,10 @@
MCFG_DEVICE_ADD(_tag, TAITO8741_4PACK, 0)
#define MCFG_TAITO8741_PORT_HANDLERS(_devcb0, _devcb1, _devcb2, _devcb3) \
- devcb = &downcast<taito8741_4pack_device &>(*device).set_port_handler_0_callback(DEVCB_##_devcb0); \
- devcb = &downcast<taito8741_4pack_device &>(*device).set_port_handler_1_callback(DEVCB_##_devcb1); \
- devcb = &downcast<taito8741_4pack_device &>(*device).set_port_handler_2_callback(DEVCB_##_devcb2); \
- devcb = &downcast<taito8741_4pack_device &>(*device).set_port_handler_3_callback(DEVCB_##_devcb3);
+ downcast<taito8741_4pack_device &>(*device).set_port_handler_0_callback(DEVCB_##_devcb0); \
+ downcast<taito8741_4pack_device &>(*device).set_port_handler_1_callback(DEVCB_##_devcb1); \
+ downcast<taito8741_4pack_device &>(*device).set_port_handler_2_callback(DEVCB_##_devcb2); \
+ downcast<taito8741_4pack_device &>(*device).set_port_handler_3_callback(DEVCB_##_devcb3);
#define MCFG_TAITO8741_MODES(_mode0, _mode1, _mode2, _mode3) \
downcast<taito8741_4pack_device &>(*device).set_mode(0, _mode0); \
diff --git a/src/mame/machine/taito68705interface.h b/src/mame/machine/taito68705interface.h
index ce87836187e..80871f77799 100644
--- a/src/mame/machine/taito68705interface.h
+++ b/src/mame/machine/taito68705interface.h
@@ -63,7 +63,7 @@ private:
#define MCFG_TAITO_M68705_AUX_STROBE_CB(cb) \
- devcb = &downcast<taito68705_mcu_device &>(*device).set_aux_strobe_cb(DEVCB_##cb);
+ downcast<taito68705_mcu_device &>(*device).set_aux_strobe_cb(DEVCB_##cb);
class taito68705_mcu_device : public taito68705_mcu_device_base
{
@@ -98,10 +98,10 @@ protected:
#define MCFG_ARKANOID_MCU_SEMAPHORE_CB(cb) \
- devcb = &downcast<arkanoid_mcu_device_base &>(*device).set_semaphore_cb(DEVCB_##cb);
+ downcast<arkanoid_mcu_device_base &>(*device).set_semaphore_cb(DEVCB_##cb);
#define MCFG_ARKANOID_MCU_PORTB_R_CB(cb) \
- devcb = &downcast<arkanoid_mcu_device_base &>(*device).set_portb_r_cb(DEVCB_##cb);
+ downcast<arkanoid_mcu_device_base &>(*device).set_portb_r_cb(DEVCB_##cb);
class arkanoid_mcu_device_base : public taito68705_mcu_device_base
{
diff --git a/src/mame/machine/taitocchip.h b/src/mame/machine/taitocchip.h
index 526b54137c4..f551a7192b0 100644
--- a/src/mame/machine/taitocchip.h
+++ b/src/mame/machine/taitocchip.h
@@ -15,25 +15,25 @@ DECLARE_DEVICE_TYPE(TAITO_CCHIP, taito_cchip_device)
MCFG_DEVICE_ADD(_tag, TAITO_CCHIP, _clock)
#define MCFG_CCHIP_IN_PORTA_CB(_devcb) \
- devcb = &downcast<taito_cchip_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
+ downcast<taito_cchip_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
#define MCFG_CCHIP_IN_PORTB_CB(_devcb) \
- devcb = &downcast<taito_cchip_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
+ downcast<taito_cchip_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
#define MCFG_CCHIP_IN_PORTC_CB(_devcb) \
- devcb = &downcast<taito_cchip_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
+ downcast<taito_cchip_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
#define MCFG_CCHIP_IN_PORTAD_CB(_devcb) \
- devcb = &downcast<taito_cchip_device &>(*device).set_in_ad_callback(DEVCB_##_devcb);
+ downcast<taito_cchip_device &>(*device).set_in_ad_callback(DEVCB_##_devcb);
#define MCFG_CCHIP_OUT_PORTA_CB(_devcb) \
- devcb = &downcast<taito_cchip_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
+ downcast<taito_cchip_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
#define MCFG_CCHIP_OUT_PORTB_CB(_devcb) \
- devcb = &downcast<taito_cchip_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
+ downcast<taito_cchip_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
#define MCFG_CCHIP_OUT_PORTC_CB(_devcb) \
- devcb = &downcast<taito_cchip_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
+ downcast<taito_cchip_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
class taito_cchip_device : public device_t
diff --git a/src/mame/machine/taitoio.h b/src/mame/machine/taitoio.h
index 63b843b8f28..06bd5868d2d 100644
--- a/src/mame/machine/taitoio.h
+++ b/src/mame/machine/taitoio.h
@@ -21,12 +21,12 @@ class tc0040ioc_device : public device_t
public:
tc0040ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_read_0_callback(Object &&cb) { return m_read_0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_1_callback(Object &&cb) { return m_read_1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_2_callback(Object &&cb) { return m_read_2_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_3_callback(Object &&cb) { return m_read_3_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_write_4_callback(Object &&cb) { return m_write_4_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_7_callback(Object &&cb) { return m_read_7_cb.set_callback(std::forward<Object>(cb)); }
+ auto read_0_callback() { return m_read_0_cb.bind(); }
+ auto read_1_callback() { return m_read_1_cb.bind(); }
+ auto read_2_callback() { return m_read_2_cb.bind(); }
+ auto read_3_callback() { return m_read_3_cb.bind(); }
+ auto write_4_callback() { return m_write_4_cb.bind(); }
+ auto read_7_callback() { return m_read_7_cb.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -64,13 +64,13 @@ class tc0220ioc_device : public device_t
public:
tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_read_0_callback(Object &&cb) { return m_read_0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_1_callback(Object &&cb) { return m_read_1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_2_callback(Object &&cb) { return m_read_2_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_3_callback(Object &&cb) { return m_read_3_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_write_3_callback(Object &&cb) { return m_write_3_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_write_4_callback(Object &&cb) { return m_write_4_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_7_callback(Object &&cb) { return m_read_7_cb.set_callback(std::forward<Object>(cb)); }
+ auto read_0_callback() { return m_read_0_cb.bind(); }
+ auto read_1_callback() { return m_read_1_cb.bind(); }
+ auto read_2_callback() { return m_read_2_cb.bind(); }
+ auto read_3_callback() { return m_read_3_cb.bind(); }
+ auto write_3_callback() { return m_write_3_cb.bind(); }
+ auto write_4_callback() { return m_write_4_cb.bind(); }
+ auto read_7_callback() { return m_read_7_cb.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -103,13 +103,13 @@ class tc0510nio_device : public device_t
public:
tc0510nio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_read_0_callback(Object &&cb) { return m_read_0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_1_callback(Object &&cb) { return m_read_1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_2_callback(Object &&cb) { return m_read_2_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_3_callback(Object &&cb) { return m_read_3_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_write_3_callback(Object &&cb) { return m_write_3_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_write_4_callback(Object &&cb) { return m_write_4_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_7_callback(Object &&cb) { return m_read_7_cb.set_callback(std::forward<Object>(cb)); }
+ auto read_0_callback() { return m_read_0_cb.bind(); }
+ auto read_1_callback() { return m_read_1_cb.bind(); }
+ auto read_2_callback() { return m_read_2_cb.bind(); }
+ auto read_3_callback() { return m_read_3_cb.bind(); }
+ auto write_3_callback() { return m_write_3_cb.bind(); }
+ auto write_4_callback() { return m_write_4_cb.bind(); }
+ auto read_7_callback() { return m_read_7_cb.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -146,13 +146,12 @@ class tc0640fio_device : public device_t
public:
tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_read_0_callback(Object &&cb) { return m_read_0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_1_callback(Object &&cb) { return m_read_1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_2_callback(Object &&cb) { return m_read_2_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_3_callback(Object &&cb) { return m_read_3_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_write_4_callback(Object &&cb) { return m_write_4_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_7_callback(Object &&cb) { return m_read_7_cb.set_callback(std::forward<Object>(cb)); }
-
+ auto read_0_callback() { return m_read_0_cb.bind(); }
+ auto read_1_callback() { return m_read_1_cb.bind(); }
+ auto read_2_callback() { return m_read_2_cb.bind(); }
+ auto read_3_callback() { return m_read_3_cb.bind(); }
+ auto write_4_callback() { return m_write_4_cb.bind(); }
+ auto read_7_callback() { return m_read_7_cb.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -183,91 +182,4 @@ protected:
DECLARE_DEVICE_TYPE(TC0640FIO, tc0640fio_device)
-
-/***************************************************************************
- DEVICE CONFIGURATION MACROS
-***************************************************************************/
-
-#define MCFG_TC0040IOC_READ_0_CB(_devcb) \
- devcb = &downcast<tc0040ioc_device &>(*device).set_read_0_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0040IOC_READ_1_CB(_devcb) \
- devcb = &downcast<tc0040ioc_device &>(*device).set_read_1_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0040IOC_READ_2_CB(_devcb) \
- devcb = &downcast<tc0040ioc_device &>(*device).set_read_2_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0040IOC_READ_3_CB(_devcb) \
- devcb = &downcast<tc0040ioc_device &>(*device).set_read_3_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0040IOC_WRITE_4_CB(_devcb) \
- devcb = &downcast<tc0040ioc_device &>(*device).set_write_4_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0040IOC_READ_7_CB(_devcb) \
- devcb = &downcast<tc0040ioc_device &>(*device).set_read_7_callback(DEVCB_##_devcb);
-
-
-#define MCFG_TC0220IOC_READ_0_CB(_devcb) \
- devcb = &downcast<tc0220ioc_device &>(*device).set_read_0_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0220IOC_READ_1_CB(_devcb) \
- devcb = &downcast<tc0220ioc_device &>(*device).set_read_1_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0220IOC_READ_2_CB(_devcb) \
- devcb = &downcast<tc0220ioc_device &>(*device).set_read_2_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0220IOC_READ_3_CB(_devcb) \
- devcb = &downcast<tc0220ioc_device &>(*device).set_read_3_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0220IOC_WRITE_3_CB(_devcb) \
- devcb = &downcast<tc0220ioc_device &>(*device).set_write_3_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0220IOC_WRITE_4_CB(_devcb) \
- devcb = &downcast<tc0220ioc_device &>(*device).set_write_4_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0220IOC_READ_7_CB(_devcb) \
- devcb = &downcast<tc0220ioc_device &>(*device).set_read_7_callback(DEVCB_##_devcb);
-
-
-#define MCFG_TC0510NIO_READ_0_CB(_devcb) \
- devcb = &downcast<tc0510nio_device &>(*device).set_read_0_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0510NIO_READ_1_CB(_devcb) \
- devcb = &downcast<tc0510nio_device &>(*device).set_read_1_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0510NIO_READ_2_CB(_devcb) \
- devcb = &downcast<tc0510nio_device &>(*device).set_read_2_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0510NIO_READ_3_CB(_devcb) \
- devcb = &downcast<tc0510nio_device &>(*device).set_read_3_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0510NIO_WRITE_3_CB(_devcb) \
- devcb = &downcast<tc0510nio_device &>(*device).set_write_3_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0510NIO_WRITE_4_CB(_devcb) \
- devcb = &downcast<tc0510nio_device &>(*device).set_write_4_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0510NIO_READ_7_CB(_devcb) \
- devcb = &downcast<tc0510nio_device &>(*device).set_read_7_callback(DEVCB_##_devcb);
-
-
-#define MCFG_TC0640FIO_READ_0_CB(_devcb) \
- devcb = &downcast<tc0640fio_device &>(*device).set_read_0_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0640FIO_READ_1_CB(_devcb) \
- devcb = &downcast<tc0640fio_device &>(*device).set_read_1_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0640FIO_READ_2_CB(_devcb) \
- devcb = &downcast<tc0640fio_device &>(*device).set_read_2_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0640FIO_READ_3_CB(_devcb) \
- devcb = &downcast<tc0640fio_device &>(*device).set_read_3_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0640FIO_WRITE_4_CB(_devcb) \
- devcb = &downcast<tc0640fio_device &>(*device).set_write_4_callback(DEVCB_##_devcb);
-
-#define MCFG_TC0640FIO_READ_7_CB(_devcb) \
- devcb = &downcast<tc0640fio_device &>(*device).set_read_7_callback(DEVCB_##_devcb);
-
-
#endif // MAME_MACHINE_TAITOIO_H
diff --git a/src/mame/machine/taitosjsec.h b/src/mame/machine/taitosjsec.h
index 48ccfe57a1b..d46e5ec705f 100644
--- a/src/mame/machine/taitosjsec.h
+++ b/src/mame/machine/taitosjsec.h
@@ -13,13 +13,13 @@ DECLARE_DEVICE_TYPE(TAITO_SJ_SECURITY_MCU, taito_sj_security_mcu_device)
#define MCFG_TAITO_SJ_SECURITY_MCU_INT_MODE(mode) \
downcast<taito_sj_security_mcu_device &>(*device).set_int_mode(taito_sj_security_mcu_device::int_mode::mode);
#define MCFG_TAITO_SJ_SECURITY_MCU_68READ_CB(cb) \
- devcb = &downcast<taito_sj_security_mcu_device &>(*device).set_68read_cb(DEVCB_##cb);
+ downcast<taito_sj_security_mcu_device &>(*device).set_68read_cb(DEVCB_##cb);
#define MCFG_TAITO_SJ_SECURITY_MCU_68WRITE_CB(cb) \
- devcb = &downcast<taito_sj_security_mcu_device &>(*device).set_68write_cb(DEVCB_##cb);
+ downcast<taito_sj_security_mcu_device &>(*device).set_68write_cb(DEVCB_##cb);
#define MCFG_TAITO_SJ_SECURITY_MCU_68INTRQ_CB(cb) \
- devcb = &downcast<taito_sj_security_mcu_device &>(*device).set_68intrq_cb(DEVCB_##cb);
+ downcast<taito_sj_security_mcu_device &>(*device).set_68intrq_cb(DEVCB_##cb);
#define MCFG_TAITO_SJ_SECURITY_MCU_BUSRQ_CB(cb) \
- devcb = &downcast<taito_sj_security_mcu_device &>(*device).set_busrq_cb(DEVCB_##cb);
+ downcast<taito_sj_security_mcu_device &>(*device).set_busrq_cb(DEVCB_##cb);
class taito_sj_security_mcu_device : public device_t
{
diff --git a/src/mame/machine/tandy2kb.h b/src/mame/machine/tandy2kb.h
index 39ecdace66f..1af6a5d3b52 100644
--- a/src/mame/machine/tandy2kb.h
+++ b/src/mame/machine/tandy2kb.h
@@ -28,10 +28,10 @@
//**************************************************************************
#define MCFG_TANDY2000_KEYBOARD_CLOCK_CALLBACK(_write) \
- devcb = &downcast<tandy2k_keyboard_device &>(*device).set_clock_wr_callback(DEVCB_##_write);
+ downcast<tandy2k_keyboard_device &>(*device).set_clock_wr_callback(DEVCB_##_write);
#define MCFG_TANDY2000_KEYBOARD_DATA_CALLBACK(_write) \
- devcb = &downcast<tandy2k_keyboard_device &>(*device).set_data_wr_callback(DEVCB_##_write);
+ downcast<tandy2k_keyboard_device &>(*device).set_data_wr_callback(DEVCB_##_write);
diff --git a/src/mame/machine/trs80m2kb.h b/src/mame/machine/trs80m2kb.h
index 9637f240601..b3f0d987855 100644
--- a/src/mame/machine/trs80m2kb.h
+++ b/src/mame/machine/trs80m2kb.h
@@ -29,7 +29,7 @@
//**************************************************************************
#define MCFG_TRS80M2_KEYBOARD_CLOCK_CALLBACK(_write) \
- devcb = &downcast<trs80m2_keyboard_device &>(*device).set_clock_wr_callback(DEVCB_##_write);
+ downcast<trs80m2_keyboard_device &>(*device).set_clock_wr_callback(DEVCB_##_write);
diff --git a/src/mame/machine/upd65031.h b/src/mame/machine/upd65031.h
index 17e6ec64913..490772f4777 100644
--- a/src/mame/machine/upd65031.h
+++ b/src/mame/machine/upd65031.h
@@ -18,16 +18,16 @@
//**************************************************************************
#define MCFG_UPD65031_KB_CALLBACK(_read) \
- devcb = &downcast<upd65031_device &>(*device).set_kb_rd_callback(DEVCB_##_read);
+ downcast<upd65031_device &>(*device).set_kb_rd_callback(DEVCB_##_read);
#define MCFG_UPD65031_INT_CALLBACK(_write) \
- devcb = &downcast<upd65031_device &>(*device).set_int_wr_callback(DEVCB_##_write);
+ downcast<upd65031_device &>(*device).set_int_wr_callback(DEVCB_##_write);
#define MCFG_UPD65031_NMI_CALLBACK(_write) \
- devcb = &downcast<upd65031_device &>(*device).set_nmi_wr_callback(DEVCB_##_write);
+ downcast<upd65031_device &>(*device).set_nmi_wr_callback(DEVCB_##_write);
#define MCFG_UPD65031_SPKR_CALLBACK(_write) \
- devcb = &downcast<upd65031_device &>(*device).set_spkr_wr_callback(DEVCB_##_write);
+ downcast<upd65031_device &>(*device).set_spkr_wr_callback(DEVCB_##_write);
#define MCFG_UPD65031_SCR_UPDATE_CB(_class, _method) \
downcast<upd65031_device &>(*device).set_screen_update_callback(upd65031_screen_update_delegate(&_class::_method, #_class "::" #_method, this));
@@ -59,6 +59,10 @@ public:
template <class Object> devcb_base &set_int_wr_callback(Object &&cb) { return m_write_int.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_nmi_wr_callback(Object &&cb) { return m_write_nmi.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_spkr_wr_callback(Object &&cb) { return m_write_spkr.set_callback(std::forward<Object>(cb)); }
+ auto kb_rd_callback() { return m_read_kb.bind(); }
+ auto int_wr_callback() { return m_write_int.bind(); }
+ auto nmi_wr_callback() { return m_write_nmi.bind(); }
+ auto spkr_wr_callback() { return m_write_spkr.bind(); }
template <class Object> void set_screen_update_callback(Object &&cb) { m_screen_update_cb = std::forward<Object>(cb); }
template <class Object> void set_memory_update_callback(Object &&cb) { m_out_mem_cb = std::forward<Object>(cb); }
diff --git a/src/mame/machine/v1050kb.h b/src/mame/machine/v1050kb.h
index 96172ba33ff..a36280bb425 100644
--- a/src/mame/machine/v1050kb.h
+++ b/src/mame/machine/v1050kb.h
@@ -21,7 +21,7 @@
//**************************************************************************
#define MCFG_V1050_KEYBOARD_OUT_TX_HANDLER(_devcb) \
- devcb = &downcast<v1050_keyboard_device &>(*device).set_out_tx_handler(DEVCB_##_devcb);
+ downcast<v1050_keyboard_device &>(*device).set_out_tx_handler(DEVCB_##_devcb);
diff --git a/src/mame/machine/victor9k_fdc.h b/src/mame/machine/victor9k_fdc.h
index 649598af50c..a7c39c6e7b5 100644
--- a/src/mame/machine/victor9k_fdc.h
+++ b/src/mame/machine/victor9k_fdc.h
@@ -20,21 +20,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_VICTOR_9000_FDC_IRQ_CB(_write) \
- devcb = &downcast<victor_9000_fdc_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
-
-#define MCFG_VICTOR_9000_FDC_SYN_CB(_write) \
- devcb = &downcast<victor_9000_fdc_device &>(*device).set_syn_wr_callback(DEVCB_##_write);
-
-#define MCFG_VICTOR_9000_FDC_LBRDY_CB(_write) \
- devcb = &downcast<victor_9000_fdc_device &>(*device).set_lbrdy_wr_callback(DEVCB_##_write);
-
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -46,9 +31,9 @@ public:
// construction/destruction
victor_9000_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_syn_wr_callback(Object &&cb) { return m_syn_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_lbrdy_wr_callback(Object &&cb) { return m_lbrdy_cb.set_callback(std::forward<Object>(cb)); }
+ auto irq_wr_callback() { return m_irq_cb.bind(); }
+ auto syn_wr_callback() { return m_syn_cb.bind(); }
+ auto lbrdy_wr_callback() { return m_lbrdy_cb.bind(); }
DECLARE_READ8_MEMBER( cs5_r ) { return m_via4->read(space, offset); }
DECLARE_WRITE8_MEMBER( cs5_w ) { m_via4->write(space, offset, data); }
diff --git a/src/mame/machine/victor9k_kb.h b/src/mame/machine/victor9k_kb.h
index e1e042ac7e3..683100506c9 100644
--- a/src/mame/machine/victor9k_kb.h
+++ b/src/mame/machine/victor9k_kb.h
@@ -21,10 +21,10 @@
//**************************************************************************
#define MCFG_VICTOR9K_KBRDY_HANDLER(_devcb) \
- devcb = &downcast<victor_9000_keyboard_device &>(*device).set_kbrdy_cb(DEVCB_##_devcb);
+ downcast<victor_9000_keyboard_device &>(*device).set_kbrdy_cb(DEVCB_##_devcb);
#define MCFG_VICTOR9K_KBDATA_HANDLER(_devcb) \
- devcb = &downcast<victor_9000_keyboard_device &>(*device).set_kbdata_cb(DEVCB_##_devcb);
+ downcast<victor_9000_keyboard_device &>(*device).set_kbdata_cb(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/mame/machine/vs9209.h b/src/mame/machine/vs9209.h
index 161799419cc..6acebb5022c 100644
--- a/src/mame/machine/vs9209.h
+++ b/src/mame/machine/vs9209.h
@@ -12,46 +12,6 @@
#pragma once
//**************************************************************************
-// CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_VS9209_IN_PORTA_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_input_cb(0, DEVCB_##_devcb);
-#define MCFG_VS9209_IN_PORTB_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_input_cb(1, DEVCB_##_devcb);
-#define MCFG_VS9209_IN_PORTC_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_input_cb(2, DEVCB_##_devcb);
-#define MCFG_VS9209_IN_PORTD_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_input_cb(3, DEVCB_##_devcb);
-#define MCFG_VS9209_IN_PORTE_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_input_cb(4, DEVCB_##_devcb);
-#define MCFG_VS9209_IN_PORTF_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_input_cb(5, DEVCB_##_devcb);
-#define MCFG_VS9209_IN_PORTG_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_input_cb(6, DEVCB_##_devcb);
-#define MCFG_VS9209_IN_PORTH_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_input_cb(7, DEVCB_##_devcb);
-
-#ifdef VS9209_PROBABLY_NONEXISTENT_OUTPUTS
-#define MCFG_VS9209_OUT_PORTA_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_output_cb(0, DEVCB_##_devcb);
-#define MCFG_VS9209_OUT_PORTB_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_output_cb(1, DEVCB_##_devcb);
-#define MCFG_VS9209_OUT_PORTC_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_output_cb(2, DEVCB_##_devcb);
-#define MCFG_VS9209_OUT_PORTD_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_output_cb(3, DEVCB_##_devcb);
-#endif
-#define MCFG_VS9209_OUT_PORTE_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_output_cb(4, DEVCB_##_devcb);
-#define MCFG_VS9209_OUT_PORTF_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_output_cb(5, DEVCB_##_devcb);
-#define MCFG_VS9209_OUT_PORTG_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_output_cb(6, DEVCB_##_devcb);
-#define MCFG_VS9209_OUT_PORTH_CB(_devcb) \
- devcb = &downcast<vs9209_device &>(*device).set_output_cb(7, DEVCB_##_devcb);
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -64,16 +24,24 @@ public:
vs9209_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// configuration
- template<class Object> devcb_base &set_input_cb(int p, Object &&obj)
- {
- assert(p >= 0 && p < 8);
- return m_input_cb[p].set_callback(std::forward<Object>(obj));
- }
- template<class Object> devcb_base &set_output_cb(int p, Object &&obj)
- {
- assert(p >= 0 && p < 8);
- return m_output_cb[p].set_callback(std::forward<Object>(obj));
- }
+ auto porta_input_cb() { return m_input_cb[0].bind(); }
+ auto portb_input_cb() { return m_input_cb[1].bind(); }
+ auto portc_input_cb() { return m_input_cb[2].bind(); }
+ auto portd_input_cb() { return m_input_cb[3].bind(); }
+ auto porte_input_cb() { return m_input_cb[4].bind(); }
+ auto portf_input_cb() { return m_input_cb[5].bind(); }
+ auto portg_input_cb() { return m_input_cb[6].bind(); }
+ auto porth_input_cb() { return m_input_cb[7].bind(); }
+#ifdef VS9209_PROBABLY_NONEXISTENT_OUTPUTS
+ auto porta_output_cb() { return m_output_cb[0].bind(); }
+ auto portb_output_cb() { return m_output_cb[1].bind(); }
+ auto portc_output_cb() { return m_output_cb[2].bind(); }
+ auto portd_output_cb() { return m_output_cb[3].bind(); }
+#endif // VS9209_PROBABLY_NONEXISTENT_OUTPUTS
+ auto porte_output_cb() { return m_output_cb[4].bind(); }
+ auto portf_output_cb() { return m_output_cb[5].bind(); }
+ auto portg_output_cb() { return m_output_cb[6].bind(); }
+ auto porth_output_cb() { return m_output_cb[7].bind(); }
// memory handlers
DECLARE_READ8_MEMBER(read);
diff --git a/src/mame/machine/vt100_kbd.h b/src/mame/machine/vt100_kbd.h
index 9b1499fd918..0c2a6c24d76 100644
--- a/src/mame/machine/vt100_kbd.h
+++ b/src/mame/machine/vt100_kbd.h
@@ -22,7 +22,7 @@
//**************************************************************************
#define MCFG_VT100_KEYBOARD_SIGNAL_OUT_CALLBACK(_devcb) \
- devcb = &downcast<vt100_keyboard_device &>(*device).set_signal_out_callback(DEVCB_##_devcb);
+ downcast<vt100_keyboard_device &>(*device).set_signal_out_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/mame/machine/wangpckb.h b/src/mame/machine/wangpckb.h
index c5b3d59a92f..320f0f57d01 100644
--- a/src/mame/machine/wangpckb.h
+++ b/src/mame/machine/wangpckb.h
@@ -34,7 +34,7 @@
MCFG_DEVICE_ADD(WANGPC_KEYBOARD_TAG, WANGPC_KEYBOARD, 0)
#define MCFG_WANGPCKB_TXD_HANDLER(_devcb) \
- devcb = &downcast<wangpc_keyboard_device &>(*device).set_txd_handler(DEVCB_##_devcb);
+ downcast<wangpc_keyboard_device &>(*device).set_txd_handler(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/mame/machine/x820kb.h b/src/mame/machine/x820kb.h
index 1a17b8d3123..e3000fe415a 100644
--- a/src/mame/machine/x820kb.h
+++ b/src/mame/machine/x820kb.h
@@ -20,7 +20,7 @@
//**************************************************************************
#define MCFG_XEROX_820_KEYBOARD_KBSTB_CALLBACK(_devcb) \
- devcb = &downcast<xerox_820_keyboard_device &>(*device).set_kbstb_wr_callback(DEVCB_##_devcb);
+ downcast<xerox_820_keyboard_device &>(*device).set_kbstb_wr_callback(DEVCB_##_devcb);
diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp
index a85a0c2bfb6..2e2bc7bdaa2 100644
--- a/src/mame/machine/xbox.cpp
+++ b/src/mame/machine/xbox.cpp
@@ -893,12 +893,12 @@ MACHINE_CONFIG_START(xbox_base_state::xbox_base)
MCFG_DEVICE_ADD("pic8259_1", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE(*this, xbox_base_state, xbox_pic8259_1_set_int_line))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, xbox_base_state, get_slave_ack))
MCFG_DEVICE_ADD("pic8259_2", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("pic8259_1", pic8259_device, ir2_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("pit8254", PIT8254, 0)
MCFG_PIT8253_CLK0(1125000) /* heartbeat IRQ */
diff --git a/src/mame/machine/znmcu.h b/src/mame/machine/znmcu.h
index 8603bac7eb8..5b8e3a88d94 100644
--- a/src/mame/machine/znmcu.h
+++ b/src/mame/machine/znmcu.h
@@ -9,19 +9,19 @@
DECLARE_DEVICE_TYPE(ZNMCU, znmcu_device)
#define MCFG_ZNMCU_DATAOUT_HANDLER(_devcb) \
- devcb = &downcast<znmcu_device &>(*device).set_dataout_handler(DEVCB_##_devcb);
+ downcast<znmcu_device &>(*device).set_dataout_handler(DEVCB_##_devcb);
#define MCFG_ZNMCU_DSR_HANDLER(_devcb) \
- devcb = &downcast<znmcu_device &>(*device).set_dsr_handler(DEVCB_##_devcb);
+ downcast<znmcu_device &>(*device).set_dsr_handler(DEVCB_##_devcb);
#define MCFG_ZNMCU_DSW_HANDLER(_devcb) \
- devcb = &downcast<znmcu_device &>(*device).set_dsw_handler(DEVCB_##_devcb);
+ downcast<znmcu_device &>(*device).set_dsw_handler(DEVCB_##_devcb);
#define MCFG_ZNMCU_ANALOG1_HANDLER(_devcb) \
- devcb = &downcast<znmcu_device &>(*device).set_analog1_handler(DEVCB_##_devcb);
+ downcast<znmcu_device &>(*device).set_analog1_handler(DEVCB_##_devcb);
#define MCFG_ZNMCU_ANALOG2_HANDLER(_devcb) \
- devcb = &downcast<znmcu_device &>(*device).set_analog2_handler(DEVCB_##_devcb);
+ downcast<znmcu_device &>(*device).set_analog2_handler(DEVCB_##_devcb);
class znmcu_device : public device_t
{
diff --git a/src/mame/machine/zx8302.h b/src/mame/machine/zx8302.h
index f49bfddd72e..150a697c624 100644
--- a/src/mame/machine/zx8302.h
+++ b/src/mame/machine/zx8302.h
@@ -45,46 +45,46 @@
downcast<zx8302_device &>(*device).set_rtc_clock(_clk);
#define MCFG_ZX8302_OUT_IPL1L_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_ipl1l_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_ipl1l_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_OUT_BAUDX4_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_baudx4_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_baudx4_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_OUT_COMDATA_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_comdata_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_comdata_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_OUT_TXD1_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_txd1_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_txd1_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_OUT_TXD2_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_txd2_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_txd2_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_OUT_NETOUT_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_netout_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_netout_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_OUT_MDSELCK_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_mdselck_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_mdselck_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_OUT_MDSELD_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_mdseld_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_mdseld_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_OUT_MDRDW_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_mdrdw_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_mdrdw_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_OUT_ERASE_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_erase_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_erase_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_OUT_RAW1_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_raw1_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_raw1_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_IN_RAW1_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_in_raw1_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_in_raw1_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_OUT_RAW2_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_out_raw2_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_out_raw2_callback(DEVCB_##_devcb);
#define MCFG_ZX8302_IN_RAW2_CB(_devcb) \
- devcb = &downcast<zx8302_device &>(*device).set_in_raw2_callback(DEVCB_##_devcb);
+ downcast<zx8302_device &>(*device).set_in_raw2_callback(DEVCB_##_devcb);
///*************************************************************************