summaryrefslogtreecommitdiffstats
path: root/src/devices/machine
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine')
-rw-r--r--src/devices/machine/1mb5.h8
-rw-r--r--src/devices/machine/40105.h6
-rw-r--r--src/devices/machine/53c7xx.h6
-rw-r--r--src/devices/machine/64h156.h6
-rw-r--r--src/devices/machine/6522via.cpp4
-rw-r--r--src/devices/machine/6522via.h60
-rw-r--r--src/devices/machine/6525tpi.h18
-rw-r--r--src/devices/machine/6532riot.h10
-rw-r--r--src/devices/machine/68153bim.h14
-rw-r--r--src/devices/machine/6821pia.h33
-rw-r--r--src/devices/machine/68230pit.h24
-rw-r--r--src/devices/machine/68307.h8
-rw-r--r--src/devices/machine/68340.h20
-rw-r--r--src/devices/machine/6840ptm.h12
-rw-r--r--src/devices/machine/6850acia.h9
-rw-r--r--src/devices/machine/68561mpcc.h12
-rw-r--r--src/devices/machine/7200fifo.h6
-rw-r--r--src/devices/machine/7400.h8
-rw-r--r--src/devices/machine/7404.h12
-rw-r--r--src/devices/machine/74123.h2
-rw-r--r--src/devices/machine/74145.h20
-rw-r--r--src/devices/machine/74153.h4
-rw-r--r--src/devices/machine/74157.h11
-rw-r--r--src/devices/machine/74161.h12
-rw-r--r--src/devices/machine/74165.h4
-rw-r--r--src/devices/machine/74166.h4
-rw-r--r--src/devices/machine/74175.h28
-rw-r--r--src/devices/machine/74259.h20
-rw-r--r--src/devices/machine/7474.h6
-rw-r--r--src/devices/machine/8042kbdc.h10
-rw-r--r--src/devices/machine/82s129.h20
-rw-r--r--src/devices/machine/8364_paula.h4
-rw-r--r--src/devices/machine/8530scc.h2
-rw-r--r--src/devices/machine/aakart.h4
-rw-r--r--src/devices/machine/adc0808.h20
-rw-r--r--src/devices/machine/adc0844.h18
-rw-r--r--src/devices/machine/akiko.h12
-rw-r--r--src/devices/machine/am53cf96.h2
-rw-r--r--src/devices/machine/am9513.h18
-rw-r--r--src/devices/machine/am9517a.h39
-rw-r--r--src/devices/machine/am9519.h2
-rw-r--r--src/devices/machine/amigafdc.h10
-rw-r--r--src/devices/machine/at45dbxx.h2
-rw-r--r--src/devices/machine/at_keybc.h12
-rw-r--r--src/devices/machine/ataintf.h6
-rw-r--r--src/devices/machine/atmel_arm_aic.h2
-rw-r--r--src/devices/machine/ay31015.h40
-rw-r--r--src/devices/machine/busmouse.h2
-rw-r--r--src/devices/machine/cdp1852.h8
-rw-r--r--src/devices/machine/cdp1871.h26
-rw-r--r--src/devices/machine/cdp1879.h2
-rw-r--r--src/devices/machine/clock.h7
-rw-r--r--src/devices/machine/com8116.h9
-rw-r--r--src/devices/machine/cr511b.h18
-rw-r--r--src/devices/machine/cs4031.cpp4
-rw-r--r--src/devices/machine/cs4031.h18
-rw-r--r--src/devices/machine/cxd1095.h20
-rw-r--r--src/devices/machine/dmac.h14
-rw-r--r--src/devices/machine/dp8390.h16
-rw-r--r--src/devices/machine/ds1315.h2
-rw-r--r--src/devices/machine/ds1386.h6
-rw-r--r--src/devices/machine/ds75161a.h32
-rw-r--r--src/devices/machine/e05a03.h10
-rw-r--r--src/devices/machine/e05a30.h18
-rw-r--r--src/devices/machine/eepromser.h3
-rw-r--r--src/devices/machine/fdc37c93x.h10
-rw-r--r--src/devices/machine/fga002.h10
-rw-r--r--src/devices/machine/gayle.h10
-rw-r--r--src/devices/machine/gen_fifo.h4
-rw-r--r--src/devices/machine/gen_latch.h3
-rw-r--r--src/devices/machine/hd63450.h20
-rw-r--r--src/devices/machine/hd64610.h4
-rw-r--r--src/devices/machine/hdc92x4.h12
-rw-r--r--src/devices/machine/hp_taco.h6
-rw-r--r--src/devices/machine/i7220.h4
-rw-r--r--src/devices/machine/i80130.h12
-rw-r--r--src/devices/machine/i8087.h4
-rw-r--r--src/devices/machine/i8155.h21
-rw-r--r--src/devices/machine/i8212.h8
-rw-r--r--src/devices/machine/i8214.h6
-rw-r--r--src/devices/machine/i82371sb.cpp4
-rw-r--r--src/devices/machine/i82371sb.h8
-rw-r--r--src/devices/machine/i8243.h4
-rw-r--r--src/devices/machine/i8251.h21
-rw-r--r--src/devices/machine/i8255.h24
-rw-r--r--src/devices/machine/i8257.h32
-rw-r--r--src/devices/machine/i82586.h2
-rw-r--r--src/devices/machine/i8271.h8
-rw-r--r--src/devices/machine/i8279.h14
-rw-r--r--src/devices/machine/i8355.h8
-rw-r--r--src/devices/machine/ie15_kbd.h2
-rw-r--r--src/devices/machine/im6402.h8
-rw-r--r--src/devices/machine/input_merger.h3
-rw-r--r--src/devices/machine/ins8154.h10
-rw-r--r--src/devices/machine/ins8250.h21
-rw-r--r--src/devices/machine/k053252.h10
-rw-r--r--src/devices/machine/kb3600.h26
-rw-r--r--src/devices/machine/kr2376.h22
-rw-r--r--src/devices/machine/latch8.h32
-rw-r--r--src/devices/machine/ldv1000.h2
-rw-r--r--src/devices/machine/lh5810.h12
-rw-r--r--src/devices/machine/mb8421.h4
-rw-r--r--src/devices/machine/mb87078.h2
-rw-r--r--src/devices/machine/mb8795.h8
-rw-r--r--src/devices/machine/mb89352.h4
-rw-r--r--src/devices/machine/mb89363b.h24
-rw-r--r--src/devices/machine/mb89374.h10
-rw-r--r--src/devices/machine/mc14411.h48
-rw-r--r--src/devices/machine/mc146818.h4
-rw-r--r--src/devices/machine/mc2661.h16
-rw-r--r--src/devices/machine/mc68328.h48
-rw-r--r--src/devices/machine/mc6843.h2
-rw-r--r--src/devices/machine/mc6846.h12
-rw-r--r--src/devices/machine/mc6852.h8
-rw-r--r--src/devices/machine/mc6854.h8
-rw-r--r--src/devices/machine/mc68681.h19
-rw-r--r--src/devices/machine/mc68901.h18
-rw-r--r--src/devices/machine/mccs1850.h6
-rw-r--r--src/devices/machine/microtch.h2
-rw-r--r--src/devices/machine/mm5740.h24
-rw-r--r--src/devices/machine/mm58167.h2
-rw-r--r--src/devices/machine/mm74c922.h12
-rw-r--r--src/devices/machine/mos6526.h24
-rw-r--r--src/devices/machine/mos6529.h16
-rw-r--r--src/devices/machine/mos6530.h8
-rw-r--r--src/devices/machine/mos6530n.h83
-rw-r--r--src/devices/machine/mos6551.h15
-rw-r--r--src/devices/machine/mos8722.h10
-rw-r--r--src/devices/machine/mpu401.h2
-rw-r--r--src/devices/machine/msm58321.h10
-rw-r--r--src/devices/machine/msm6242.h3
-rw-r--r--src/devices/machine/msm6253.h18
-rw-r--r--src/devices/machine/ncr5380.h2
-rw-r--r--src/devices/machine/ncr5380n.h4
-rw-r--r--src/devices/machine/ncr5385.h2
-rw-r--r--src/devices/machine/ncr5390.h4
-rw-r--r--src/devices/machine/ncr539x.h4
-rw-r--r--src/devices/machine/nsc810.h16
-rw-r--r--src/devices/machine/nscsi_cb.h12
-rw-r--r--src/devices/machine/output_latch.h17
-rw-r--r--src/devices/machine/pc_fdc.h4
-rw-r--r--src/devices/machine/pc_lpt.h2
-rw-r--r--src/devices/machine/pci-ide.h3
-rw-r--r--src/devices/machine/pci9050.h4
-rw-r--r--src/devices/machine/pckeybrd.h6
-rw-r--r--src/devices/machine/pdc.h4
-rw-r--r--src/devices/machine/phi.h30
-rw-r--r--src/devices/machine/pic8259.h9
-rw-r--r--src/devices/machine/pit8253.h7
-rw-r--r--src/devices/machine/pxa255.h6
-rw-r--r--src/devices/machine/ripple_counter.h6
-rw-r--r--src/devices/machine/rp5c01.h2
-rw-r--r--src/devices/machine/rp5c15.h4
-rw-r--r--src/devices/machine/rstbuf.h2
-rw-r--r--src/devices/machine/rtc4543.h2
-rw-r--r--src/devices/machine/rtc65271.h2
-rw-r--r--src/devices/machine/s2636.h2
-rw-r--r--src/devices/machine/s3c2400.h18
-rw-r--r--src/devices/machine/s3c2410.h26
-rw-r--r--src/devices/machine/s3c2440.h26
-rw-r--r--src/devices/machine/s3c44b0.h14
-rw-r--r--src/devices/machine/saa1043.h36
-rw-r--r--src/devices/machine/scnxx562.h26
-rw-r--r--src/devices/machine/sis85c496.cpp4
-rw-r--r--src/devices/machine/smartmed.h2
-rw-r--r--src/devices/machine/smc91c9x.h4
-rw-r--r--src/devices/machine/smpc.h24
-rw-r--r--src/devices/machine/steppers.h2
-rw-r--r--src/devices/machine/te7750.h57
-rw-r--r--src/devices/machine/timekpr.h4
-rw-r--r--src/devices/machine/tmp68301.h4
-rw-r--r--src/devices/machine/tms1024.h19
-rw-r--r--src/devices/machine/tms5501.h8
-rw-r--r--src/devices/machine/tms9901.h36
-rw-r--r--src/devices/machine/tms9902.h8
-rw-r--r--src/devices/machine/tube.h12
-rw-r--r--src/devices/machine/upd71071.h28
-rw-r--r--src/devices/machine/upd765.h15
-rw-r--r--src/devices/machine/vrc4373.h2
-rw-r--r--src/devices/machine/wd11c00_17.h33
-rw-r--r--src/devices/machine/wd2010.h45
-rw-r--r--src/devices/machine/wd33c93.h2
-rw-r--r--src/devices/machine/wd7600.cpp4
-rw-r--r--src/devices/machine/wd7600.h18
-rw-r--r--src/devices/machine/wd_fdc.h15
-rw-r--r--src/devices/machine/ym2148.h8
-rw-r--r--src/devices/machine/ym3802.h4
-rw-r--r--src/devices/machine/z80ctc.h12
-rw-r--r--src/devices/machine/z80daisy_generic.h2
-rw-r--r--src/devices/machine/z80dart.h45
-rw-r--r--src/devices/machine/z80dma.h14
-rw-r--r--src/devices/machine/z80pio.h22
-rw-r--r--src/devices/machine/z80scc.h30
-rw-r--r--src/devices/machine/z80sio.cpp27
-rw-r--r--src/devices/machine/z80sio.h51
-rw-r--r--src/devices/machine/z80sti.h16
-rw-r--r--src/devices/machine/z8536.h14
197 files changed, 1433 insertions, 1162 deletions
diff --git a/src/devices/machine/1mb5.h b/src/devices/machine/1mb5.h
index 9c7c76eab3e..09c05d2fd8c 100644
--- a/src/devices/machine/1mb5.h
+++ b/src/devices/machine/1mb5.h
@@ -14,16 +14,16 @@
#pragma once
#define MCFG_1MB5_IRL_HANDLER(_devcb) \
- devcb = &downcast<hp_1mb5_device &>(*device).set_irl_handler(DEVCB_##_devcb);
+ downcast<hp_1mb5_device &>(*device).set_irl_handler(DEVCB_##_devcb);
#define MCFG_1MB5_HALT_HANDLER(_devcb) \
- devcb = &downcast<hp_1mb5_device &>(*device).set_halt_handler(DEVCB_##_devcb);
+ downcast<hp_1mb5_device &>(*device).set_halt_handler(DEVCB_##_devcb);
#define MCFG_1MB5_RESET_HANDLER(_devcb) \
- devcb = &downcast<hp_1mb5_device &>(*device).set_reset_handler(DEVCB_##_devcb);
+ downcast<hp_1mb5_device &>(*device).set_reset_handler(DEVCB_##_devcb);
#define MCFG_1MB5_INT_HANDLER(_devcb) \
- devcb = &downcast<hp_1mb5_device &>(*device).set_int_handler(DEVCB_##_devcb);
+ downcast<hp_1mb5_device &>(*device).set_int_handler(DEVCB_##_devcb);
class hp_1mb5_device : public device_t
{
diff --git a/src/devices/machine/40105.h b/src/devices/machine/40105.h
index 7b8b82819e0..77b58bbaf08 100644
--- a/src/devices/machine/40105.h
+++ b/src/devices/machine/40105.h
@@ -31,13 +31,13 @@
///*************************************************************************
#define MCFG_40105_DATA_IN_READY_CB(_dir) \
- devcb = &downcast<cmos_40105_device *>(device)->set_dir_callback(DEVCB_##_dir);
+ downcast<cmos_40105_device *>(device)->set_dir_callback(DEVCB_##_dir);
#define MCFG_40105_DATA_OUT_READY_CB(_dor) \
- devcb = &downcast<cmos_40105_device *>(device)->set_dor_callback(DEVCB_##_dor);
+ downcast<cmos_40105_device *>(device)->set_dor_callback(DEVCB_##_dor);
#define MCFG_40105_DATA_OUT_CB(_out) \
- devcb = &downcast<cmos_40105_device *>(device)->set_data_out_callback(DEVCB_##_out);
+ downcast<cmos_40105_device *>(device)->set_data_out_callback(DEVCB_##_out);
diff --git a/src/devices/machine/53c7xx.h b/src/devices/machine/53c7xx.h
index f2af9e616f8..8887a78a5ef 100644
--- a/src/devices/machine/53c7xx.h
+++ b/src/devices/machine/53c7xx.h
@@ -17,13 +17,13 @@
#define MCFG_NCR53C7XX_IRQ_HANDLER(_devcb) \
- devcb = &downcast<ncr53c7xx_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<ncr53c7xx_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_NCR53C7XX_HOST_WRITE(_devcb) \
- devcb = &downcast<ncr53c7xx_device &>(*device).set_host_write(DEVCB_##_devcb);
+ downcast<ncr53c7xx_device &>(*device).set_host_write(DEVCB_##_devcb);
#define MCFG_NCR53C7XX_HOST_READ(_devcb) \
- devcb = &downcast<ncr53c7xx_device &>(*device).set_host_read(DEVCB_##_devcb);
+ downcast<ncr53c7xx_device &>(*device).set_host_read(DEVCB_##_devcb);
class ncr53c7xx_device : public nscsi_device, public device_execute_interface
{
diff --git a/src/devices/machine/64h156.h b/src/devices/machine/64h156.h
index 62e1ccabff9..24244e64517 100644
--- a/src/devices/machine/64h156.h
+++ b/src/devices/machine/64h156.h
@@ -71,13 +71,13 @@
//**************************************************************************
#define MCFG_64H156_ATN_CALLBACK(_write) \
- devcb = &downcast<c64h156_device &>(*device).set_atn_wr_callback(DEVCB_##_write);
+ downcast<c64h156_device &>(*device).set_atn_wr_callback(DEVCB_##_write);
#define MCFG_64H156_SYNC_CALLBACK(_write) \
- devcb = &downcast<c64h156_device &>(*device).set_sync_wr_callback(DEVCB_##_write);
+ downcast<c64h156_device &>(*device).set_sync_wr_callback(DEVCB_##_write);
#define MCFG_64H156_BYTE_CALLBACK(_write) \
- devcb = &downcast<c64h156_device &>(*device).set_byte_wr_callback(DEVCB_##_write);
+ downcast<c64h156_device &>(*device).set_byte_wr_callback(DEVCB_##_write);
diff --git a/src/devices/machine/6522via.cpp b/src/devices/machine/6522via.cpp
index 9c6b2936c8c..cd6588374c5 100644
--- a/src/devices/machine/6522via.cpp
+++ b/src/devices/machine/6522via.cpp
@@ -954,7 +954,7 @@ WRITE8_MEMBER( via6522_device::write )
}
}
-void via6522_device::write_pa(int line, int state)
+void via6522_device::set_pa_line(int line, int state)
{
if (state)
m_in_a |= (1 << line);
@@ -1020,7 +1020,7 @@ WRITE_LINE_MEMBER( via6522_device::write_ca2 )
}
}
-void via6522_device::write_pb(int line, int state)
+void via6522_device::set_pb_line(int line, int state)
{
if (state)
m_in_b |= (1 << line);
diff --git a/src/devices/machine/6522via.h b/src/devices/machine/6522via.h
index facb67b34a3..5b3823b2b5c 100644
--- a/src/devices/machine/6522via.h
+++ b/src/devices/machine/6522via.h
@@ -24,29 +24,29 @@
// TODO: REMOVE THESE
#define MCFG_VIA6522_READPA_HANDLER(_devcb) \
- devcb = &downcast<via6522_device &>(*device).set_readpa_handler(DEVCB_##_devcb);
+ downcast<via6522_device &>(*device).set_readpa_handler(DEVCB_##_devcb);
#define MCFG_VIA6522_READPB_HANDLER(_devcb) \
- devcb = &downcast<via6522_device &>(*device).set_readpb_handler(DEVCB_##_devcb);
+ downcast<via6522_device &>(*device).set_readpb_handler(DEVCB_##_devcb);
// TODO: CONVERT THESE TO WRITE LINE
#define MCFG_VIA6522_WRITEPA_HANDLER(_devcb) \
- devcb = &downcast<via6522_device &>(*device).set_writepa_handler(DEVCB_##_devcb);
+ downcast<via6522_device &>(*device).set_writepa_handler(DEVCB_##_devcb);
#define MCFG_VIA6522_WRITEPB_HANDLER(_devcb) \
- devcb = &downcast<via6522_device &>(*device).set_writepb_handler(DEVCB_##_devcb);
+ downcast<via6522_device &>(*device).set_writepb_handler(DEVCB_##_devcb);
#define MCFG_VIA6522_CA2_HANDLER(_devcb) \
- devcb = &downcast<via6522_device &>(*device).set_ca2_handler(DEVCB_##_devcb);
+ downcast<via6522_device &>(*device).set_ca2_handler(DEVCB_##_devcb);
#define MCFG_VIA6522_CB1_HANDLER(_devcb) \
- devcb = &downcast<via6522_device &>(*device).set_cb1_handler(DEVCB_##_devcb);
+ downcast<via6522_device &>(*device).set_cb1_handler(DEVCB_##_devcb);
#define MCFG_VIA6522_CB2_HANDLER(_devcb) \
- devcb = &downcast<via6522_device &>(*device).set_cb2_handler(DEVCB_##_devcb);
+ downcast<via6522_device &>(*device).set_cb2_handler(DEVCB_##_devcb);
#define MCFG_VIA6522_IRQ_HANDLER(_devcb) \
- devcb = &downcast<via6522_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<via6522_device &>(*device).set_irq_handler(DEVCB_##_devcb);
/***************************************************************************
@@ -85,41 +85,49 @@ public:
// TODO: REMOVE THESE
template <class Object> devcb_base &set_readpa_handler(Object &&cb) { return m_in_a_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_readpb_handler(Object &&cb) { return m_in_b_handler.set_callback(std::forward<Object>(cb)); }
+ auto readpa_handler() { return m_in_a_handler.bind(); }
+ auto readpb_handler() { return m_in_b_handler.bind(); }
// TODO: CONVERT THESE TO WRITE LINE
template <class Object> devcb_base &set_writepa_handler(Object &&cb) { return m_out_a_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_writepb_handler(Object &&cb) { return m_out_b_handler.set_callback(std::forward<Object>(cb)); }
+ auto writepa_handler() { return m_out_a_handler.bind(); }
+ auto writepb_handler() { return m_out_b_handler.bind(); }
template <class Object> devcb_base &set_ca2_handler(Object &&cb) { return m_ca2_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_cb1_handler(Object &&cb) { return m_cb1_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_cb2_handler(Object &&cb) { return m_cb2_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ auto ca2_handler() { return m_ca2_handler.bind(); }
+ auto cb1_handler() { return m_cb1_handler.bind(); }
+ auto cb2_handler() { return m_cb2_handler.bind(); }
+ auto irq_handler() { return m_irq_handler.bind(); }
virtual void map(address_map &map);
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
- DECLARE_WRITE_LINE_MEMBER( write_pa0 ) { write_pa(0, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pa1 ) { write_pa(1, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pa2 ) { write_pa(2, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pa3 ) { write_pa(3, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pa4 ) { write_pa(4, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pa5 ) { write_pa(5, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pa6 ) { write_pa(6, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pa7 ) { write_pa(7, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pa0 ) { set_pa_line(0, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pa1 ) { set_pa_line(1, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pa2 ) { set_pa_line(2, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pa3 ) { set_pa_line(3, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pa4 ) { set_pa_line(4, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pa5 ) { set_pa_line(5, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pa6 ) { set_pa_line(6, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pa7 ) { set_pa_line(7, state); }
DECLARE_WRITE8_MEMBER( write_pa );
DECLARE_WRITE_LINE_MEMBER( write_ca1 );
DECLARE_WRITE_LINE_MEMBER( write_ca2 );
- DECLARE_WRITE_LINE_MEMBER( write_pb0 ) { write_pb(0, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pb1 ) { write_pb(1, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pb2 ) { write_pb(2, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pb3 ) { write_pb(3, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pb4 ) { write_pb(4, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pb5 ) { write_pb(5, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pb6 ) { write_pb(6, state); }
- DECLARE_WRITE_LINE_MEMBER( write_pb7 ) { write_pb(7, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pb0 ) { set_pb_line(0, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pb1 ) { set_pb_line(1, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pb2 ) { set_pb_line(2, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pb3 ) { set_pb_line(3, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pb4 ) { set_pb_line(4, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pb5 ) { set_pb_line(5, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pb6 ) { set_pb_line(6, state); }
+ DECLARE_WRITE_LINE_MEMBER( write_pb7 ) { set_pb_line(7, state); }
DECLARE_WRITE8_MEMBER( write_pb );
DECLARE_WRITE_LINE_MEMBER( write_cb1 );
DECLARE_WRITE_LINE_MEMBER( write_cb2 );
@@ -143,8 +151,8 @@ private:
void clear_int(int data);
void shift_out();
void shift_in();
- void write_pa(int line, int state);
- void write_pb(int line, int state);
+ void set_pa_line(int line, int state);
+ void set_pb_line(int line, int state);
uint8_t input_pa();
void output_pa();
diff --git a/src/devices/machine/6525tpi.h b/src/devices/machine/6525tpi.h
index a844de2ac0f..a17b0ebb01c 100644
--- a/src/devices/machine/6525tpi.h
+++ b/src/devices/machine/6525tpi.h
@@ -125,31 +125,31 @@ DECLARE_DEVICE_TYPE(TPI6525, tpi6525_device)
#define MCFG_TPI6525_OUT_IRQ_CB(_devcb) \
- devcb = &downcast<tpi6525_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
+ downcast<tpi6525_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_TPI6525_IN_PA_CB(_devcb) \
- devcb = &downcast<tpi6525_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
+ downcast<tpi6525_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
#define MCFG_TPI6525_OUT_PA_CB(_devcb) \
- devcb = &downcast<tpi6525_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
+ downcast<tpi6525_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
#define MCFG_TPI6525_IN_PB_CB(_devcb) \
- devcb = &downcast<tpi6525_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
+ downcast<tpi6525_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
#define MCFG_TPI6525_OUT_PB_CB(_devcb) \
- devcb = &downcast<tpi6525_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
+ downcast<tpi6525_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
#define MCFG_TPI6525_IN_PC_CB(_devcb) \
- devcb = &downcast<tpi6525_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
+ downcast<tpi6525_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
#define MCFG_TPI6525_OUT_PC_CB(_devcb) \
- devcb = &downcast<tpi6525_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
+ downcast<tpi6525_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
#define MCFG_TPI6525_OUT_CA_CB(_devcb) \
- devcb = &downcast<tpi6525_device &>(*device).set_out_ca_callback(DEVCB_##_devcb);
+ downcast<tpi6525_device &>(*device).set_out_ca_callback(DEVCB_##_devcb);
#define MCFG_TPI6525_OUT_CB_CB(_devcb) \
- devcb = &downcast<tpi6525_device &>(*device).set_out_cb_callback(DEVCB_##_devcb);
+ downcast<tpi6525_device &>(*device).set_out_cb_callback(DEVCB_##_devcb);
#endif // MAME_MACHINE_6525TPI_H
diff --git a/src/devices/machine/6532riot.h b/src/devices/machine/6532riot.h
index f51aa8766f5..25dbbcb1acc 100644
--- a/src/devices/machine/6532riot.h
+++ b/src/devices/machine/6532riot.h
@@ -18,19 +18,19 @@
//**************************************************************************
#define MCFG_RIOT6532_IN_PA_CB(_devcb) \
- devcb = &downcast<riot6532_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
+ downcast<riot6532_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
#define MCFG_RIOT6532_OUT_PA_CB(_devcb) \
- devcb = &downcast<riot6532_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
+ downcast<riot6532_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
#define MCFG_RIOT6532_IN_PB_CB(_devcb) \
- devcb = &downcast<riot6532_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
+ downcast<riot6532_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
#define MCFG_RIOT6532_OUT_PB_CB(_devcb) \
- devcb = &downcast<riot6532_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
+ downcast<riot6532_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
#define MCFG_RIOT6532_IRQ_CB(_devcb) \
- devcb = &downcast<riot6532_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<riot6532_device &>(*device).set_irq_callback(DEVCB_##_devcb);
/***************************************************************************
diff --git a/src/devices/machine/68153bim.h b/src/devices/machine/68153bim.h
index 0a81715ca18..a0e223b6b2e 100644
--- a/src/devices/machine/68153bim.h
+++ b/src/devices/machine/68153bim.h
@@ -46,25 +46,25 @@
MCFG_DEVICE_ADD(_tag, EI68C153, _clock)
#define MCFG_BIM68153_OUT_INT_CB(_devcb) \
- devcb = &downcast<bim68153_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<bim68153_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
// These callback sets INTAL0 and INTAL1 but is probably not needed as the
// shorthand OUT_IACK0..OUT_IACK3 below embedd the channel information
#define MCFG_BIM68153_OUT_INTAL0_CB(_devcb) \
- devcb = &downcast<bim68153_device &>(*device).set_out_intal0_callback(DEVCB_##_devcb);
+ downcast<bim68153_device &>(*device).set_out_intal0_callback(DEVCB_##_devcb);
#define MCFG_BIM68153_OUT_INTAL1_CB(_devcb) \
- devcb = &downcast<bim68153_device &>(*device).set_out_intal1_callback(DEVCB_##_devcb);
+ downcast<bim68153_device &>(*device).set_out_intal1_callback(DEVCB_##_devcb);
// LOCAL IACK callbacks emulating the INTAL0 and INTAL1 outputs for INTAE requesting a vector from a sub device
#define MCFG_BIM68153_OUT_IACK0_CB(_devcb) \
- devcb = &downcast<bim68153_device &>(*device).set_out_iack0_callback(DEVCB_##_devcb);
+ downcast<bim68153_device &>(*device).set_out_iack0_callback(DEVCB_##_devcb);
#define MCFG_BIM68153_OUT_IACK1_CB(_devcb) \
- devcb = &downcast<bim68153_device &>(*device).set_out_iack1_callback(DEVCB_##_devcb);
+ downcast<bim68153_device &>(*device).set_out_iack1_callback(DEVCB_##_devcb);
#define MCFG_BIM68153_OUT_IACK2_CB(_devcb) \
- devcb = &downcast<bim68153_device &>(*device).set_out_iack2_callback(DEVCB_##_devcb);
+ downcast<bim68153_device &>(*device).set_out_iack2_callback(DEVCB_##_devcb);
#define MCFG_BIM68153_OUT_IACK3_CB(_devcb) \
- devcb = &downcast<bim68153_device &>(*device).set_out_iack3_callback(DEVCB_##_devcb);
+ downcast<bim68153_device &>(*device).set_out_iack3_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/6821pia.h b/src/devices/machine/6821pia.h
index 236aae0f301..76fd7f96e2b 100644
--- a/src/devices/machine/6821pia.h
+++ b/src/devices/machine/6821pia.h
@@ -33,38 +33,38 @@
// TODO: REMOVE THESE
#define MCFG_PIA_READPA_HANDLER(_devcb) \
- devcb = &downcast<pia6821_device &>(*device).set_readpa_handler(DEVCB_##_devcb);
+ downcast<pia6821_device &>(*device).set_readpa_handler(DEVCB_##_devcb);
#define MCFG_PIA_READPB_HANDLER(_devcb) \
- devcb = &downcast<pia6821_device &>(*device).set_readpb_handler(DEVCB_##_devcb);
+ downcast<pia6821_device &>(*device).set_readpb_handler(DEVCB_##_devcb);
#define MCFG_PIA_READCA1_HANDLER(_devcb) \
- devcb = &downcast<pia6821_device &>(*device).set_readca1_handler(DEVCB_##_devcb);
+ downcast<pia6821_device &>(*device).set_readca1_handler(DEVCB_##_devcb);
#define MCFG_PIA_READCA2_HANDLER(_devcb) \
- devcb = &downcast<pia6821_device &>(*device).set_readca2_handler(DEVCB_##_devcb);
+ downcast<pia6821_device &>(*device).set_readca2_handler(DEVCB_##_devcb);
#define MCFG_PIA_READCB1_HANDLER(_devcb) \
- devcb = &downcast<pia6821_device &>(*device).set_readcb1_handler(DEVCB_##_devcb);
+ downcast<pia6821_device &>(*device).set_readcb1_handler(DEVCB_##_devcb);
// TODO: CONVERT THESE TO WRITE LINE
#define MCFG_PIA_WRITEPA_HANDLER(_devcb) \
- devcb = &downcast<pia6821_device &>(*device).set_writepa_handler(DEVCB_##_devcb);
+ downcast<pia6821_device &>(*device).set_writepa_handler(DEVCB_##_devcb);
#define MCFG_PIA_WRITEPB_HANDLER(_devcb) \
- devcb = &downcast<pia6821_device &>(*device).set_writepb_handler(DEVCB_##_devcb);
+ downcast<pia6821_device &>(*device).set_writepb_handler(DEVCB_##_devcb);
#define MCFG_PIA_CA2_HANDLER(_devcb) \
- devcb = &downcast<pia6821_device &>(*device).set_ca2_handler(DEVCB_##_devcb);
+ downcast<pia6821_device &>(*device).set_ca2_handler(DEVCB_##_devcb);
#define MCFG_PIA_CB2_HANDLER(_devcb) \
- devcb = &downcast<pia6821_device &>(*device).set_cb2_handler(DEVCB_##_devcb);
+ downcast<pia6821_device &>(*device).set_cb2_handler(DEVCB_##_devcb);
#define MCFG_PIA_IRQA_HANDLER(_devcb) \
- devcb = &downcast<pia6821_device &>(*device).set_irqa_handler(DEVCB_##_devcb);
+ downcast<pia6821_device &>(*device).set_irqa_handler(DEVCB_##_devcb);
#define MCFG_PIA_IRQB_HANDLER(_devcb) \
- devcb = &downcast<pia6821_device &>(*device).set_irqb_handler(DEVCB_##_devcb);
+ downcast<pia6821_device &>(*device).set_irqb_handler(DEVCB_##_devcb);
/***************************************************************************
@@ -86,15 +86,26 @@ public:
template<class Obj> devcb_base &set_readca1_handler(Obj &&object) { return m_in_ca1_handler.set_callback(std::forward<Obj>(object)); }
template<class Obj> devcb_base &set_readca2_handler(Obj &&object) { return m_in_ca2_handler.set_callback(std::forward<Obj>(object)); }
template<class Obj> devcb_base &set_readcb1_handler(Obj &&object) { return m_in_cb1_handler.set_callback(std::forward<Obj>(object)); }
+ auto readpa_handler() { return m_in_a_handler.bind(); }
+ auto readpb_handler() { return m_in_b_handler.bind(); }
+ auto readca1_handler() { return m_in_ca1_handler.bind(); }
+ auto readca2_handler() { return m_in_ca2_handler.bind(); }
+ auto readcb1_handler() { return m_in_cb1_handler.bind(); }
// TODO: CONVERT THESE TO WRITE LINE
template<class Obj> devcb_base &set_writepa_handler(Obj &&object) { return m_out_a_handler.set_callback(std::forward<Obj>(object)); }
template<class Obj> devcb_base &set_writepb_handler(Obj &&object) { return m_out_b_handler.set_callback(std::forward<Obj>(object)); }
+ auto writepa_handler() { return m_out_a_handler.bind(); }
+ auto writepb_handler() { return m_out_b_handler.bind(); }
template<class Obj> devcb_base &set_ca2_handler(Obj &&object) { return m_ca2_handler.set_callback(std::forward<Obj>(object)); }
template<class Obj> devcb_base &set_cb2_handler(Obj &&object) { return m_cb2_handler.set_callback(std::forward<Obj>(object)); }
template<class Obj> devcb_base &set_irqa_handler(Obj &&object) { return m_irqa_handler.set_callback(std::forward<Obj>(object)); }
template<class Obj> devcb_base &set_irqb_handler(Obj &&object) { return m_irqb_handler.set_callback(std::forward<Obj>(object)); }
+ auto ca2_handler() { return m_ca2_handler.bind(); }
+ auto cb2_handler() { return m_cb2_handler.bind(); }
+ auto irqa_handler() { return m_irqa_handler.bind(); }
+ auto irqb_handler() { return m_irqb_handler.bind(); }
uint8_t reg_r(uint8_t offset);
void reg_w(uint8_t offset, uint8_t data);
diff --git a/src/devices/machine/68230pit.h b/src/devices/machine/68230pit.h
index c155c1d6b29..eaf7356d202 100644
--- a/src/devices/machine/68230pit.h
+++ b/src/devices/machine/68230pit.h
@@ -43,40 +43,40 @@
//**************************************************************************
#define MCFG_PIT68230_PA_INPUT_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_pa_in_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_pa_in_callback(DEVCB_##_devcb);
#define MCFG_PIT68230_PA_OUTPUT_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_pa_out_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_pa_out_callback(DEVCB_##_devcb);
#define MCFG_PIT68230_PB_INPUT_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_pb_in_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_pb_in_callback(DEVCB_##_devcb);
#define MCFG_PIT68230_PB_OUTPUT_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_pb_out_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_pb_out_callback(DEVCB_##_devcb);
#define MCFG_PIT68230_PC_INPUT_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_pc_in_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_pc_in_callback(DEVCB_##_devcb);
#define MCFG_PIT68230_PC_OUTPUT_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_pc_out_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_pc_out_callback(DEVCB_##_devcb);
#define MCFG_PIT68230_H1_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_h1_out_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_h1_out_callback(DEVCB_##_devcb);
#define MCFG_PIT68230_H2_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_h2_out_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_h2_out_callback(DEVCB_##_devcb);
#define MCFG_PIT68230_H3_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_h3_out_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_h3_out_callback(DEVCB_##_devcb);
#define MCFG_PIT68230_H4_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_h4_out_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_h4_out_callback(DEVCB_##_devcb);
#define MCFG_PIT68230_TIMER_IRQ_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_tirq_out_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_tirq_out_callback(DEVCB_##_devcb);
#define MCFG_PIT68230_PORT_IRQ_CB(_devcb) \
- devcb = &downcast<pit68230_device &>(*device).set_pirq_out_callback(DEVCB_##_devcb);
+ downcast<pit68230_device &>(*device).set_pirq_out_callback(DEVCB_##_devcb);
/*-----------------------------------------------------------------------
* Registers RS1-RS5 R/W Description
diff --git a/src/devices/machine/68307.h b/src/devices/machine/68307.h
index c159dfd796b..cce3630aede 100644
--- a/src/devices/machine/68307.h
+++ b/src/devices/machine/68307.h
@@ -12,17 +12,17 @@
/* trampolines so we can specify the 68681 serial configuration when adding the CPU */
#define MCFG_MC68307_SERIAL_A_TX_CALLBACK(_cb) \
- devcb = &downcast<m68307_cpu_device &>(*device).set_a_tx_cb(DEVCB_##_cb);
+ downcast<m68307_cpu_device &>(*device).set_a_tx_cb(DEVCB_##_cb);
#define MCFG_MC68307_SERIAL_B_TX_CALLBACK(_cb) \
- devcb = &downcast<m68307_cpu_device &>(*device).set_b_tx_cb(DEVCB_##_cb);
+ downcast<m68307_cpu_device &>(*device).set_b_tx_cb(DEVCB_##_cb);
// deprecated: use ipX_w() instead
#define MCFG_MC68307_SERIAL_INPORT_CALLBACK(_cb) \
- devcb = &downcast<m68307_cpu_device &>(*device).set_inport_cb(DEVCB_##_cb);
+ downcast<m68307_cpu_device &>(*device).set_inport_cb(DEVCB_##_cb);
#define MCFG_MC68307_SERIAL_OUTPORT_CALLBACK(_cb) \
- devcb = &downcast<m68307_cpu_device &>(*device).set_outport_cb(DEVCB_##_cb);
+ downcast<m68307_cpu_device &>(*device).set_outport_cb(DEVCB_##_cb);
class m68307_cpu_device : public m68000_device
diff --git a/src/devices/machine/68340.h b/src/devices/machine/68340.h
index fcec19e453d..29febd8ef75 100644
--- a/src/devices/machine/68340.h
+++ b/src/devices/machine/68340.h
@@ -17,37 +17,37 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_MC68340_PA_INPUT_CB(_devcb) \
- devcb = &downcast<m68340_cpu_device &>(*device).set_pa_in_callback(DEVCB_##_devcb);
+ downcast<m68340_cpu_device &>(*device).set_pa_in_callback(DEVCB_##_devcb);
#define MCFG_MC68340_PA_OUTPUT_CB(_devcb) \
- devcb = &downcast<m68340_cpu_device &>(*device).set_pa_out_callback(DEVCB_##_devcb);
+ downcast<m68340_cpu_device &>(*device).set_pa_out_callback(DEVCB_##_devcb);
#define MCFG_MC68340_PB_INPUT_CB(_devcb) \
- devcb = &downcast<m68340_cpu_device &>(*device).set_pb_in_callback(DEVCB_##_devcb);
+ downcast<m68340_cpu_device &>(*device).set_pb_in_callback(DEVCB_##_devcb);
#define MCFG_MC68340_PB_OUTPUT_CB(_devcb) \
- devcb = &downcast<m68340_cpu_device &>(*device).set_pb_out_callback(DEVCB_##_devcb);
+ downcast<m68340_cpu_device &>(*device).set_pb_out_callback(DEVCB_##_devcb);
#define MCFG_MC68340_ADD_CRYSTAL(_crystal) \
downcast<m68340_cpu_device &>(*device).set_crystal(_crystal);
#define MCFG_MC68340_TOUT1_OUTPUT_CB(_devcb) \
- devcb = &downcast<m68340_cpu_device &>(*device).set_tout1_out_callback(DEVCB_##_devcb);
+ downcast<m68340_cpu_device &>(*device).set_tout1_out_callback(DEVCB_##_devcb);
#define MCFG_MC68340_TIN1_INPUT_CB(_devcb) \
- devcb = &downcast<m68340_cpu_device &>(*device).set_tin1_out_callback(DEVCB_##_devcb);
+ downcast<m68340_cpu_device &>(*device).set_tin1_out_callback(DEVCB_##_devcb);
#define MCFG_MC68340_TGATE1_INPUT_CB(_devcb) \
- devcb = &downcast<m68340_cpu_device &>(*device).set_tgate1_out_callback(DEVCB_##_devcb);
+ downcast<m68340_cpu_device &>(*device).set_tgate1_out_callback(DEVCB_##_devcb);
#define MCFG_MC68340_TOUT2_OUTPUT_CB(_devcb) \
- devcb = &downcast<m68340_cpu_device &>(*device).set_tout2_out_callback(DEVCB_##_devcb);
+ downcast<m68340_cpu_device &>(*device).set_tout2_out_callback(DEVCB_##_devcb);
#define MCFG_MC68340_TIN2_INPUT_CB(_devcb) \
- devcb = &downcast<m68340_cpu_device &>(*device).set_tin2_out_callback(DEVCB_##_devcb);
+ downcast<m68340_cpu_device &>(*device).set_tin2_out_callback(DEVCB_##_devcb);
#define MCFG_MC68340_TGATE2_INPUT_CB(_devcb) \
- devcb = &downcast<m68340_cpu_device &>(*device).set_tgate2_out_callback(DEVCB_##_devcb);
+ downcast<m68340_cpu_device &>(*device).set_tgate2_out_callback(DEVCB_##_devcb);
class m68340_cpu_device : public fscpu32_device
{
diff --git a/src/devices/machine/6840ptm.h b/src/devices/machine/6840ptm.h
index 0fd9f3b1196..dbae5eeeb23 100644
--- a/src/devices/machine/6840ptm.h
+++ b/src/devices/machine/6840ptm.h
@@ -23,16 +23,16 @@
downcast<ptm6840_device &>(*device).set_external_clocks(_clk0, _clk1, _clk2);
#define MCFG_PTM6840_O1_CB(_devcb) \
- devcb = &downcast<ptm6840_device &>(*device).set_out_callback(0, DEVCB_##_devcb);
+ downcast<ptm6840_device &>(*device).set_out_callback(0, DEVCB_##_devcb);
#define MCFG_PTM6840_O2_CB(_devcb) \
- devcb = &downcast<ptm6840_device &>(*device).set_out_callback(1, DEVCB_##_devcb);
+ downcast<ptm6840_device &>(*device).set_out_callback(1, DEVCB_##_devcb);
#define MCFG_PTM6840_O3_CB(_devcb) \
- devcb = &downcast<ptm6840_device &>(*device).set_out_callback(2, DEVCB_##_devcb);
+ downcast<ptm6840_device &>(*device).set_out_callback(2, DEVCB_##_devcb);
#define MCFG_PTM6840_IRQ_CB(_devcb) \
- devcb = &downcast<ptm6840_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<ptm6840_device &>(*device).set_irq_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -50,6 +50,10 @@ public:
void set_external_clocks(const XTAL &clock0, const XTAL &clock1, const XTAL &clock2) { set_external_clocks(clock0.dvalue(), clock1.dvalue(), clock2.dvalue()); }
template <class Object> devcb_base &set_out_callback(int index, Object &&cb) { return m_out_cb[index].set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_irq_callback(Object &&cb) { return m_irq_cb.set_callback(std::forward<Object>(cb)); }
+ auto o1_callback() { return m_out_cb[0].bind(); }
+ auto o2_callback() { return m_out_cb[1].bind(); }
+ auto o3_callback() { return m_out_cb[2].bind(); }
+ auto irq_callback() { return m_irq_cb.bind(); }
int status(int clock) const { return m_enabled[clock]; } // get whether timer is enabled
int irq_state() const { return m_irq; } // get IRQ state
diff --git a/src/devices/machine/6850acia.h b/src/devices/machine/6850acia.h
index 1dc975911d8..4d4086fd4af 100644
--- a/src/devices/machine/6850acia.h
+++ b/src/devices/machine/6850acia.h
@@ -15,13 +15,13 @@
#define MCFG_ACIA6850_TXD_HANDLER(_devcb) \
- devcb = &downcast<acia6850_device &>(*device).set_txd_handler(DEVCB_##_devcb);
+ downcast<acia6850_device &>(*device).set_txd_handler(DEVCB_##_devcb);
#define MCFG_ACIA6850_RTS_HANDLER(_devcb) \
- devcb = &downcast<acia6850_device &>(*device).set_rts_handler(DEVCB_##_devcb);
+ downcast<acia6850_device &>(*device).set_rts_handler(DEVCB_##_devcb);
#define MCFG_ACIA6850_IRQ_HANDLER(_devcb) \
- devcb = &downcast<acia6850_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<acia6850_device &>(*device).set_irq_handler(DEVCB_##_devcb);
class acia6850_device : public device_t
{
@@ -33,6 +33,9 @@ public:
template <class Object> devcb_base &set_txd_handler(Object &&cb) { return m_txd_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_rts_handler(Object &&cb) { return m_rts_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ auto txd_handler() { return m_txd_handler.bind(); }
+ auto rts_handler() { return m_rts_handler.bind(); }
+ auto irq_handler() { return m_irq_handler.bind(); }
DECLARE_WRITE8_MEMBER( control_w );
DECLARE_READ8_MEMBER( status_r );
diff --git a/src/devices/machine/68561mpcc.h b/src/devices/machine/68561mpcc.h
index ad4f4f2dda4..24b3c3c7da7 100644
--- a/src/devices/machine/68561mpcc.h
+++ b/src/devices/machine/68561mpcc.h
@@ -68,22 +68,22 @@
/* Callbacks to be called by us for signals driven by the MPCC */
#define MCFG_MPCC_OUT_TXD_CB(_devcb) \
- devcb = &downcast<mpcc_device &>(*device).set_out_txd_callback(DEVCB_##_devcb);
+ downcast<mpcc_device &>(*device).set_out_txd_callback(DEVCB_##_devcb);
#define MCFG_MPCC_OUT_DTR_CB(_devcb) \
- devcb = &downcast<mpcc_device &>(*device).set_out_dtr_callback(DEVCB_##_devcb);
+ downcast<mpcc_device &>(*device).set_out_dtr_callback(DEVCB_##_devcb);
#define MCFG_MPCC_OUT_RTS_CB(_devcb) \
- devcb = &downcast<mpcc_device &>(*device).set_out_rts_callback(DEVCB_##_devcb);
+ downcast<mpcc_device &>(*device).set_out_rts_callback(DEVCB_##_devcb);
#define MCFG_MPCC_OUT_TRXC_CB(_devcb) \
- devcb = &downcast<mpcc_device &>(*device).set_out_trxc_callback(DEVCB_##_devcb);
+ downcast<mpcc_device &>(*device).set_out_trxc_callback(DEVCB_##_devcb);
#define MCFG_MPCC_OUT_RTXC_CB(_devcb) \
- devcb = &downcast<mpcc_device &>(*device).set_out_rtxc_callback(DEVCB_##_devcb);
+ downcast<mpcc_device &>(*device).set_out_rtxc_callback(DEVCB_##_devcb);
#define MCFG_MPCC_OUT_INT_CB(_devcb) \
- devcb = &downcast<mpcc_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<mpcc_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
diff --git a/src/devices/machine/7200fifo.h b/src/devices/machine/7200fifo.h
index 1b89b53406b..642932691c0 100644
--- a/src/devices/machine/7200fifo.h
+++ b/src/devices/machine/7200fifo.h
@@ -61,13 +61,13 @@ The following chips are functionally equivalent and pin-compatible.
downcast<fifo7200_device &>(*device).set_ram_size(_ramsize);
#define MCFG_FIFO7200_EF_HANDLER(_devcb) \
- devcb = &downcast<fifo7200_device &>(*device).set_ef_handler(DEVCB_##_devcb);
+ downcast<fifo7200_device &>(*device).set_ef_handler(DEVCB_##_devcb);
#define MCFG_FIFO7200_FF_HANDLER(_devcb) \
- devcb = &downcast<fifo7200_device &>(*device).set_ff_handler(DEVCB_##_devcb);
+ downcast<fifo7200_device &>(*device).set_ff_handler(DEVCB_##_devcb);
#define MCFG_FIFO7200_HF_HANDLER(_devcb) \
- devcb = &downcast<fifo7200_device &>(*device).set_hf_handler(DEVCB_##_devcb);
+ downcast<fifo7200_device &>(*device).set_hf_handler(DEVCB_##_devcb);
diff --git a/src/devices/machine/7400.h b/src/devices/machine/7400.h
index 0f7d7cb67a6..a96c02bcf87 100644
--- a/src/devices/machine/7400.h
+++ b/src/devices/machine/7400.h
@@ -35,16 +35,16 @@
#define MCFG_7400_Y1_CB(_devcb) \
- devcb = &downcast<ttl7400_device &>(*device).set_y1_cb(DEVCB_##_devcb);
+ downcast<ttl7400_device &>(*device).set_y1_cb(DEVCB_##_devcb);
#define MCFG_7400_Y2_CB(_devcb) \
- devcb = &downcast<ttl7400_device &>(*device).set_y2_cb(DEVCB_##_devcb);
+ downcast<ttl7400_device &>(*device).set_y2_cb(DEVCB_##_devcb);
#define MCFG_7400_Y3_CB(_devcb) \
- devcb = &downcast<ttl7400_device &>(*device).set_y3_cb(DEVCB_##_devcb);
+ downcast<ttl7400_device &>(*device).set_y3_cb(DEVCB_##_devcb);
#define MCFG_7400_Y4_CB(_devcb) \
- devcb = &downcast<ttl7400_device &>(*device).set_y4_cb(DEVCB_##_devcb);
+ downcast<ttl7400_device &>(*device).set_y4_cb(DEVCB_##_devcb);
class ttl7400_device : public device_t
diff --git a/src/devices/machine/7404.h b/src/devices/machine/7404.h
index 31900c1ac9d..4d767fbfed4 100644
--- a/src/devices/machine/7404.h
+++ b/src/devices/machine/7404.h
@@ -62,22 +62,22 @@
#define MCFG_7404_Y1_CB(_devcb) \
- devcb = &downcast<ttl7404_device &>(*device).set_y1_cb(DEVCB_##_devcb);
+ downcast<ttl7404_device &>(*device).set_y1_cb(DEVCB_##_devcb);
#define MCFG_7404_Y2_CB(_devcb) \
- devcb = &downcast<ttl7404_device &>(*device).set_y2_cb(DEVCB_##_devcb);
+ downcast<ttl7404_device &>(*device).set_y2_cb(DEVCB_##_devcb);
#define MCFG_7404_Y3_CB(_devcb) \
- devcb = &downcast<ttl7404_device &>(*device).set_y3_cb(DEVCB_##_devcb);
+ downcast<ttl7404_device &>(*device).set_y3_cb(DEVCB_##_devcb);
#define MCFG_7404_Y4_CB(_devcb) \
- devcb = &downcast<ttl7404_device &>(*device).set_y4_cb(DEVCB_##_devcb);
+ downcast<ttl7404_device &>(*device).set_y4_cb(DEVCB_##_devcb);
#define MCFG_7404_Y5_CB(_devcb) \
- devcb = &downcast<ttl7404_device &>(*device).set_y5_cb(DEVCB_##_devcb);
+ downcast<ttl7404_device &>(*device).set_y5_cb(DEVCB_##_devcb);
#define MCFG_7404_Y6_CB(_devcb) \
- devcb = &downcast<ttl7404_device &>(*device).set_y6_cb(DEVCB_##_devcb);
+ downcast<ttl7404_device &>(*device).set_y6_cb(DEVCB_##_devcb);
class ttl7404_device : public device_t
{
diff --git a/src/devices/machine/74123.h b/src/devices/machine/74123.h
index 075e56c8206..b5f0fc7e15b 100644
--- a/src/devices/machine/74123.h
+++ b/src/devices/machine/74123.h
@@ -76,7 +76,7 @@
downcast<ttl74123_device &>(*device).set_clear_pin_value(_value);
#define MCFG_TTL74123_OUTPUT_CHANGED_CB(_devcb) \
- devcb = &downcast<ttl74123_device &>(*device).set_output_changed_callback(DEVCB_##_devcb);
+ downcast<ttl74123_device &>(*device).set_output_changed_callback(DEVCB_##_devcb);
/* constants for the different ways the cap/res can be connected.
This determines the formula for calculating the pulse width */
diff --git a/src/devices/machine/74145.h b/src/devices/machine/74145.h
index 553d4ee86db..c396c1c1fbf 100644
--- a/src/devices/machine/74145.h
+++ b/src/devices/machine/74145.h
@@ -18,34 +18,34 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_TTL74145_OUTPUT_LINE_0_CB(_devcb) \
- devcb = &downcast<ttl74145_device &>(*device).set_output_line_0_callback(DEVCB_##_devcb);
+ downcast<ttl74145_device &>(*device).set_output_line_0_callback(DEVCB_##_devcb);
#define MCFG_TTL74145_OUTPUT_LINE_1_CB(_devcb) \
- devcb = &downcast<ttl74145_device &>(*device).set_output_line_1_callback(DEVCB_##_devcb);
+ downcast<ttl74145_device &>(*device).set_output_line_1_callback(DEVCB_##_devcb);
#define MCFG_TTL74145_OUTPUT_LINE_2_CB(_devcb) \
- devcb = &downcast<ttl74145_device &>(*device).set_output_line_2_callback(DEVCB_##_devcb);
+ downcast<ttl74145_device &>(*device).set_output_line_2_callback(DEVCB_##_devcb);
#define MCFG_TTL74145_OUTPUT_LINE_3_CB(_devcb) \
- devcb = &downcast<ttl74145_device &>(*device).set_output_line_3_callback(DEVCB_##_devcb);
+ downcast<ttl74145_device &>(*device).set_output_line_3_callback(DEVCB_##_devcb);
#define MCFG_TTL74145_OUTPUT_LINE_4_CB(_devcb) \
- devcb = &downcast<ttl74145_device &>(*device).set_output_line_4_callback(DEVCB_##_devcb);
+ downcast<ttl74145_device &>(*device).set_output_line_4_callback(DEVCB_##_devcb);
#define MCFG_TTL74145_OUTPUT_LINE_5_CB(_devcb) \
- devcb = &downcast<ttl74145_device &>(*device).set_output_line_5_callback(DEVCB_##_devcb);
+ downcast<ttl74145_device &>(*device).set_output_line_5_callback(DEVCB_##_devcb);
#define MCFG_TTL74145_OUTPUT_LINE_6_CB(_devcb) \
- devcb = &downcast<ttl74145_device &>(*device).set_output_line_6_callback(DEVCB_##_devcb);
+ downcast<ttl74145_device &>(*device).set_output_line_6_callback(DEVCB_##_devcb);
#define MCFG_TTL74145_OUTPUT_LINE_7_CB(_devcb) \
- devcb = &downcast<ttl74145_device &>(*device).set_output_line_7_callback(DEVCB_##_devcb);
+ downcast<ttl74145_device &>(*device).set_output_line_7_callback(DEVCB_##_devcb);
#define MCFG_TTL74145_OUTPUT_LINE_8_CB(_devcb) \
- devcb = &downcast<ttl74145_device &>(*device).set_output_line_8_callback(DEVCB_##_devcb);
+ downcast<ttl74145_device &>(*device).set_output_line_8_callback(DEVCB_##_devcb);
#define MCFG_TTL74145_OUTPUT_LINE_9_CB(_devcb) \
- devcb = &downcast<ttl74145_device &>(*device).set_output_line_9_callback(DEVCB_##_devcb);
+ downcast<ttl74145_device &>(*device).set_output_line_9_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/74153.h b/src/devices/machine/74153.h
index 4ce38d32a9e..fc234463e30 100644
--- a/src/devices/machine/74153.h
+++ b/src/devices/machine/74153.h
@@ -30,10 +30,10 @@
//**************************************************************************
#define MCFG_TTL153_ZA_CB(_devcb) \
- devcb = &downcast<ttl153_device &>(*device).set_za_callback(DEVCB_##_devcb);
+ downcast<ttl153_device &>(*device).set_za_callback(DEVCB_##_devcb);
#define MCFG_TTL153_ZB_CB(_devcb) \
- devcb = &downcast<ttl153_device &>(*device).set_zb_callback(DEVCB_##_devcb);
+ downcast<ttl153_device &>(*device).set_zb_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/74157.h b/src/devices/machine/74157.h
index 196194c8ddb..96a23d64235 100644
--- a/src/devices/machine/74157.h
+++ b/src/devices/machine/74157.h
@@ -30,13 +30,13 @@
//**************************************************************************
#define MCFG_74157_A_IN_CB(_devcb) \
- devcb = &downcast<ls157_device &>(*device).set_a_in_callback(DEVCB_##_devcb);
+ downcast<ls157_device &>(*device).set_a_in_callback(DEVCB_##_devcb);
#define MCFG_74157_B_IN_CB(_devcb) \
- devcb = &downcast<ls157_device &>(*device).set_b_in_callback(DEVCB_##_devcb);
+ downcast<ls157_device &>(*device).set_b_in_callback(DEVCB_##_devcb);
#define MCFG_74157_OUT_CB(_devcb) \
- devcb = &downcast<ls157_device &>(*device).set_out_callback(DEVCB_##_devcb);
+ downcast<ls157_device &>(*device).set_out_callback(DEVCB_##_devcb);
//**************************************************************************
@@ -49,12 +49,15 @@ class ls157_device : public device_t
{
public:
// construction/destruction
- ls157_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ ls157_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
// static configuration
template <class Object> devcb_base &set_a_in_callback(Object &&cb) { return m_a_in_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_b_in_callback(Object &&cb) { return m_b_in_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_out_callback(Object &&cb) { return m_out_cb.set_callback(std::forward<Object>(cb)); }
+ auto a_in_callback() { return m_a_in_cb.bind(); }
+ auto b_in_callback() { return m_b_in_cb.bind(); }
+ auto out_callback() { return m_out_cb.bind(); }
// data writes
DECLARE_WRITE8_MEMBER(a_w) { write_a(data); }
diff --git a/src/devices/machine/74161.h b/src/devices/machine/74161.h
index 8428411c05b..932428bdb78 100644
--- a/src/devices/machine/74161.h
+++ b/src/devices/machine/74161.h
@@ -59,22 +59,22 @@
#define MCFG_7416x_QA_CB(_devcb) \
- devcb = &downcast<ttl7416x_device &>(*device).set_qa_cb(DEVCB_##_devcb);
+ downcast<ttl7416x_device &>(*device).set_qa_cb(DEVCB_##_devcb);
#define MCFG_7416x_QB_CB(_devcb) \
- devcb = &downcast<ttl7416x_device &>(*device).set_qb_cb(DEVCB_##_devcb);
+ downcast<ttl7416x_device &>(*device).set_qb_cb(DEVCB_##_devcb);
#define MCFG_7416x_QC_CB(_devcb) \
- devcb = &downcast<ttl7416x_device &>(*device).set_qc_cb(DEVCB_##_devcb);
+ downcast<ttl7416x_device &>(*device).set_qc_cb(DEVCB_##_devcb);
#define MCFG_7416x_QD_CB(_devcb) \
- devcb = &downcast<ttl7416x_device &>(*device).set_qd_cb(DEVCB_##_devcb);
+ downcast<ttl7416x_device &>(*device).set_qd_cb(DEVCB_##_devcb);
#define MCFG_7416x_OUTPUT_CB(_devcb) \
- devcb = &downcast<ttl7416x_device &>(*device).set_output_cb(DEVCB_##_devcb);
+ downcast<ttl7416x_device &>(*device).set_output_cb(DEVCB_##_devcb);
#define MCFG_7416x_TC_CB(_devcb) \
- devcb = &downcast<ttl7416x_device &>(*device).set_tc_cb(DEVCB_##_devcb);
+ downcast<ttl7416x_device &>(*device).set_tc_cb(DEVCB_##_devcb);
class ttl7416x_device : public device_t
{
diff --git a/src/devices/machine/74165.h b/src/devices/machine/74165.h
index 8b608760572..1db3f2809fe 100644
--- a/src/devices/machine/74165.h
+++ b/src/devices/machine/74165.h
@@ -31,10 +31,10 @@
//**************************************************************************
#define MCFG_TTL165_DATA_CB(_devcb) \
- devcb = &downcast<ttl165_device &>(*device).set_data_callback(DEVCB_##_devcb);
+ downcast<ttl165_device &>(*device).set_data_callback(DEVCB_##_devcb);
#define MCFG_TTL165_QH_CB(_devcb) \
- devcb = &downcast<ttl165_device &>(*device).set_qh_callback(DEVCB_##_devcb);
+ downcast<ttl165_device &>(*device).set_qh_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/74166.h b/src/devices/machine/74166.h
index 77497b1be5e..a256f904bf4 100644
--- a/src/devices/machine/74166.h
+++ b/src/devices/machine/74166.h
@@ -31,10 +31,10 @@
//**************************************************************************
#define MCFG_TTL166_DATA_CB(_devcb) \
- devcb = &downcast<ttl166_device &>(*device).set_data_callback(DEVCB_##_devcb);
+ downcast<ttl166_device &>(*device).set_data_callback(DEVCB_##_devcb);
#define MCFG_TTL166_QH_CB(_devcb) \
- devcb = &downcast<ttl166_device &>(*device).set_qh_callback(DEVCB_##_devcb);
+ downcast<ttl166_device &>(*device).set_qh_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/74175.h b/src/devices/machine/74175.h
index e8f17a5ecbb..f4f1912f085 100644
--- a/src/devices/machine/74175.h
+++ b/src/devices/machine/74175.h
@@ -49,46 +49,46 @@
#define MCFG_74174_Q1_CB(_devcb) \
- devcb = &downcast<ttl741745_device &>(*device).set_q1_cb(DEVCB_##_devcb);
+ downcast<ttl741745_device &>(*device).set_q1_cb(DEVCB_##_devcb);
#define MCFG_74174_Q2_CB(_devcb) \
- devcb = &downcast<ttl741745_device &>(*device).set_q2_cb(DEVCB_##_devcb);
+ downcast<ttl741745_device &>(*device).set_q2_cb(DEVCB_##_devcb);
#define MCFG_74174_Q3_CB(_devcb) \
- devcb = &downcast<ttl741745_device &>(*device).set_q3_cb(DEVCB_##_devcb);
+ downcast<ttl741745_device &>(*device).set_q3_cb(DEVCB_##_devcb);
#define MCFG_74174_Q4_CB(_devcb) \
- devcb = &downcast<ttl741745_device &>(*device).set_q4_cb(DEVCB_##_devcb);
+ downcast<ttl741745_device &>(*device).set_q4_cb(DEVCB_##_devcb);
#define MCFG_74175_Q1_CB(_devcb) \
- devcb = &downcast<ttl741745_device &>(*device).set_q1_cb(DEVCB_##_devcb);
+ downcast<ttl741745_device &>(*device).set_q1_cb(DEVCB_##_devcb);
#define MCFG_74175_Q2_CB(_devcb) \
- devcb = &downcast<ttl741745_device &>(*device).set_q2_cb(DEVCB_##_devcb);
+ downcast<ttl741745_device &>(*device).set_q2_cb(DEVCB_##_devcb);
#define MCFG_74175_Q3_CB(_devcb) \
- devcb = &downcast<ttl741745_device &>(*device).set_q3_cb(DEVCB_##_devcb);
+ downcast<ttl741745_device &>(*device).set_q3_cb(DEVCB_##_devcb);
#define MCFG_74175_Q4_CB(_devcb) \
- devcb = &downcast<ttl741745_device &>(*device).set_q4_cb(DEVCB_##_devcb);
+ downcast<ttl741745_device &>(*device).set_q4_cb(DEVCB_##_devcb);
#define MCFG_74174_Q5_CB(_devcb) \
- devcb = &downcast<ttl74174_device &>(*device).set_q5_cb(DEVCB_##_devcb);
+ downcast<ttl74174_device &>(*device).set_q5_cb(DEVCB_##_devcb);
#define MCFG_74174_Q6_CB(_devcb) \
- devcb = &downcast<ttl74174_device &>(*device).set_q6_cb(DEVCB_##_devcb);
+ downcast<ttl74174_device &>(*device).set_q6_cb(DEVCB_##_devcb);
#define MCFG_74175_NOT_Q1_CB(_devcb) \
- devcb = &downcast<ttl74175_device &>(*device).set_not_q1_cb(DEVCB_##_devcb);
+ downcast<ttl74175_device &>(*device).set_not_q1_cb(DEVCB_##_devcb);
#define MCFG_74175_NOT_Q2_CB(_devcb) \
- devcb = &downcast<ttl74175_device &>(*device).set_not_q2_cb(DEVCB_##_devcb);
+ downcast<ttl74175_device &>(*device).set_not_q2_cb(DEVCB_##_devcb);
#define MCFG_74175_NOT_Q3_CB(_devcb) \
- devcb = &downcast<ttl74175_device &>(*device).set_not_q3_cb(DEVCB_##_devcb);
+ downcast<ttl74175_device &>(*device).set_not_q3_cb(DEVCB_##_devcb);
#define MCFG_74175_NOT_Q4_CB(_devcb) \
- devcb = &downcast<ttl74175_device &>(*device).set_not_q1_cb(DEVCB_##_devcb);
+ downcast<ttl74175_device &>(*device).set_not_q1_cb(DEVCB_##_devcb);
class ttl741745_device : public device_t
diff --git a/src/devices/machine/74259.h b/src/devices/machine/74259.h
index 60a43a2a55d..990c1f1ca58 100644
--- a/src/devices/machine/74259.h
+++ b/src/devices/machine/74259.h
@@ -37,24 +37,24 @@
//**************************************************************************
#define MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(_devcb) \
- devcb = &downcast<addressable_latch_device &>(*device).set_q_out_cb<0>(DEVCB_##_devcb);
+ downcast<addressable_latch_device &>(*device).set_q_out_cb<0>(DEVCB_##_devcb);
#define MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(_devcb) \
- devcb = &downcast<addressable_latch_device &>(*device).set_q_out_cb<1>(DEVCB_##_devcb);
+ downcast<addressable_latch_device &>(*device).set_q_out_cb<1>(DEVCB_##_devcb);
#define MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(_devcb) \
- devcb = &downcast<addressable_latch_device &>(*device).set_q_out_cb<2>(DEVCB_##_devcb);
+ downcast<addressable_latch_device &>(*device).set_q_out_cb<2>(DEVCB_##_devcb);
#define MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(_devcb) \
- devcb = &downcast<addressable_latch_device &>(*device).set_q_out_cb<3>(DEVCB_##_devcb);
+ downcast<addressable_latch_device &>(*device).set_q_out_cb<3>(DEVCB_##_devcb);
#define MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(_devcb) \
- devcb = &downcast<addressable_latch_device &>(*device).set_q_out_cb<4>(DEVCB_##_devcb);
+ downcast<addressable_latch_device &>(*device).set_q_out_cb<4>(DEVCB_##_devcb);
#define MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(_devcb) \
- devcb = &downcast<addressable_latch_device &>(*device).set_q_out_cb<5>(DEVCB_##_devcb);
+ downcast<addressable_latch_device &>(*device).set_q_out_cb<5>(DEVCB_##_devcb);
#define MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(_devcb) \
- devcb = &downcast<addressable_latch_device &>(*device).set_q_out_cb<6>(DEVCB_##_devcb);
+ downcast<addressable_latch_device &>(*device).set_q_out_cb<6>(DEVCB_##_devcb);
#define MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(_devcb) \
- devcb = &downcast<addressable_latch_device &>(*device).set_q_out_cb<7>(DEVCB_##_devcb);
+ downcast<addressable_latch_device &>(*device).set_q_out_cb<7>(DEVCB_##_devcb);
#define MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(_devcb) \
- devcb = &downcast<addressable_latch_device &>(*device).set_parallel_out_cb(DEVCB_##_devcb);
+ downcast<addressable_latch_device &>(*device).set_parallel_out_cb(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -68,6 +68,8 @@ public:
// static configuration
template<unsigned Bit, class Object> devcb_base &set_q_out_cb(Object &&cb) { return m_q_out_cb[Bit].set_callback(std::forward<Object>(cb)); }
template<class Object> devcb_base &set_parallel_out_cb(Object &&cb) { return m_parallel_out_cb.set_callback(std::forward<Object>(cb)); }
+ template <unsigned Bit> auto q_out_cb() { return m_q_out_cb[Bit].bind(); }
+ auto parallel_out_cb() { return m_parallel_out_cb.bind(); }
// data write handlers
void write_bit(offs_t offset, bool d);
diff --git a/src/devices/machine/7474.h b/src/devices/machine/7474.h
index 2d4cab1a9df..0a6a678ddfb 100644
--- a/src/devices/machine/7474.h
+++ b/src/devices/machine/7474.h
@@ -52,10 +52,10 @@
//**************************************************************************
#define MCFG_7474_OUTPUT_CB(_devcb) \
- devcb = &downcast<ttl7474_device &>(*device).set_output_cb(DEVCB_##_devcb);
+ downcast<ttl7474_device &>(*device).set_output_cb(DEVCB_##_devcb);
#define MCFG_7474_COMP_OUTPUT_CB(_devcb) \
- devcb = &downcast<ttl7474_device &>(*device).set_comp_output_cb(DEVCB_##_devcb);
+ downcast<ttl7474_device &>(*device).set_comp_output_cb(DEVCB_##_devcb);
//**************************************************************************
@@ -73,6 +73,8 @@ public:
// static configuration helpers
template <class Object> devcb_base &set_output_cb(Object &&cb) { return m_output_func.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_comp_output_cb(Object &&cb) { return m_comp_output_func.set_callback(std::forward<Object>(cb)); }
+ auto output_cb() { return m_output_func.bind(); }
+ auto comp_output_cb() { return m_comp_output_func.bind(); }
// public interfaces
DECLARE_WRITE_LINE_MEMBER( clear_w );
diff --git a/src/devices/machine/8042kbdc.h b/src/devices/machine/8042kbdc.h
index b7f1610497e..2d5b63d96bc 100644
--- a/src/devices/machine/8042kbdc.h
+++ b/src/devices/machine/8042kbdc.h
@@ -24,19 +24,19 @@
downcast<kbdc8042_device &>(*device).set_keyboard_type(kbdc8042_device::_kbdt);
#define MCFG_KBDC8042_SYSTEM_RESET_CB(_devcb) \
- devcb = &downcast<kbdc8042_device &>(*device).set_system_reset_callback(DEVCB_##_devcb);
+ downcast<kbdc8042_device &>(*device).set_system_reset_callback(DEVCB_##_devcb);
#define MCFG_KBDC8042_GATE_A20_CB(_devcb) \
- devcb = &downcast<kbdc8042_device &>(*device).set_gate_a20_callback(DEVCB_##_devcb);
+ downcast<kbdc8042_device &>(*device).set_gate_a20_callback(DEVCB_##_devcb);
#define MCFG_KBDC8042_INPUT_BUFFER_FULL_CB(_devcb) \
- devcb = &downcast<kbdc8042_device &>(*device).set_input_buffer_full_callback(DEVCB_##_devcb);
+ downcast<kbdc8042_device &>(*device).set_input_buffer_full_callback(DEVCB_##_devcb);
#define MCFG_KBDC8042_OUTPUT_BUFFER_EMPTY_CB(_devcb) \
- devcb = &downcast<kbdc8042_device &>(*device).set_output_buffer_empty_callback(DEVCB_##_devcb);
+ downcast<kbdc8042_device &>(*device).set_output_buffer_empty_callback(DEVCB_##_devcb);
#define MCFG_KBDC8042_SPEAKER_CB(_devcb) \
- devcb = &downcast<kbdc8042_device &>(*device).set_speaker_callback(DEVCB_##_devcb);
+ downcast<kbdc8042_device &>(*device).set_speaker_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/82s129.h b/src/devices/machine/82s129.h
index 1eb79166a30..9b5ef9d3bf1 100644
--- a/src/devices/machine/82s129.h
+++ b/src/devices/machine/82s129.h
@@ -47,34 +47,34 @@
#define MCFG_82S126_OUTPUT_CB(_devcb) \
- devcb = &downcast<prom82s129_base_device &>(*device).set_out_cb(DEVCB_##_devcb);
+ downcast<prom82s129_base_device &>(*device).set_out_cb(DEVCB_##_devcb);
#define MCFG_82S126_O1_CB(_devcb) \
- devcb = &downcast<prom82s129_base_device &>(*device).set_o1_cb(DEVCB_##_devcb);
+ downcast<prom82s129_base_device &>(*device).set_o1_cb(DEVCB_##_devcb);
#define MCFG_82S126_O2_CB(_devcb) \
- devcb = &downcast<prom82s129_base_device &>(*device).set_o2_cb(DEVCB_##_devcb);
+ downcast<prom82s129_base_device &>(*device).set_o2_cb(DEVCB_##_devcb);
#define MCFG_82S126_O3_CB(_devcb) \
- devcb = &downcast<prom82s129_base_device &>(*device).set_o3_cb(DEVCB_##_devcb);
+ downcast<prom82s129_base_device &>(*device).set_o3_cb(DEVCB_##_devcb);
#define MCFG_82S126_O4_CB(_devcb) \
- devcb = &downcast<prom82s129_base_device &>(*device).set_o4_cb(DEVCB_##_devcb);
+ downcast<prom82s129_base_device &>(*device).set_o4_cb(DEVCB_##_devcb);
#define MCFG_82S129_OUTPUT_CB(_devcb) \
- devcb = &downcast<prom82s129_base_device &>(*device).set_out_cb(DEVCB_##_devcb);
+ downcast<prom82s129_base_device &>(*device).set_out_cb(DEVCB_##_devcb);
#define MCFG_82S129_O1_CB(_devcb) \
- devcb = &downcast<prom82s129_base_device &>(*device).set_o1_cb(DEVCB_##_devcb);
+ downcast<prom82s129_base_device &>(*device).set_o1_cb(DEVCB_##_devcb);
#define MCFG_82S129_O2_CB(_devcb) \
- devcb = &downcast<prom82s129_base_device &>(*device).set_o2_cb(DEVCB_##_devcb);
+ downcast<prom82s129_base_device &>(*device).set_o2_cb(DEVCB_##_devcb);
#define MCFG_82S129_O3_CB(_devcb) \
- devcb = &downcast<prom82s129_base_device &>(*device).set_o3_cb(DEVCB_##_devcb);
+ downcast<prom82s129_base_device &>(*device).set_o3_cb(DEVCB_##_devcb);
#define MCFG_82S129_O4_CB(_devcb) \
- devcb = &downcast<prom82s129_base_device &>(*device).set_o4_cb(DEVCB_##_devcb);
+ downcast<prom82s129_base_device &>(*device).set_o4_cb(DEVCB_##_devcb);
#define MCFG_82S129_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, PROM82S129, 0)
diff --git a/src/devices/machine/8364_paula.h b/src/devices/machine/8364_paula.h
index db9ed3727c0..31e2c2661bf 100644
--- a/src/devices/machine/8364_paula.h
+++ b/src/devices/machine/8364_paula.h
@@ -49,10 +49,10 @@
//**************************************************************************
#define MCFG_PAULA_MEM_READ_CB(_devcb) \
- devcb = &downcast<paula_8364_device &>(*device).set_mem_r_callback(DEVCB_##_devcb);
+ downcast<paula_8364_device &>(*device).set_mem_r_callback(DEVCB_##_devcb);
#define MCFG_PAULA_INT_CB(_devcb) \
- devcb = &downcast<paula_8364_device &>(*device).set_int_w_callback(DEVCB_##_devcb);
+ downcast<paula_8364_device &>(*device).set_int_w_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/8530scc.h b/src/devices/machine/8530scc.h
index 5333fda0060..457a0d36334 100644
--- a/src/devices/machine/8530scc.h
+++ b/src/devices/machine/8530scc.h
@@ -12,7 +12,7 @@
#define MAME_MACHINE_8530SCC_H
#define MCFG_Z8530_INTRQ_CALLBACK(_write) \
- devcb = &downcast<scc8530_t &>(*device).set_intrq_wr_callback(DEVCB_##_write);
+ downcast<scc8530_t &>(*device).set_intrq_wr_callback(DEVCB_##_write);
class scc8530_t : public device_t
{
diff --git a/src/devices/machine/aakart.h b/src/devices/machine/aakart.h
index f432055f59c..661a1f33086 100644
--- a/src/devices/machine/aakart.h
+++ b/src/devices/machine/aakart.h
@@ -18,10 +18,10 @@ Acorn Archimedes KART interface
//**************************************************************************
#define MCFG_AAKART_OUT_TX_CB(_devcb) \
- devcb = &downcast<aakart_device &>(*device).set_out_tx_callback(DEVCB_##_devcb);
+ downcast<aakart_device &>(*device).set_out_tx_callback(DEVCB_##_devcb);
#define MCFG_AAKART_OUT_RX_CB(_devcb) \
- devcb = &downcast<aakart_device &>(*device).set_out_rx_callback(DEVCB_##_devcb);
+ downcast<aakart_device &>(*device).set_out_rx_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/adc0808.h b/src/devices/machine/adc0808.h
index ace9fcf4682..4d717446be0 100644
--- a/src/devices/machine/adc0808.h
+++ b/src/devices/machine/adc0808.h
@@ -42,35 +42,35 @@
//**************************************************************************
#define MCFG_ADC0808_EOC_CB(_devcb) \
- devcb = &downcast<adc0808_device &>(*device).set_eoc_callback(DEVCB_##_devcb);
+ downcast<adc0808_device &>(*device).set_eoc_callback(DEVCB_##_devcb);
// common hookup where the eoc output is connected to a flip-flop
#define MCFG_ADC0808_EOC_FF_CB(_devcb) \
- devcb = &downcast<adc0808_device &>(*device).set_eoc_ff_callback(DEVCB_##_devcb);
+ downcast<adc0808_device &>(*device).set_eoc_ff_callback(DEVCB_##_devcb);
#define MCFG_ADC0808_IN0_CB(_devcb) \
- devcb = &downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 0);
+ downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 0);
#define MCFG_ADC0808_IN1_CB(_devcb) \
- devcb = &downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 1);
+ downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 1);
#define MCFG_ADC0808_IN2_CB(_devcb) \
- devcb = &downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 2);
+ downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 2);
#define MCFG_ADC0808_IN3_CB(_devcb) \
- devcb = &downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 3);
+ downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 3);
#define MCFG_ADC0808_IN4_CB(_devcb) \
- devcb = &downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 4);
+ downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 4);
#define MCFG_ADC0808_IN5_CB(_devcb) \
- devcb = &downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 5);
+ downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 5);
#define MCFG_ADC0808_IN6_CB(_devcb) \
- devcb = &downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 6);
+ downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 6);
#define MCFG_ADC0808_IN7_CB(_devcb) \
- devcb = &downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 7);
+ downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 7);
//**************************************************************************
diff --git a/src/devices/machine/adc0844.h b/src/devices/machine/adc0844.h
index e31740b3d09..d7133695128 100644
--- a/src/devices/machine/adc0844.h
+++ b/src/devices/machine/adc0844.h
@@ -34,19 +34,19 @@
MCFG_DEVICE_ADD(_tag, ADC0844, 0)
#define MCFG_ADC0844_INTR_CB(_devcb) \
- devcb = &downcast<adc0844_device &>(*device).set_intr_callback(DEVCB_##_devcb);
+ downcast<adc0844_device &>(*device).set_intr_callback(DEVCB_##_devcb);
#define MCFG_ADC0844_CH1_CB(_devcb) \
- devcb = &downcast<adc0844_device &>(*device).set_ch1_callback(DEVCB_##_devcb);
+ downcast<adc0844_device &>(*device).set_ch1_callback(DEVCB_##_devcb);
#define MCFG_ADC0844_CH2_CB(_devcb) \
- devcb = &downcast<adc0844_device &>(*device).set_ch2_callback(DEVCB_##_devcb);
+ downcast<adc0844_device &>(*device).set_ch2_callback(DEVCB_##_devcb);
#define MCFG_ADC0844_CH3_CB(_devcb) \
- devcb = &downcast<adc0844_device &>(*device).set_ch3_callback(DEVCB_##_devcb);
+ downcast<adc0844_device &>(*device).set_ch3_callback(DEVCB_##_devcb);
#define MCFG_ADC0844_CH4_CB(_devcb) \
- devcb = &downcast<adc0844_device &>(*device).set_ch4_callback(DEVCB_##_devcb);
+ downcast<adc0844_device &>(*device).set_ch4_callback(DEVCB_##_devcb);
#define MCFG_ADC0848_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, ADC0848, 0)
@@ -58,16 +58,16 @@
#define MCFG_ADC0848_CH4_CB MCFG_ADC0844_CH4_CB
#define MCFG_ADC0848_CH5_CB(_devcb) \
- devcb = &downcast<adc0848_device &>(*device).set_ch5_callback(DEVCB_##_devcb);
+ downcast<adc0848_device &>(*device).set_ch5_callback(DEVCB_##_devcb);
#define MCFG_ADC0848_CH6_CB(_devcb) \
- devcb = &downcast<adc0848_device &>(*device).set_ch6_callback(DEVCB_##_devcb);
+ downcast<adc0848_device &>(*device).set_ch6_callback(DEVCB_##_devcb);
#define MCFG_ADC0848_CH7_CB(_devcb) \
- devcb = &downcast<adc0848_device &>(*device).set_ch7_callback(DEVCB_##_devcb);
+ downcast<adc0848_device &>(*device).set_ch7_callback(DEVCB_##_devcb);
#define MCFG_ADC0848_CH8_CB(_devcb) \
- devcb = &downcast<adc0848_device &>(*device).set_ch8_callback(DEVCB_##_devcb);
+ downcast<adc0848_device &>(*device).set_ch8_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/akiko.h b/src/devices/machine/akiko.h
index d72b5b58ce5..49e2623adbe 100644
--- a/src/devices/machine/akiko.h
+++ b/src/devices/machine/akiko.h
@@ -29,22 +29,22 @@
MCFG_DEVICE_ADD(_tag, AKIKO, 0)
#define MCFG_AKIKO_MEM_READ_CB(_devcb) \
- devcb = &downcast<akiko_device &>(*device).set_mem_r_callback(DEVCB_##_devcb);
+ downcast<akiko_device &>(*device).set_mem_r_callback(DEVCB_##_devcb);
#define MCFG_AKIKO_MEM_WRITE_CB(_devcb) \
- devcb = &downcast<akiko_device &>(*device).set_mem_w_callback(DEVCB_##_devcb);
+ downcast<akiko_device &>(*device).set_mem_w_callback(DEVCB_##_devcb);
#define MCFG_AKIKO_INT_CB(_devcb) \
- devcb = &downcast<akiko_device &>(*device).set_int_w_callback(DEVCB_##_devcb);
+ downcast<akiko_device &>(*device).set_int_w_callback(DEVCB_##_devcb);
#define MCFG_AKIKO_SCL_HANDLER(_devcb) \
- devcb = &downcast<akiko_device &>(*device).set_scl_handler(DEVCB_##_devcb);
+ downcast<akiko_device &>(*device).set_scl_handler(DEVCB_##_devcb);
#define MCFG_AKIKO_SDA_READ_HANDLER(_devcb) \
- devcb = &downcast<akiko_device &>(*device).set_sda_read_handler(DEVCB_##_devcb);
+ downcast<akiko_device &>(*device).set_sda_read_handler(DEVCB_##_devcb);
#define MCFG_AKIKO_SDA_WRITE_HANDLER(_devcb) \
- devcb = &downcast<akiko_device &>(*device).set_sda_write_handler(DEVCB_##_devcb);
+ downcast<akiko_device &>(*device).set_sda_write_handler(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/am53cf96.h b/src/devices/machine/am53cf96.h
index ba7b46ab2c7..02e64599827 100644
--- a/src/devices/machine/am53cf96.h
+++ b/src/devices/machine/am53cf96.h
@@ -13,7 +13,7 @@
#include "legscsi.h"
#define MCFG_AM53CF96_IRQ_HANDLER(_devcb) \
- devcb = &downcast<am53cf96_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<am53cf96_device &>(*device).set_irq_handler(DEVCB_##_devcb);
class am53cf96_device : public legacy_scsi_host_adapter
{
diff --git a/src/devices/machine/am9513.h b/src/devices/machine/am9513.h
index c11a659624f..51fdfd54091 100644
--- a/src/devices/machine/am9513.h
+++ b/src/devices/machine/am9513.h
@@ -39,17 +39,17 @@
//**************************************************************************
#define MCFG_AM9513_OUT1_CALLBACK(_devcb) \
- devcb = &downcast<am9513_device &>(*device).set_out_cb(0, DEVCB_##_devcb);
+ downcast<am9513_device &>(*device).set_out_cb(0, DEVCB_##_devcb);
#define MCFG_AM9513_OUT2_CALLBACK(_devcb) \
- devcb = &downcast<am9513_device &>(*device).set_out_cb(1, DEVCB_##_devcb);
+ downcast<am9513_device &>(*device).set_out_cb(1, DEVCB_##_devcb);
#define MCFG_AM9513_OUT3_CALLBACK(_devcb) \
- devcb = &downcast<am9513_device &>(*device).set_out_cb(2, DEVCB_##_devcb);
+ downcast<am9513_device &>(*device).set_out_cb(2, DEVCB_##_devcb);
#define MCFG_AM9513_OUT4_CALLBACK(_devcb) \
- devcb = &downcast<am9513_device &>(*device).set_out_cb(3, DEVCB_##_devcb);
+ downcast<am9513_device &>(*device).set_out_cb(3, DEVCB_##_devcb);
#define MCFG_AM9513_OUT5_CALLBACK(_devcb) \
- devcb = &downcast<am9513_device &>(*device).set_out_cb(4, DEVCB_##_devcb);
+ downcast<am9513_device &>(*device).set_out_cb(4, DEVCB_##_devcb);
#define MCFG_AM9513_FOUT_CALLBACK(_devcb) \
- devcb = &downcast<am9513_device &>(*device).set_fout_cb(DEVCB_##_devcb);
+ downcast<am9513_device &>(*device).set_fout_cb(DEVCB_##_devcb);
@@ -68,6 +68,12 @@ public:
// static configuration
template<class Object> devcb_base &set_out_cb(int c, Object &&cb) { assert(c >= 0 && c < 5); return m_out_cb[c].set_callback(std::forward<Object>(cb)); }
template<class Object> devcb_base &set_fout_cb(Object &&cb) { return m_fout_cb.set_callback(std::forward<Object>(cb)); }
+ auto out1_cb() { return m_out_cb[0].bind(); }
+ auto out2_cb() { return m_out_cb[1].bind(); }
+ auto out3_cb() { return m_out_cb[2].bind(); }
+ auto out4_cb() { return m_out_cb[3].bind(); }
+ auto out5_cb() { return m_out_cb[4].bind(); }
+ auto fout_cb() { return m_fout_cb.bind(); }
// 8-bit data bus interface
DECLARE_READ8_MEMBER(read8);
diff --git a/src/devices/machine/am9517a.h b/src/devices/machine/am9517a.h
index 8527dfaa42f..dd262cec356 100644
--- a/src/devices/machine/am9517a.h
+++ b/src/devices/machine/am9517a.h
@@ -53,13 +53,20 @@ public:
template <class Object> devcb_base &set_out_hreq_callback(Object &&cb) { return m_out_hreq_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_out_eop_callback(Object &&cb) { return m_out_eop_cb.set_callback(std::forward<Object>(cb)); }
+ auto out_hreq_callback() { return m_out_hreq_cb.bind(); }
+ auto out_eop_callback() { return m_out_eop_cb.bind(); }
template <class Object> devcb_base &set_in_memr_callback(Object &&cb) { return m_in_memr_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_out_memw_callback(Object &&cb) { return m_out_memw_cb.set_callback(std::forward<Object>(cb)); }
+ auto in_memr_callback() { return m_in_memr_cb.bind(); }
+ auto out_memw_callback() { return m_out_memw_cb.bind(); }
template <unsigned C, class Object> devcb_base &set_in_ior_callback(Object &&cb) { return m_in_ior_cb[C].set_callback(std::forward<Object>(cb)); }
template <unsigned C, class Object> devcb_base &set_out_iow_callback(Object &&cb) { return m_out_iow_cb[C].set_callback(std::forward<Object>(cb)); }
template <unsigned C, class Object> devcb_base &set_out_dack_callback(Object &&cb) { return m_out_dack_cb[C].set_callback(std::forward<Object>(cb)); }
+ template <unsigned C> auto in_ior_callback() { return m_in_ior_cb[C].bind(); }
+ template <unsigned C> auto out_iow_callback() { return m_out_iow_cb[C].bind(); }
+ template <unsigned C> auto out_dack_callback() { return m_out_dack_cb[C].bind(); }
virtual DECLARE_READ8_MEMBER( read );
virtual DECLARE_WRITE8_MEMBER( write );
@@ -179,52 +186,52 @@ DECLARE_DEVICE_TYPE(PCXPORT_DMAC, pcxport_dmac_device)
***************************************************************************/
#define MCFG_AM9517A_OUT_HREQ_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_out_hreq_callback(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_out_hreq_callback(DEVCB_##_devcb);
#define MCFG_AM9517A_OUT_EOP_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_out_eop_callback(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_out_eop_callback(DEVCB_##_devcb);
#define MCFG_AM9517A_IN_MEMR_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_in_memr_callback(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_in_memr_callback(DEVCB_##_devcb);
#define MCFG_AM9517A_OUT_MEMW_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_out_memw_callback(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_out_memw_callback(DEVCB_##_devcb);
#define MCFG_AM9517A_IN_IOR_0_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_in_ior_callback<0>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_in_ior_callback<0>(DEVCB_##_devcb);
#define MCFG_AM9517A_IN_IOR_1_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_in_ior_callback<1>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_in_ior_callback<1>(DEVCB_##_devcb);
#define MCFG_AM9517A_IN_IOR_2_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_in_ior_callback<2>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_in_ior_callback<2>(DEVCB_##_devcb);
#define MCFG_AM9517A_IN_IOR_3_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_in_ior_callback<3>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_in_ior_callback<3>(DEVCB_##_devcb);
#define MCFG_AM9517A_OUT_IOW_0_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_out_iow_callback<0>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_out_iow_callback<0>(DEVCB_##_devcb);
#define MCFG_AM9517A_OUT_IOW_1_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_out_iow_callback<1>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_out_iow_callback<1>(DEVCB_##_devcb);
#define MCFG_AM9517A_OUT_IOW_2_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_out_iow_callback<2>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_out_iow_callback<2>(DEVCB_##_devcb);
#define MCFG_AM9517A_OUT_IOW_3_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_out_iow_callback<3>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_out_iow_callback<3>(DEVCB_##_devcb);
#define MCFG_AM9517A_OUT_DACK_0_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_out_dack_callback<0>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_out_dack_callback<0>(DEVCB_##_devcb);
#define MCFG_AM9517A_OUT_DACK_1_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_out_dack_callback<1>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_out_dack_callback<1>(DEVCB_##_devcb);
#define MCFG_AM9517A_OUT_DACK_2_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_out_dack_callback<2>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_out_dack_callback<2>(DEVCB_##_devcb);
#define MCFG_AM9517A_OUT_DACK_3_CB(_devcb) \
- devcb = &downcast<am9517a_device &>(*device).set_out_dack_callback<3>(DEVCB_##_devcb);
+ downcast<am9517a_device &>(*device).set_out_dack_callback<3>(DEVCB_##_devcb);
#define MCFG_I8237_OUT_HREQ_CB MCFG_AM9517A_OUT_HREQ_CB
#define MCFG_I8237_OUT_EOP_CB MCFG_AM9517A_OUT_EOP_CB
diff --git a/src/devices/machine/am9519.h b/src/devices/machine/am9519.h
index 27ac1e9a46e..cae08467b40 100644
--- a/src/devices/machine/am9519.h
+++ b/src/devices/machine/am9519.h
@@ -33,7 +33,7 @@
***************************************************************************/
#define MCFG_AM9519_OUT_INT_CB(_devcb) \
- devcb = &downcast<am9519_device &>(*device).static_set_out_int_callback(DEVCB_##_devcb);
+ downcast<am9519_device &>(*device).static_set_out_int_callback(DEVCB_##_devcb);
class am9519_device : public device_t
diff --git a/src/devices/machine/amigafdc.h b/src/devices/machine/amigafdc.h
index e95e1ed0137..1cd55ca1d18 100644
--- a/src/devices/machine/amigafdc.h
+++ b/src/devices/machine/amigafdc.h
@@ -8,19 +8,19 @@
#include "imagedev/floppy.h"
#define MCFG_AMIGA_FDC_INDEX_CALLBACK(_write) \
- devcb = &downcast<amiga_fdc_device &>(*device).set_index_wr_callback(DEVCB_##_write);
+ downcast<amiga_fdc_device &>(*device).set_index_wr_callback(DEVCB_##_write);
#define MCFG_AMIGA_FDC_READ_DMA_CALLBACK(_read) \
- devcb = &downcast<amiga_fdc_device &>(*device).set_dma_rd_callback(DEVCB_##_read);
+ downcast<amiga_fdc_device &>(*device).set_dma_rd_callback(DEVCB_##_read);
#define MCFG_AMIGA_FDC_WRITE_DMA_CALLBACK(_write) \
- devcb = &downcast<amiga_fdc_device &>(*device).set_dma_wr_callback(DEVCB_##_write);
+ downcast<amiga_fdc_device &>(*device).set_dma_wr_callback(DEVCB_##_write);
#define MCFG_AMIGA_FDC_DSKBLK_CALLBACK(_write) \
- devcb = &downcast<amiga_fdc_device &>(*device).set_dskblk_wr_callback(DEVCB_##_write);
+ downcast<amiga_fdc_device &>(*device).set_dskblk_wr_callback(DEVCB_##_write);
#define MCFG_AMIGA_FDC_DSKSYN_CALLBACK(_write) \
- devcb = &downcast<amiga_fdc_device &>(*device).set_dsksyn_wr_callback(DEVCB_##_write);
+ downcast<amiga_fdc_device &>(*device).set_dsksyn_wr_callback(DEVCB_##_write);
class amiga_fdc_device : public device_t {
public:
diff --git a/src/devices/machine/at45dbxx.h b/src/devices/machine/at45dbxx.h
index f215a22c7fe..c0df28a49f4 100644
--- a/src/devices/machine/at45dbxx.h
+++ b/src/devices/machine/at45dbxx.h
@@ -32,7 +32,7 @@
MCFG_DEVICE_ADD(_tag, AT45DB161, 0)
#define MCFG_AT45DBXXX_SO_CALLBACK(_cb) \
- devcb = &downcast<at45db041_device &>(*device).set_so_cb(DEVCB_##_cb);
+ downcast<at45db041_device &>(*device).set_so_cb(DEVCB_##_cb);
// ======================> at45db041_device
diff --git a/src/devices/machine/at_keybc.h b/src/devices/machine/at_keybc.h
index b32a85286d1..a80887d2918 100644
--- a/src/devices/machine/at_keybc.h
+++ b/src/devices/machine/at_keybc.h
@@ -19,22 +19,22 @@
//**************************************************************************
#define MCFG_AT_KEYBOARD_CONTROLLER_SYSTEM_RESET_CB(_devcb) \
- devcb = &downcast<at_keyboard_controller_device &>(*device).set_system_reset_callback(DEVCB_##_devcb);
+ downcast<at_keyboard_controller_device &>(*device).set_system_reset_callback(DEVCB_##_devcb);
#define MCFG_AT_KEYBOARD_CONTROLLER_GATE_A20_CB(_devcb) \
- devcb = &downcast<at_keyboard_controller_device &>(*device).set_gate_a20_callback(DEVCB_##_devcb);
+ downcast<at_keyboard_controller_device &>(*device).set_gate_a20_callback(DEVCB_##_devcb);
#define MCFG_AT_KEYBOARD_CONTROLLER_INPUT_BUFFER_FULL_CB(_devcb) \
- devcb = &downcast<at_keyboard_controller_device &>(*device).set_input_buffer_full_callback(DEVCB_##_devcb);
+ downcast<at_keyboard_controller_device &>(*device).set_input_buffer_full_callback(DEVCB_##_devcb);
#define MCFG_AT_KEYBOARD_CONTROLLER_OUTPUT_BUFFER_EMPTY_CB(_devcb) \
- devcb = &downcast<at_keyboard_controller_device &>(*device).set_output_buffer_empty_callback(DEVCB_##_devcb);
+ downcast<at_keyboard_controller_device &>(*device).set_output_buffer_empty_callback(DEVCB_##_devcb);
#define MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_CLOCK_CB(_devcb) \
- devcb = &downcast<at_keyboard_controller_device &>(*device).set_keyboard_clock_callback(DEVCB_##_devcb);
+ downcast<at_keyboard_controller_device &>(*device).set_keyboard_clock_callback(DEVCB_##_devcb);
#define MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_DATA_CB(_devcb) \
- devcb = &downcast<at_keyboard_controller_device &>(*device).set_keyboard_data_callback(DEVCB_##_devcb);
+ downcast<at_keyboard_controller_device &>(*device).set_keyboard_data_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/ataintf.h b/src/devices/machine/ataintf.h
index 202803e70e8..cd11d90180c 100644
--- a/src/devices/machine/ataintf.h
+++ b/src/devices/machine/ataintf.h
@@ -47,13 +47,13 @@ DECLARE_DEVICE_TYPE(ATA_SLOT, ata_slot_device)
***************************************************************************/
#define MCFG_ATA_INTERFACE_IRQ_HANDLER(_devcb) \
- devcb = &downcast<abstract_ata_interface_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<abstract_ata_interface_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_ATA_INTERFACE_DMARQ_HANDLER(_devcb) \
- devcb = &downcast<abstract_ata_interface_device &>(*device).set_dmarq_handler(DEVCB_##_devcb);
+ downcast<abstract_ata_interface_device &>(*device).set_dmarq_handler(DEVCB_##_devcb);
#define MCFG_ATA_INTERFACE_DASP_HANDLER(_devcb) \
- devcb = &downcast<abstract_ata_interface_device &>(*device).set_dasp_handler(DEVCB_##_devcb);
+ downcast<abstract_ata_interface_device &>(*device).set_dasp_handler(DEVCB_##_devcb);
void ata_devices(device_slot_interface &device);
diff --git a/src/devices/machine/atmel_arm_aic.h b/src/devices/machine/atmel_arm_aic.h
index db30986bb2d..b91c1b2598f 100644
--- a/src/devices/machine/atmel_arm_aic.h
+++ b/src/devices/machine/atmel_arm_aic.h
@@ -12,7 +12,7 @@ DECLARE_DEVICE_TYPE(ARM_AIC, arm_aic_device)
MCFG_DEVICE_ADD(_tag, ARM_AIC, 0)
#define MCFG_IRQ_LINE_CB(_devcb) \
- devcb = &downcast<arm_aic_device &>(*device).set_line_callback(DEVCB_##_devcb);
+ downcast<arm_aic_device &>(*device).set_line_callback(DEVCB_##_devcb);
class arm_aic_device : public device_t
{
diff --git a/src/devices/machine/ay31015.h b/src/devices/machine/ay31015.h
index 85206d673c3..35169536e31 100644
--- a/src/devices/machine/ay31015.h
+++ b/src/devices/machine/ay31015.h
@@ -33,6 +33,14 @@ public:
template <class Object> devcb_base &set_write_dav_callback(Object &&cb) { return m_write_dav_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_write_tbmt_callback(Object &&cb) { return m_write_tbmt_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_write_eoc_callback(Object &&cb) { return m_write_eoc_cb.set_callback(std::forward<Object>(cb)); }
+ auto read_si_callback() { return m_read_si_cb.bind(); }
+ auto write_so_callback() { return m_write_so_cb.bind(); }
+ auto write_pe_callback() { return m_write_pe_cb.bind(); }
+ auto write_fe_callback() { return m_write_fe_cb.bind(); }
+ auto write_or_callback() { return m_write_or_cb.bind(); }
+ auto write_dav_callback() { return m_write_dav_cb.bind(); }
+ auto write_tbmt_callback() { return m_write_tbmt_cb.bind(); }
+ auto write_eoc_callback() { return m_write_eoc_cb.bind(); }
/* Set an input pin */
DECLARE_WRITE_LINE_MEMBER(write_swe) { set_input_pin(SWE, state); }
@@ -208,28 +216,28 @@ DECLARE_DEVICE_TYPE(AY51013, ay51013_device) // For AY-3-1014, AY-5-1013 and A
downcast<ay31015_device &>(*device).set_auto_rdav(_auto_rdav);
#define MCFG_AY31015_READ_SI_CB(_devcb) \
- devcb = &downcast<ay31015_device &>(*device).set_read_si_callback(DEVCB_##_devcb);
+ downcast<ay31015_device &>(*device).set_read_si_callback(DEVCB_##_devcb);
#define MCFG_AY31015_WRITE_SO_CB(_devcb) \
- devcb = &downcast<ay31015_device &>(*device).set_write_so_callback(DEVCB_##_devcb);
+ downcast<ay31015_device &>(*device).set_write_so_callback(DEVCB_##_devcb);
#define MCFG_AY31015_WRITE_PE_CB(_devcb) \
- devcb = &downcast<ay31015_device &>(*device).set_write_pe_callback(DEVCB_##_devcb);
+ downcast<ay31015_device &>(*device).set_write_pe_callback(DEVCB_##_devcb);
#define MCFG_AY31015_WRITE_FE_CB(_devcb) \
- devcb = &downcast<ay31015_device &>(*device).set_write_fe_callback(DEVCB_##_devcb);
+ downcast<ay31015_device &>(*device).set_write_fe_callback(DEVCB_##_devcb);
#define MCFG_AY31015_WRITE_OR_CB(_devcb) \
- devcb = &downcast<ay31015_device &>(*device).set_write_or_callback(DEVCB_##_devcb);
+ downcast<ay31015_device &>(*device).set_write_or_callback(DEVCB_##_devcb);
#define MCFG_AY31015_WRITE_DAV_CB(_devcb) \
- devcb = &downcast<ay31015_device &>(*device).set_write_dav_callback(DEVCB_##_devcb);
+ downcast<ay31015_device &>(*device).set_write_dav_callback(DEVCB_##_devcb);
#define MCFG_AY31015_WRITE_TBMT_CB(_devcb) \
- devcb = &downcast<ay31015_device &>(*device).set_write_tbmt_callback(DEVCB_##_devcb);
+ downcast<ay31015_device &>(*device).set_write_tbmt_callback(DEVCB_##_devcb);
#define MCFG_AY31015_WRITE_EOC_CB(_devcb) \
- devcb = &downcast<ay31015_device &>(*device).set_write_eoc_callback(DEVCB_##_devcb);
+ downcast<ay31015_device &>(*device).set_write_eoc_callback(DEVCB_##_devcb);
#define MCFG_AY51013_TX_CLOCK(_txclk) \
@@ -242,27 +250,27 @@ DECLARE_DEVICE_TYPE(AY51013, ay51013_device) // For AY-3-1014, AY-5-1013 and A
downcast<ay51013_device &>(*device).set_auto_rdav(_auto_rdav);
#define MCFG_AY51013_READ_SI_CB(_devcb) \
- devcb = &downcast<ay51013_device &>(*device).set_read_si_callback(DEVCB_##_devcb);
+ downcast<ay51013_device &>(*device).set_read_si_callback(DEVCB_##_devcb);
#define MCFG_AY51013_WRITE_SO_CB(_devcb) \
- devcb = &downcast<ay51013_device &>(*device).set_write_so_callback(DEVCB_##_devcb);
+ downcast<ay51013_device &>(*device).set_write_so_callback(DEVCB_##_devcb);
#define MCFG_AY51013_WRITE_PE_CB(_devcb) \
- devcb = &downcast<ay51013_device &>(*device).set_write_pe_callback(DEVCB_##_devcb);
+ downcast<ay51013_device &>(*device).set_write_pe_callback(DEVCB_##_devcb);
#define MCFG_AY51013_WRITE_FE_CB(_devcb) \
- devcb = &downcast<ay51013_device &>(*device).set_write_fe_callback(DEVCB_##_devcb);
+ downcast<ay51013_device &>(*device).set_write_fe_callback(DEVCB_##_devcb);
#define MCFG_AY51013_WRITE_OR_CB(_devcb) \
- devcb = &downcast<ay51013_device &>(*device).set_write_or_callback(DEVCB_##_devcb);
+ downcast<ay51013_device &>(*device).set_write_or_callback(DEVCB_##_devcb);
#define MCFG_AY51013_WRITE_DAV_CB(_devcb) \
- devcb = &downcast<ay51013_device &>(*device).set_write_dav_callback(DEVCB_##_devcb);
+ downcast<ay51013_device &>(*device).set_write_dav_callback(DEVCB_##_devcb);
#define MCFG_AY51013_WRITE_TBMT_CB(_devcb) \
- devcb = &downcast<ay51013_device &>(*device).set_write_tbmt_callback(DEVCB_##_devcb);
+ downcast<ay51013_device &>(*device).set_write_tbmt_callback(DEVCB_##_devcb);
#define MCFG_AY51013_WRITE_EOC_CB(_devcb) \
- devcb = &downcast<ay51013_device &>(*device).set_write_eoc_callback(DEVCB_##_devcb);
+ downcast<ay51013_device &>(*device).set_write_eoc_callback(DEVCB_##_devcb);
#endif // MAME_MACHINE_AY31015_H
diff --git a/src/devices/machine/busmouse.h b/src/devices/machine/busmouse.h
index 07860904e89..b0e4a23370c 100644
--- a/src/devices/machine/busmouse.h
+++ b/src/devices/machine/busmouse.h
@@ -17,7 +17,7 @@
//**************************************************************************
#define MCFG_BUS_MOUSE_EXTINT_CALLBACK(_write) \
- devcb = &bus_mouse_device::set_extint_wr_callback(*device, DEVCB_##_write);
+ bus_mouse_device::set_extint_wr_callback(*device, DEVCB_##_write);
//**************************************************************************
diff --git a/src/devices/machine/cdp1852.h b/src/devices/machine/cdp1852.h
index 70562f85e7e..ed22bfccaff 100644
--- a/src/devices/machine/cdp1852.h
+++ b/src/devices/machine/cdp1852.h
@@ -34,16 +34,16 @@
//**************************************************************************
#define MCFG_CDP1852_MODE_CALLBACK(_read) \
- devcb = &downcast<cdp1852_device &>(*device).set_mode_rd_callback(DEVCB_##_read);
+ downcast<cdp1852_device &>(*device).set_mode_rd_callback(DEVCB_##_read);
#define MCFG_CDP1852_SR_CALLBACK(_write) \
- devcb = &downcast<cdp1852_device &>(*device).set_sr_wr_callback(DEVCB_##_write);
+ downcast<cdp1852_device &>(*device).set_sr_wr_callback(DEVCB_##_write);
#define MCFG_CDP1852_DI_CALLBACK(_read) \
- devcb = &downcast<cdp1852_device &>(*device).set_data_rd_callback(DEVCB_##_read);
+ downcast<cdp1852_device &>(*device).set_data_rd_callback(DEVCB_##_read);
#define MCFG_CDP1852_DO_CALLBACK(_write) \
- devcb = &downcast<cdp1852_device &>(*device).set_data_wr_callback(DEVCB_##_write);
+ downcast<cdp1852_device &>(*device).set_data_wr_callback(DEVCB_##_write);
diff --git a/src/devices/machine/cdp1871.h b/src/devices/machine/cdp1871.h
index 74ce06d4b9a..31215164a6f 100644
--- a/src/devices/machine/cdp1871.h
+++ b/src/devices/machine/cdp1871.h
@@ -42,43 +42,43 @@
//**************************************************************************
#define MCFG_CDP1871_D1_CALLBACK(_read) \
- devcb = &downcast<cdp1871_device &>(*device).set_d1_rd_callback(DEVCB_##_read);
+ downcast<cdp1871_device &>(*device).set_d1_rd_callback(DEVCB_##_read);
#define MCFG_CDP1871_D2_CALLBACK(_read) \
- devcb = &downcast<cdp1871_device &>(*device).set_d2_rd_callback(DEVCB_##_read);
+ downcast<cdp1871_device &>(*device).set_d2_rd_callback(DEVCB_##_read);
#define MCFG_CDP1871_D3_CALLBACK(_read) \
- devcb = &downcast<cdp1871_device &>(*device).set_d3_rd_callback(DEVCB_##_read);
+ downcast<cdp1871_device &>(*device).set_d3_rd_callback(DEVCB_##_read);
#define MCFG_CDP1871_D4_CALLBACK(_read) \
- devcb = &downcast<cdp1871_device &>(*device).set_d4_rd_callback(DEVCB_##_read);
+ downcast<cdp1871_device &>(*device).set_d4_rd_callback(DEVCB_##_read);
#define MCFG_CDP1871_D5_CALLBACK(_read) \
- devcb = &downcast<cdp1871_device &>(*device).set_d5_rd_callback(DEVCB_##_read);
+ downcast<cdp1871_device &>(*device).set_d5_rd_callback(DEVCB_##_read);
#define MCFG_CDP1871_D6_CALLBACK(_read) \
- devcb = &downcast<cdp1871_device &>(*device).set_d6_rd_callback(DEVCB_##_read);
+ downcast<cdp1871_device &>(*device).set_d6_rd_callback(DEVCB_##_read);
#define MCFG_CDP1871_D7_CALLBACK(_read) \
- devcb = &downcast<cdp1871_device &>(*device).set_d7_rd_callback(DEVCB_##_read);
+ downcast<cdp1871_device &>(*device).set_d7_rd_callback(DEVCB_##_read);
#define MCFG_CDP1871_D8_CALLBACK(_read) \
- devcb = &downcast<cdp1871_device &>(*device).set_d8_rd_callback(DEVCB_##_read);
+ downcast<cdp1871_device &>(*device).set_d8_rd_callback(DEVCB_##_read);
#define MCFG_CDP1871_D9_CALLBACK(_read) \
- devcb = &downcast<cdp1871_device &>(*device).set_d9_rd_callback(DEVCB_##_read);
+ downcast<cdp1871_device &>(*device).set_d9_rd_callback(DEVCB_##_read);
#define MCFG_CDP1871_D10_CALLBACK(_read) \
- devcb = &downcast<cdp1871_device &>(*device).set_d10_rd_callback(DEVCB_##_read);
+ downcast<cdp1871_device &>(*device).set_d10_rd_callback(DEVCB_##_read);
#define MCFG_CDP1871_D11_CALLBACK(_read) \
- devcb = &downcast<cdp1871_device &>(*device).set_d11_rd_callback(DEVCB_##_read);
+ downcast<cdp1871_device &>(*device).set_d11_rd_callback(DEVCB_##_read);
#define MCFG_CDP1871_DA_CALLBACK(_write) \
- devcb = &downcast<cdp1871_device &>(*device).set_da_wr_callback(DEVCB_##_write);
+ downcast<cdp1871_device &>(*device).set_da_wr_callback(DEVCB_##_write);
#define MCFG_CDP1871_RPT_CALLBACK(_write) \
- devcb = &downcast<cdp1871_device &>(*device).set_rpt_wr_callback(DEVCB_##_write);
+ downcast<cdp1871_device &>(*device).set_rpt_wr_callback(DEVCB_##_write);
diff --git a/src/devices/machine/cdp1879.h b/src/devices/machine/cdp1879.h
index 6a3a1faaa36..4563fe7376a 100644
--- a/src/devices/machine/cdp1879.h
+++ b/src/devices/machine/cdp1879.h
@@ -19,7 +19,7 @@
//**************************************************************************
#define MCFG_CDP1879_IRQ_CALLBACK(_cb) \
- devcb = &downcast<cdp1879_device &>(*device).set_irq_cb(DEVCB_##_cb);
+ downcast<cdp1879_device &>(*device).set_irq_cb(DEVCB_##_cb);
//**************************************************************************
diff --git a/src/devices/machine/clock.h b/src/devices/machine/clock.h
index dc87e7a4f60..dbe6cd00bd9 100644
--- a/src/devices/machine/clock.h
+++ b/src/devices/machine/clock.h
@@ -10,14 +10,15 @@
MCFG_DEVICE_ADD(_tag, CLOCK, _clock)
#define MCFG_CLOCK_SIGNAL_HANDLER(_devcb) \
- devcb = &downcast<clock_device &>(*device).set_signal_handler(DEVCB_##_devcb);
+ downcast<clock_device &>(*device).set_signal_handler(DEVCB_##_devcb);
class clock_device : public device_t
{
public:
- clock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
template <class Object> devcb_base &set_signal_handler(Object &&cb) { return m_signal_handler.set_callback(std::forward<Object>(cb)); }
+ auto signal_handler() { return m_signal_handler.bind(); }
+
+ clock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
virtual void device_start() override;
diff --git a/src/devices/machine/com8116.h b/src/devices/machine/com8116.h
index 44b78920925..1981571fa5c 100644
--- a/src/devices/machine/com8116.h
+++ b/src/devices/machine/com8116.h
@@ -34,13 +34,13 @@
///*************************************************************************
#define MCFG_COM8116_FX4_HANDLER(_devcb) \
- devcb = &downcast<com8116_device &>(*device).set_fx4_handler(DEVCB_##_devcb);
+ downcast<com8116_device &>(*device).set_fx4_handler(DEVCB_##_devcb);
#define MCFG_COM8116_FR_HANDLER(_devcb) \
- devcb = &downcast<com8116_device &>(*device).set_fr_handler(DEVCB_##_devcb);
+ downcast<com8116_device &>(*device).set_fr_handler(DEVCB_##_devcb);
#define MCFG_COM8116_FT_HANDLER(_devcb) \
- devcb = &downcast<com8116_device &>(*device).set_ft_handler(DEVCB_##_devcb);
+ downcast<com8116_device &>(*device).set_ft_handler(DEVCB_##_devcb);
///*************************************************************************
@@ -58,6 +58,9 @@ public:
template <class Object> devcb_base &set_fx4_handler(Object &&cb) { return m_fx4_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_fr_handler(Object &&cb) { return m_fr_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_ft_handler(Object &&cb) { return m_ft_handler.set_callback(std::forward<Object>(cb)); }
+ auto fx4_handler() { return m_fx4_handler.bind(); }
+ auto fr_handler() { return m_fr_handler.bind(); }
+ auto ft_handler() { return m_ft_handler.bind(); }
void write_str(uint8_t data);
void write_stt(uint8_t data);
diff --git a/src/devices/machine/cr511b.h b/src/devices/machine/cr511b.h
index d305880a87c..e75eb84d4da 100644
--- a/src/devices/machine/cr511b.h
+++ b/src/devices/machine/cr511b.h
@@ -46,22 +46,22 @@
#define MCFG_CR511B_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, CR511B, 0)
#define MCFG_CR511B_STCH_HANDLER(_devcb) \
- devcb = &downcast<cr511b_device &>(*device).set_stch_handler(DEVCB_##_devcb);
+ downcast<cr511b_device &>(*device).set_stch_handler(DEVCB_##_devcb);
#define MCFG_CR511B_STEN_HANDLER(_devcb) \
- devcb = &downcast<cr511b_device &>(*device).set_sten_handler(DEVCB_##_devcb);
+ downcast<cr511b_device &>(*device).set_sten_handler(DEVCB_##_devcb);
#define MCFG_CR511B_DRQ_HANDLER(_devcb) \
- devcb = &downcast<cr511b_device &>(*device).set_drq_handler(DEVCB_##_devcb);
+ downcast<cr511b_device &>(*device).set_drq_handler(DEVCB_##_devcb);
#define MCFG_CR511B_DTEN_HANDLER(_devcb) \
- devcb = &downcast<cr511b_device &>(*device).set_dten_handler(DEVCB_##_devcb);
+ downcast<cr511b_device &>(*device).set_dten_handler(DEVCB_##_devcb);
#define MCFG_CR511B_SCOR_HANDLER(_devcb) \
- devcb = &downcast<cr511b_device &>(*device).set_scor_handler(DEVCB_##_devcb);
+ downcast<cr511b_device &>(*device).set_scor_handler(DEVCB_##_devcb);
#define MCFG_CR511B_XAEN_HANDLER(_devcb) \
- devcb = &downcast<cr511b_device &>(*device).set_xaen_handler(DEVCB_##_devcb);
+ downcast<cr511b_device &>(*device).set_xaen_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -83,6 +83,12 @@ public:
template <class Object> devcb_base &set_dten_handler(Object &&cb) { return m_dten_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_scor_handler(Object &&cb) { return m_scor_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_xaen_handler(Object &&cb) { return m_xaen_handler.set_callback(std::forward<Object>(cb)); }
+ auto stch_handler() { return m_stch_handler.bind(); }
+ auto sten_handler() { return m_sten_handler.bind(); }
+ auto drq_handler() { return m_drq_handler.bind(); }
+ auto dten_handler() { return m_dten_handler.bind(); }
+ auto scor_handler() { return m_scor_handler.bind(); }
+ auto xaen_handler() { return m_xaen_handler.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER ( write );
diff --git a/src/devices/machine/cs4031.cpp b/src/devices/machine/cs4031.cpp
index b6d66bfea25..371cf24270d 100644
--- a/src/devices/machine/cs4031.cpp
+++ b/src/devices/machine/cs4031.cpp
@@ -131,12 +131,12 @@ MACHINE_CONFIG_START(cs4031_device::device_add_mconfig)
MCFG_DEVICE_ADD("intc1", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE(*this, cs4031_device, intc1_int_w))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, cs4031_device, intc1_slave_ack_r))
MCFG_DEVICE_ADD("intc2", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("intc1", pic8259_device, ir2_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("ctc", PIT8254, 0)
MCFG_PIT8253_CLK0(XTAL(14'318'181) / 12.0)
diff --git a/src/devices/machine/cs4031.h b/src/devices/machine/cs4031.h
index 9b1f209b9b6..c03a1cc0e43 100644
--- a/src/devices/machine/cs4031.h
+++ b/src/devices/machine/cs4031.h
@@ -44,31 +44,31 @@
downcast<cs4031_device &>(*device).set_keybctag(_keybctag);
#define MCFG_CS4031_IOR(_ior) \
- devcb = &downcast<cs4031_device *>(device)->set_ior_callback(DEVCB_##_ior);
+ downcast<cs4031_device *>(device)->set_ior_callback(DEVCB_##_ior);
#define MCFG_CS4031_IOW(_iow) \
- devcb = &downcast<cs4031_device *>(device)->set_iow_callback(DEVCB_##_iow);
+ downcast<cs4031_device *>(device)->set_iow_callback(DEVCB_##_iow);
#define MCFG_CS4031_TC(_tc) \
- devcb = &downcast<cs4031_device *>(device)->set_tc_callback(DEVCB_##_tc);
+ downcast<cs4031_device *>(device)->set_tc_callback(DEVCB_##_tc);
#define MCFG_CS4031_HOLD(_hold) \
- devcb = &downcast<cs4031_device *>(device)->set_hold_callback(DEVCB_##_hold);
+ downcast<cs4031_device *>(device)->set_hold_callback(DEVCB_##_hold);
#define MCFG_CS4031_NMI(_nmi) \
- devcb = &downcast<cs4031_device *>(device)->set_nmi_callback(DEVCB_##_nmi);
+ downcast<cs4031_device *>(device)->set_nmi_callback(DEVCB_##_nmi);
#define MCFG_CS4031_INTR(_intr) \
- devcb = &downcast<cs4031_device *>(device)->set_intr_callback(DEVCB_##_intr);
+ downcast<cs4031_device *>(device)->set_intr_callback(DEVCB_##_intr);
#define MCFG_CS4031_CPURESET(_cpureset) \
- devcb = &downcast<cs4031_device *>(device)->set_cpureset_callback(DEVCB_##_cpureset);
+ downcast<cs4031_device *>(device)->set_cpureset_callback(DEVCB_##_cpureset);
#define MCFG_CS4031_A20M(_a20m) \
- devcb = &downcast<cs4031_device *>(device)->set_a20m_callback(DEVCB_##_a20m);
+ downcast<cs4031_device *>(device)->set_a20m_callback(DEVCB_##_a20m);
#define MCFG_CS4031_SPKR(_spkr) \
- devcb = &downcast<cs4031_device *>(device)->set_spkr_callback(DEVCB_##_spkr);
+ downcast<cs4031_device *>(device)->set_spkr_callback(DEVCB_##_spkr);
//**************************************************************************
diff --git a/src/devices/machine/cxd1095.h b/src/devices/machine/cxd1095.h
index 83b04b6b98e..86ecb58de65 100644
--- a/src/devices/machine/cxd1095.h
+++ b/src/devices/machine/cxd1095.h
@@ -49,26 +49,26 @@
//**************************************************************************
#define MCFG_CXD1095_IN_PORTA_CB(_devcb) \
- devcb = &downcast<cxd1095_device &>(*device).set_input_cb(0, DEVCB_##_devcb);
+ downcast<cxd1095_device &>(*device).set_input_cb(0, DEVCB_##_devcb);
#define MCFG_CXD1095_IN_PORTB_CB(_devcb) \
- devcb = &downcast<cxd1095_device &>(*device).set_input_cb(1, DEVCB_##_devcb);
+ downcast<cxd1095_device &>(*device).set_input_cb(1, DEVCB_##_devcb);
#define MCFG_CXD1095_IN_PORTC_CB(_devcb) \
- devcb = &downcast<cxd1095_device &>(*device).set_input_cb(2, DEVCB_##_devcb);
+ downcast<cxd1095_device &>(*device).set_input_cb(2, DEVCB_##_devcb);
#define MCFG_CXD1095_IN_PORTD_CB(_devcb) \
- devcb = &downcast<cxd1095_device &>(*device).set_input_cb(3, DEVCB_##_devcb);
+ downcast<cxd1095_device &>(*device).set_input_cb(3, DEVCB_##_devcb);
#define MCFG_CXD1095_IN_PORTE_CB(_devcb) \
- devcb = &downcast<cxd1095_device &>(*device).set_input_cb(4, DEVCB_##_devcb);
+ downcast<cxd1095_device &>(*device).set_input_cb(4, DEVCB_##_devcb);
#define MCFG_CXD1095_OUT_PORTA_CB(_devcb) \
- devcb = &downcast<cxd1095_device &>(*device).set_output_cb(0, DEVCB_##_devcb);
+ downcast<cxd1095_device &>(*device).set_output_cb(0, DEVCB_##_devcb);
#define MCFG_CXD1095_OUT_PORTB_CB(_devcb) \
- devcb = &downcast<cxd1095_device &>(*device).set_output_cb(1, DEVCB_##_devcb);
+ downcast<cxd1095_device &>(*device).set_output_cb(1, DEVCB_##_devcb);
#define MCFG_CXD1095_OUT_PORTC_CB(_devcb) \
- devcb = &downcast<cxd1095_device &>(*device).set_output_cb(2, DEVCB_##_devcb);
+ downcast<cxd1095_device &>(*device).set_output_cb(2, DEVCB_##_devcb);
#define MCFG_CXD1095_OUT_PORTD_CB(_devcb) \
- devcb = &downcast<cxd1095_device &>(*device).set_output_cb(3, DEVCB_##_devcb);
+ downcast<cxd1095_device &>(*device).set_output_cb(3, DEVCB_##_devcb);
#define MCFG_CXD1095_OUT_PORTE_CB(_devcb) \
- devcb = &downcast<cxd1095_device &>(*device).set_output_cb(4, DEVCB_##_devcb);
+ downcast<cxd1095_device &>(*device).set_output_cb(4, DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/dmac.h b/src/devices/machine/dmac.h
index 7fad643c69b..8c72c02d05d 100644
--- a/src/devices/machine/dmac.h
+++ b/src/devices/machine/dmac.h
@@ -23,25 +23,25 @@
#define MCFG_DMAC_ADD(_tag, _clock) \
MCFG_DEVICE_ADD(_tag, AMIGA_DMAC, _clock)
#define MCFG_DMAC_CFGOUT_HANDLER(_devcb) \
- devcb = &downcast<amiga_dmac_device &>(*device).set_cfgout_handler(DEVCB_##_devcb);
+ downcast<amiga_dmac_device &>(*device).set_cfgout_handler(DEVCB_##_devcb);
#define MCFG_DMAC_INT_HANDLER(_devcb) \
- devcb = &downcast<amiga_dmac_device &>(*device).set_int_handler(DEVCB_##_devcb);
+ downcast<amiga_dmac_device &>(*device).set_int_handler(DEVCB_##_devcb);
#define MCFG_DMAC_XDACK_HANDLER(_devcb) \
- devcb = &downcast<amiga_dmac_device &>(*device).set_xdack_handler(DEVCB_##_devcb);
+ downcast<amiga_dmac_device &>(*device).set_xdack_handler(DEVCB_##_devcb);
#define MCFG_DMAC_SCSI_READ_HANDLER(_devcb) \
- devcb = &downcast<amiga_dmac_device &>(*device).set_scsi_read_handler(DEVCB_##_devcb);
+ downcast<amiga_dmac_device &>(*device).set_scsi_read_handler(DEVCB_##_devcb);
#define MCFG_DMAC_SCSI_WRITE_HANDLER(_devcb) \
- devcb = &downcast<amiga_dmac_device &>(*device).set_scsi_write_handler(DEVCB_##_devcb);
+ downcast<amiga_dmac_device &>(*device).set_scsi_write_handler(DEVCB_##_devcb);
#define MCFG_DMAC_IO_READ_HANDLER(_devcb) \
- devcb = &downcast<amiga_dmac_device &>(*device).set_io_read_handler(DEVCB_##_devcb);
+ downcast<amiga_dmac_device &>(*device).set_io_read_handler(DEVCB_##_devcb);
#define MCFG_DMAC_IO_WRITE_HANDLER(_devcb) \
- devcb = &downcast<amiga_dmac_device &>(*device).set_io_write_handler(DEVCB_##_devcb);
+ downcast<amiga_dmac_device &>(*device).set_io_write_handler(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/dp8390.h b/src/devices/machine/dp8390.h
index da1bf993833..74b57f027d1 100644
--- a/src/devices/machine/dp8390.h
+++ b/src/devices/machine/dp8390.h
@@ -9,28 +9,28 @@
// device stuff
#define MCFG_DP8390D_IRQ_CB(_devcb) \
- devcb = &downcast<dp8390_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<dp8390_device &>(*device).set_irq_callback(DEVCB_##_devcb);
#define MCFG_DP8390D_BREQ_CB(_devcb) \
- devcb = &downcast<dp8390_device &>(*device).set_breq_callback(DEVCB_##_devcb);
+ downcast<dp8390_device &>(*device).set_breq_callback(DEVCB_##_devcb);
#define MCFG_DP8390D_MEM_READ_CB(_devcb) \
- devcb = &downcast<dp8390_device &>(*device).set_mem_read_callback(DEVCB_##_devcb);
+ downcast<dp8390_device &>(*device).set_mem_read_callback(DEVCB_##_devcb);
#define MCFG_DP8390D_MEM_WRITE_CB(_devcb) \
- devcb = &downcast<dp8390_device &>(*device).set_mem_write_callback(DEVCB_##_devcb);
+ downcast<dp8390_device &>(*device).set_mem_write_callback(DEVCB_##_devcb);
#define MCFG_RTL8019A_IRQ_CB(_devcb) \
- devcb = &downcast<rtl8019a_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<rtl8019a_device &>(*device).set_irq_callback(DEVCB_##_devcb);
#define MCFG_RTL8019A_BREQ_CB(_devcb) \
- devcb = &downcast<rtl8019a_device &>(*device).set_breq_callback(DEVCB_##_devcb);
+ downcast<rtl8019a_device &>(*device).set_breq_callback(DEVCB_##_devcb);
#define MCFG_RTL8019A_MEM_READ_CB(_devcb) \
- devcb = &downcast<rtl8019a_device &>(*device).set_mem_read_callback(DEVCB_##_devcb);
+ downcast<rtl8019a_device &>(*device).set_mem_read_callback(DEVCB_##_devcb);
#define MCFG_RTL8019A_MEM_WRITE_CB(_devcb) \
- devcb = &downcast<rtl8019a_device &>(*device).set_mem_write_callback(DEVCB_##_devcb);
+ downcast<rtl8019a_device &>(*device).set_mem_write_callback(DEVCB_##_devcb);
class dp8390_device : public device_t, public device_network_interface
diff --git a/src/devices/machine/ds1315.h b/src/devices/machine/ds1315.h
index b1f8b11b399..21a7f37c14f 100644
--- a/src/devices/machine/ds1315.h
+++ b/src/devices/machine/ds1315.h
@@ -23,7 +23,7 @@
MCFG_DEVICE_ADD(_tag, DS1315, 0)
#define MCFG_DS1315_BACKING_HANDLER(_devcb) \
- devcb = &downcast<ds1315_device &>(*device).set_backing_handler(DEVCB_##_devcb);
+ downcast<ds1315_device &>(*device).set_backing_handler(DEVCB_##_devcb);
/***************************************************************************
MACROS
diff --git a/src/devices/machine/ds1386.h b/src/devices/machine/ds1386.h
index e01082cf578..5188cf949b9 100644
--- a/src/devices/machine/ds1386.h
+++ b/src/devices/machine/ds1386.h
@@ -60,13 +60,13 @@
// handlers
#define MCFG_DS1386_INTA_HANDLER(_devcb) \
- devcb = &downcast<ds1386_device &>(*device).set_inta_cb(DEVCB_##_devcb);
+ downcast<ds1386_device &>(*device).set_inta_cb(DEVCB_##_devcb);
#define MCFG_DS1386_INTB_HANDLER(_devcb) \
- devcb = &downcast<ds1386_device &>(*device).set_intb_cb(DEVCB_##_devcb);
+ downcast<ds1386_device &>(*device).set_intb_cb(DEVCB_##_devcb);
#define MCFG_DS1386_SQW_HANDLER(_devcb) \
- devcb = &downcast<ds1386_device &>(*device).set_sqw_cb(DEVCB_##_devcb);
+ downcast<ds1386_device &>(*device).set_sqw_cb(DEVCB_##_devcb);
// devices
diff --git a/src/devices/machine/ds75161a.h b/src/devices/machine/ds75161a.h
index 71c93dc2b6b..58d257a27ae 100644
--- a/src/devices/machine/ds75161a.h
+++ b/src/devices/machine/ds75161a.h
@@ -32,52 +32,52 @@
///*************************************************************************
#define MCFG_DS75161A_IN_REN_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_in_ren_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_in_ren_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_IN_IFC_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_in_ifc_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_in_ifc_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_IN_NDAC_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_in_ndac_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_in_ndac_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_IN_NRFD_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_in_nrfd_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_in_nrfd_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_IN_DAV_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_in_dav_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_in_dav_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_IN_EOI_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_in_eoi_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_in_eoi_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_IN_ATN_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_in_atn_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_in_atn_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_IN_SRQ_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_in_srq_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_in_srq_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_OUT_REN_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_out_ren_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_out_ren_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_OUT_IFC_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_out_ifc_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_out_ifc_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_OUT_NDAC_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_out_ndac_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_out_ndac_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_OUT_NRFD_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_out_nrfd_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_out_nrfd_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_OUT_DAV_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_out_dav_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_out_dav_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_OUT_EOI_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_out_eoi_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_out_eoi_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_OUT_ATN_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_out_atn_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_out_atn_callback(DEVCB_##_devcb);
#define MCFG_DS75161A_OUT_SRQ_CB(_devcb) \
- devcb = &downcast<ds75161a_device &>(*device).set_out_srq_callback(DEVCB_##_devcb);
+ downcast<ds75161a_device &>(*device).set_out_srq_callback(DEVCB_##_devcb);
///*************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/e05a03.h b/src/devices/machine/e05a03.h
index fccb187b085..6623c7e4c53 100644
--- a/src/devices/machine/e05a03.h
+++ b/src/devices/machine/e05a03.h
@@ -16,19 +16,19 @@
***************************************************************************/
#define MCFG_E05A03_NLQ_LP_CALLBACK(_write) \
- devcb = &downcast<e05a03_device &>(*device).set_nlq_lp_wr_callback(DEVCB_##_write);
+ downcast<e05a03_device &>(*device).set_nlq_lp_wr_callback(DEVCB_##_write);
#define MCFG_E05A03_PE_LP_CALLBACK(_write) \
- devcb = &downcast<e05a03_device &>(*device).set_pe_lp_wr_callback(DEVCB_##_write);
+ downcast<e05a03_device &>(*device).set_pe_lp_wr_callback(DEVCB_##_write);
#define MCFG_E05A03_RESO_CALLBACK(_write) \
- devcb = &downcast<e05a03_device &>(*device).set_reso_wr_callback(DEVCB_##_write);
+ downcast<e05a03_device &>(*device).set_reso_wr_callback(DEVCB_##_write);
#define MCFG_E05A03_PE_CALLBACK(_write) \
- devcb = &downcast<e05a03_device &>(*device).set_pe_wr_callback(DEVCB_##_write);
+ downcast<e05a03_device &>(*device).set_pe_wr_callback(DEVCB_##_write);
#define MCFG_E05A03_DATA_CALLBACK(_read) \
- devcb = &downcast<e05a03_device &>(*device).set_data_rd_callback(DEVCB_##_read);
+ downcast<e05a03_device &>(*device).set_data_rd_callback(DEVCB_##_read);
/***************************************************************************
diff --git a/src/devices/machine/e05a30.h b/src/devices/machine/e05a30.h
index 0f79a2fe491..7875dbef4c2 100644
--- a/src/devices/machine/e05a30.h
+++ b/src/devices/machine/e05a30.h
@@ -13,31 +13,31 @@
***************************************************************************/
#define MCFG_E05A30_PRINTHEAD_CALLBACK(_write) \
- devcb = &downcast<e05a30_device &>(*device).set_printhead_wr_callback(DEVCB_##_write);
+ downcast<e05a30_device &>(*device).set_printhead_wr_callback(DEVCB_##_write);
#define MCFG_E05A30_PF_STEPPER_CALLBACK(_write) \
- devcb = &downcast<e05a30_device &>(*device).set_pf_stepper_wr_callback(DEVCB_##_write);
+ downcast<e05a30_device &>(*device).set_pf_stepper_wr_callback(DEVCB_##_write);
#define MCFG_E05A30_CR_STEPPER_CALLBACK(_write) \
- devcb = &downcast<e05a30_device &>(*device).set_cr_stepper_wr_callback(DEVCB_##_write);
+ downcast<e05a30_device &>(*device).set_cr_stepper_wr_callback(DEVCB_##_write);
#define MCFG_E05A30_READY_CALLBACK(_write) \
- devcb = &downcast<e05a30_device &>(*device).set_ready_wr_callback(DEVCB_##_write);
+ downcast<e05a30_device &>(*device).set_ready_wr_callback(DEVCB_##_write);
#define MCFG_E05A30_CENTRONICS_ACK_CALLBACK(_write) \
- devcb = &downcast<e05a30_device &>(*device).set_centronics_ack_wr_callback(DEVCB_##_write);
+ downcast<e05a30_device &>(*device).set_centronics_ack_wr_callback(DEVCB_##_write);
#define MCFG_E05A30_CENTRONICS_BUSY_CALLBACK(_write) \
- devcb = &downcast<e05a30_device &>(*device).set_centronics_busy_wr_callback(DEVCB_##_write);
+ downcast<e05a30_device &>(*device).set_centronics_busy_wr_callback(DEVCB_##_write);
#define MCFG_E05A30_CENTRONICS_PERROR_CALLBACK(_write) \
- devcb = &downcast<e05a30_device &>(*device).set_centronics_perror_wr_callback(DEVCB_##_write);
+ downcast<e05a30_device &>(*device).set_centronics_perror_wr_callback(DEVCB_##_write);
#define MCFG_E05A30_CENTRONICS_FAULT_CALLBACK(_write) \
- devcb = &downcast<e05a30_device &>(*device).set_centronics_fault_wr_callback(DEVCB_##_write);
+ downcast<e05a30_device &>(*device).set_centronics_fault_wr_callback(DEVCB_##_write);
#define MCFG_E05A30_CENTRONICS_SELECT_CALLBACK(_write) \
- devcb = &downcast<e05a30_device &>(*device).set_centronics_select_wr_callback(DEVCB_##_write);
+ downcast<e05a30_device &>(*device).set_centronics_select_wr_callback(DEVCB_##_write);
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/devices/machine/eepromser.h b/src/devices/machine/eepromser.h
index c68276da19a..c4a83365e26 100644
--- a/src/devices/machine/eepromser.h
+++ b/src/devices/machine/eepromser.h
@@ -21,7 +21,7 @@
//**************************************************************************
#define MCFG_EEPROM_SERIAL_DO_CALLBACK(_devcb) \
- devcb = &downcast<eeprom_serial_base_device &>(*device).set_do_callback(DEVCB_##_devcb);
+ downcast<eeprom_serial_base_device &>(*device).set_do_callback(DEVCB_##_devcb);
//**************************************************************************
@@ -43,6 +43,7 @@ public:
void enable_streaming(bool enable) { m_streaming_enabled = enable; }
void enable_output_on_falling_clock(bool enable) { m_output_on_falling_clock_enabled = enable; }
template<class Object> devcb_base &set_do_callback(Object &&cb) { return m_do_cb.set_callback(std::forward<Object>(cb)); }
+ auto do_callback() { return m_do_cb.bind(); }
protected:
// construction/destruction
diff --git a/src/devices/machine/fdc37c93x.h b/src/devices/machine/fdc37c93x.h
index 8638fcfa173..d334a0ab2eb 100644
--- a/src/devices/machine/fdc37c93x.h
+++ b/src/devices/machine/fdc37c93x.h
@@ -168,18 +168,18 @@ DECLARE_DEVICE_TYPE(FDC37C93X, fdc37c93x_device);
fdc37c93x_device::static_set_sysopt_pin(*device, _pinvalue);
#define MCFG_FDC37C93X_GP20_RESET_CB(_devcb) \
- devcb = &downcast<fdc37c93x_device &>(*device).set_gp20_reset_callback(DEVCB_##_devcb);
+ downcast<fdc37c93x_device &>(*device).set_gp20_reset_callback(DEVCB_##_devcb);
#define MCFG_FDC37C93X_GP25_GATEA20_CB(_devcb) \
- devcb = &downcast<fdc37c93x_device &>(*device).set_gp25_gatea20_callback(DEVCB_##_devcb);
+ downcast<fdc37c93x_device &>(*device).set_gp25_gatea20_callback(DEVCB_##_devcb);
#define MCFG_FDC37C93X_IRQ1_CB(_devcb) \
- devcb = &downcast<fdc37c93x_device &>(*device).set_irq1_callback(DEVCB_##_devcb);
+ downcast<fdc37c93x_device &>(*device).set_irq1_callback(DEVCB_##_devcb);
#define MCFG_FDC37C93X_IRQ8_CB(_devcb) \
- devcb = &downcast<fdc37c93x_device &>(*device).set_irq8_callback(DEVCB_##_devcb);
+ downcast<fdc37c93x_device &>(*device).set_irq8_callback(DEVCB_##_devcb);
#define MCFG_FDC37C93X_IRQ9_CB(_devcb) \
- devcb = &downcast<fdc37c93x_device &>(*device).set_irq9_callback(DEVCB_##_devcb);
+ downcast<fdc37c93x_device &>(*device).set_irq9_callback(DEVCB_##_devcb);
#endif // MAME_MACHINE_FDC37C93X_H
diff --git a/src/devices/machine/fga002.h b/src/devices/machine/fga002.h
index 01372e41231..aab16fdaf9d 100644
--- a/src/devices/machine/fga002.h
+++ b/src/devices/machine/fga002.h
@@ -9,19 +9,19 @@
// LOCAL IRQ callbacks
#define MCFG_FGA002_OUT_INT_CB(_devcb) \
- devcb = &downcast<fga002_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<fga002_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
#define MCFG_FGA002_OUT_LIACK4_CB(_devcb) \
- devcb = &downcast<fga002_device &>(*device).set_liack4_callback(DEVCB_##_devcb);
+ downcast<fga002_device &>(*device).set_liack4_callback(DEVCB_##_devcb);
#define MCFG_FGA002_OUT_LIACK5_CB(_devcb) \
- devcb = &downcast<fga002_device &>(*device).set_liack5_callback(DEVCB_##_devcb);
+ downcast<fga002_device &>(*device).set_liack5_callback(DEVCB_##_devcb);
#define MCFG_FGA002_OUT_LIACK6_CB(_devcb) \
- devcb = &downcast<fga002_device &>(*device).set_liack6_callback(DEVCB_##_devcb);
+ downcast<fga002_device &>(*device).set_liack6_callback(DEVCB_##_devcb);
#define MCFG_FGA002_OUT_LIACK7_CB(_devcb) \
- devcb = &downcast<fga002_device &>(*device).set_liack7_callback(DEVCB_##_devcb);
+ downcast<fga002_device &>(*device).set_liack7_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/gayle.h b/src/devices/machine/gayle.h
index 81b0f6bafaa..64a75c6f518 100644
--- a/src/devices/machine/gayle.h
+++ b/src/devices/machine/gayle.h
@@ -24,19 +24,19 @@
downcast<gayle_device &>(*device).set_id(_id);
#define MCFG_GAYLE_INT2_HANDLER(_devcb) \
- devcb = &downcast<gayle_device &>(*device).set_int2_handler(DEVCB_##_devcb);
+ downcast<gayle_device &>(*device).set_int2_handler(DEVCB_##_devcb);
#define MCFG_GAYLE_CS0_READ_HANDLER(_devcb) \
- devcb = &downcast<gayle_device &>(*device).set_cs0_read_handler(DEVCB_##_devcb);
+ downcast<gayle_device &>(*device).set_cs0_read_handler(DEVCB_##_devcb);
#define MCFG_GAYLE_CS0_WRITE_HANDLER(_devcb) \
- devcb = &downcast<gayle_device &>(*device).set_cs0_write_handler(DEVCB_##_devcb);
+ downcast<gayle_device &>(*device).set_cs0_write_handler(DEVCB_##_devcb);
#define MCFG_GAYLE_CS1_READ_HANDLER(_devcb) \
- devcb = &downcast<gayle_device &>(*device).set_cs1_read_handler(DEVCB_##_devcb);
+ downcast<gayle_device &>(*device).set_cs1_read_handler(DEVCB_##_devcb);
#define MCFG_GAYLE_CS1_WRITE_HANDLER(_devcb) \
- devcb = &downcast<gayle_device &>(*device).set_cs1_write_handler(DEVCB_##_devcb);
+ downcast<gayle_device &>(*device).set_cs1_write_handler(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/gen_fifo.h b/src/devices/machine/gen_fifo.h
index 430a760aaec..4db8a75d8c1 100644
--- a/src/devices/machine/gen_fifo.h
+++ b/src/devices/machine/gen_fifo.h
@@ -73,10 +73,10 @@
#define MCFG_GENERIC_FIFO_EMPTY_CALLBACK(_devcb) \
- devcb = &downcast<screen_device &>(*device).set_empty_cb(DEVCB_##_devcb);
+ downcast<screen_device &>(*device).set_empty_cb(DEVCB_##_devcb);
#define MCFG_GENERIC_FIFO_FULL_CALLBACK(_devcb) \
- devcb = &downcast<screen_device &>(*device).set_full_cb(DEVCB_##_devcb);
+ downcast<screen_device &>(*device).set_full_cb(DEVCB_##_devcb);
template<typename T> class generic_fifo_device_base : public device_t {
diff --git a/src/devices/machine/gen_latch.h b/src/devices/machine/gen_latch.h
index 702c26ff333..456bbaba8f7 100644
--- a/src/devices/machine/gen_latch.h
+++ b/src/devices/machine/gen_latch.h
@@ -32,7 +32,7 @@ DECLARE_DEVICE_TYPE(GENERIC_LATCH_16, generic_latch_16_device)
MCFG_DEVICE_ADD(_tag, GENERIC_LATCH_16, 0)
#define MCFG_GENERIC_LATCH_DATA_PENDING_CB(_devcb) \
- devcb = &downcast<generic_latch_base_device &>(*device).set_data_pending_callback(DEVCB_##_devcb);
+ downcast<generic_latch_base_device &>(*device).set_data_pending_callback(DEVCB_##_devcb);
#define MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(_ack) \
downcast<generic_latch_base_device &>(*device).set_separate_acknowledge(_ack);
@@ -49,6 +49,7 @@ class generic_latch_base_device : public device_t
public:
// configuration
template <class Object> devcb_base &set_data_pending_callback(Object &&cb) { return m_data_pending_cb.set_callback(std::forward<Object>(cb)); }
+ auto data_pending_callback() { return m_data_pending_cb.bind(); }
void set_separate_acknowledge(bool ack) { m_separate_acknowledge = ack; }
DECLARE_READ_LINE_MEMBER(pending_r);
diff --git a/src/devices/machine/hd63450.h b/src/devices/machine/hd63450.h
index 8f0e6a654ad..67a5c6cfd88 100644
--- a/src/devices/machine/hd63450.h
+++ b/src/devices/machine/hd63450.h
@@ -11,34 +11,34 @@
#define MCFG_HD63450_DMA_END_CB(_devcb) \
- devcb = &downcast<hd63450_device &>(*device).set_dma_end_callback(DEVCB_##_devcb);
+ downcast<hd63450_device &>(*device).set_dma_end_callback(DEVCB_##_devcb);
#define MCFG_HD63450_DMA_ERROR_CB(_devcb) \
- devcb = &downcast<hd63450_device &>(*device).set_dma_error_callback(DEVCB_##_devcb);
+ downcast<hd63450_device &>(*device).set_dma_error_callback(DEVCB_##_devcb);
#define MCFG_HD63450_DMA_READ_0_CB(_devcb) \
- devcb = &downcast<hd63450_device &>(*device).set_dma_read_callback<0>(DEVCB_##_devcb);
+ downcast<hd63450_device &>(*device).set_dma_read_callback<0>(DEVCB_##_devcb);
#define MCFG_HD63450_DMA_READ_1_CB(_devcb) \
- devcb = &downcast<hd63450_device &>(*device).set_dma_read_callback<1>(DEVCB_##_devcb);
+ downcast<hd63450_device &>(*device).set_dma_read_callback<1>(DEVCB_##_devcb);
#define MCFG_HD63450_DMA_READ_2_CB(_devcb) \
- devcb = &downcast<hd63450_device &>(*device).set_dma_read_callback<2>(DEVCB_##_devcb);
+ downcast<hd63450_device &>(*device).set_dma_read_callback<2>(DEVCB_##_devcb);
#define MCFG_HD63450_DMA_READ_3_CB(_devcb) \
- devcb = &downcast<hd63450_device &>(*device).set_dma_read_callback<3>(DEVCB_##_devcb);
+ downcast<hd63450_device &>(*device).set_dma_read_callback<3>(DEVCB_##_devcb);
#define MCFG_HD63450_DMA_WRITE_0_CB(_devcb) \
- devcb = &downcast<hd63450_device &>(*device).set_dma_write_callback<0>(DEVCB_##_devcb);
+ downcast<hd63450_device &>(*device).set_dma_write_callback<0>(DEVCB_##_devcb);
#define MCFG_HD63450_DMA_WRITE_1_CB(_devcb) \
- devcb = &downcast<hd63450_device &>(*device).set_dma_write_callback<1>(DEVCB_##_devcb);
+ downcast<hd63450_device &>(*device).set_dma_write_callback<1>(DEVCB_##_devcb);
#define MCFG_HD63450_DMA_WRITE_2_CB(_devcb) \
- devcb = &downcast<hd63450_device &>(*device).set_dma_write_callback<2>(DEVCB_##_devcb);
+ downcast<hd63450_device &>(*device).set_dma_write_callback<2>(DEVCB_##_devcb);
#define MCFG_HD63450_DMA_WRITE_3_CB(_devcb) \
- devcb = &downcast<hd63450_device &>(*device).set_dma_write_callback<3>(DEVCB_##_devcb);
+ downcast<hd63450_device &>(*device).set_dma_write_callback<3>(DEVCB_##_devcb);
#define MCFG_HD63450_CPU(_tag) \
downcast<hd63450_device &>(*device).set_cpu_tag(_tag);
diff --git a/src/devices/machine/hd64610.h b/src/devices/machine/hd64610.h
index 948f6b4e549..38ffd560f4d 100644
--- a/src/devices/machine/hd64610.h
+++ b/src/devices/machine/hd64610.h
@@ -35,10 +35,10 @@
//**************************************************************************
#define MCFG_HD64610_OUT_IRQ_CB(_devcb) \
- devcb = &downcast<hd64610_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
+ downcast<hd64610_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_HD64610_OUT_1HZ_CB(_devcb) \
- devcb = &downcast<hd64610_device &>(*device).set_out_1hz_callback(DEVCB_##_devcb);
+ downcast<hd64610_device &>(*device).set_out_1hz_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/hdc92x4.h b/src/devices/machine/hdc92x4.h
index 9eb2e6f827b..08f3fea3b44 100644
--- a/src/devices/machine/hdc92x4.h
+++ b/src/devices/machine/hdc92x4.h
@@ -18,33 +18,33 @@ DECLARE_DEVICE_TYPE(HDC9234, hdc9234_device)
/* Interrupt line. To be connected with the controller PCB. */
#define MCFG_HDC92X4_INTRQ_CALLBACK(_write) \
- devcb = &downcast<hdc92x4_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
+ downcast<hdc92x4_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
/* DMA request line. To be connected with the controller PCB. */
#define MCFG_HDC92X4_DMARQ_CALLBACK(_write) \
- devcb = &downcast<hdc92x4_device &>(*device).set_dmarq_wr_callback(DEVCB_##_write);
+ downcast<hdc92x4_device &>(*device).set_dmarq_wr_callback(DEVCB_##_write);
/* DMA in progress line. To be connected with the controller PCB. */
#define MCFG_HDC92X4_DIP_CALLBACK(_write) \
- devcb = &downcast<hdc92x4_device &>(*device).set_dip_wr_callback(DEVCB_##_write);
+ downcast<hdc92x4_device &>(*device).set_dip_wr_callback(DEVCB_##_write);
/* Auxiliary Bus. These 8 lines need to be connected to external latches
and to a counter circuitry which works together with the external RAM.
We use the S0/S1 lines as address lines. */
#define MCFG_HDC92X4_AUXBUS_OUT_CALLBACK(_write) \
- devcb = &downcast<hdc92x4_device &>(*device).set_auxbus_wr_callback(DEVCB_##_write);
+ downcast<hdc92x4_device &>(*device).set_auxbus_wr_callback(DEVCB_##_write);
/* Callback to read the contents of the external RAM via the data bus.
Note that the address must be set and automatically increased
by external circuitry. */
#define MCFG_HDC92X4_DMA_IN_CALLBACK(_read) \
- devcb = &downcast<hdc92x4_device &>(*device).set_dma_rd_callback(DEVCB_##_read);
+ downcast<hdc92x4_device &>(*device).set_dma_rd_callback(DEVCB_##_read);
/* Callback to write the contents of the external RAM via the data bus.
Note that the address must be set and automatically increased
by external circuitry. */
#define MCFG_HDC92X4_DMA_OUT_CALLBACK(_write) \
- devcb = &downcast<hdc92x4_device &>(*device).set_dma_wr_callback(DEVCB_##_write);
+ downcast<hdc92x4_device &>(*device).set_dma_wr_callback(DEVCB_##_write);
//===================================================================
diff --git a/src/devices/machine/hp_taco.h b/src/devices/machine/hp_taco.h
index 3b926a0946a..42682aa76a4 100644
--- a/src/devices/machine/hp_taco.h
+++ b/src/devices/machine/hp_taco.h
@@ -16,13 +16,13 @@
#include "formats/hti_tape.h"
#define MCFG_TACO_IRQ_HANDLER(_devcb) \
- devcb = &downcast<hp_taco_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<hp_taco_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_TACO_FLG_HANDLER(_devcb) \
- devcb = &downcast<hp_taco_device &>(*device).set_flg_handler(DEVCB_##_devcb);
+ downcast<hp_taco_device &>(*device).set_flg_handler(DEVCB_##_devcb);
#define MCFG_TACO_STS_HANDLER(_devcb) \
- devcb = &downcast<hp_taco_device &>(*device).set_sts_handler(DEVCB_##_devcb);
+ downcast<hp_taco_device &>(*device).set_sts_handler(DEVCB_##_devcb);
class hp_taco_device : public device_t ,
public device_image_interface
diff --git a/src/devices/machine/i7220.h b/src/devices/machine/i7220.h
index 78aef97bdab..51eaf3ce917 100644
--- a/src/devices/machine/i7220.h
+++ b/src/devices/machine/i7220.h
@@ -43,10 +43,10 @@
///*************************************************************************
#define MCFG_I7220_IRQ_CALLBACK(_write) \
- devcb = &downcast<i7220_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
+ downcast<i7220_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
#define MCFG_I7220_DRQ_CALLBACK(_write) \
- devcb = &downcast<i7220_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
+ downcast<i7220_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
#define MCFG_I7220_DATA_SIZE(data_size) \
downcast<i7220_device &>(*device).set_data_size(data_size);
diff --git a/src/devices/machine/i80130.h b/src/devices/machine/i80130.h
index 385d361c423..c4ce3d855aa 100644
--- a/src/devices/machine/i80130.h
+++ b/src/devices/machine/i80130.h
@@ -21,22 +21,22 @@
///*************************************************************************
#define MCFG_I80130_IRQ_CALLBACK(_write) \
- devcb = &downcast<i80130_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
+ downcast<i80130_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_I80130_ACK_CALLBACK(_write) \
- devcb = &downcast<i80130_device &>(*device).set_ack_wr_callback(DEVCB_##_write);
+ downcast<i80130_device &>(*device).set_ack_wr_callback(DEVCB_##_write);
#define MCFG_I80130_LIR_CALLBACK(_write) \
- devcb = &downcast<i80130_device &>(*device).set_lir_wr_callback(DEVCB_##_write);
+ downcast<i80130_device &>(*device).set_lir_wr_callback(DEVCB_##_write);
#define MCFG_I80130_SYSTICK_CALLBACK(_write) \
- devcb = &downcast<i80130_device &>(*device).set_systick_wr_callback(DEVCB_##_write);
+ downcast<i80130_device &>(*device).set_systick_wr_callback(DEVCB_##_write);
#define MCFG_I80130_DELAY_CALLBACK(_write) \
- devcb = &downcast<i80130_device &>(*device).set_delay_wr_callback(DEVCB_##_write);
+ downcast<i80130_device &>(*device).set_delay_wr_callback(DEVCB_##_write);
#define MCFG_I80130_BAUD_CALLBACK(_write) \
- devcb = &downcast<i80130_device &>(*device).set_baud_wr_callback(DEVCB_##_write);
+ downcast<i80130_device &>(*device).set_baud_wr_callback(DEVCB_##_write);
diff --git a/src/devices/machine/i8087.h b/src/devices/machine/i8087.h
index 62c847e2cbf..e0d5ab7e87e 100644
--- a/src/devices/machine/i8087.h
+++ b/src/devices/machine/i8087.h
@@ -12,10 +12,10 @@
downcast<i8087_device &>(*device).set_data_width(_data_width);
#define MCFG_I8087_INT_HANDLER(_devcb) \
- devcb = &downcast<i8087_device &>(*device).set_int(DEVCB_##_devcb);
+ downcast<i8087_device &>(*device).set_int(DEVCB_##_devcb);
#define MCFG_I8087_BUSY_HANDLER(_devcb) \
- devcb = &downcast<i8087_device &>(*device).set_busy(DEVCB_##_devcb);
+ downcast<i8087_device &>(*device).set_busy(DEVCB_##_devcb);
DECLARE_DEVICE_TYPE(I8087, i8087_device)
diff --git a/src/devices/machine/i8155.h b/src/devices/machine/i8155.h
index 0c1f387ea2b..ed1b193849d 100644
--- a/src/devices/machine/i8155.h
+++ b/src/devices/machine/i8155.h
@@ -41,25 +41,25 @@
//**************************************************************************
#define MCFG_I8155_IN_PORTA_CB(_devcb) \
- devcb = &downcast<i8155_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
+ downcast<i8155_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
#define MCFG_I8155_IN_PORTB_CB(_devcb) \
- devcb = &downcast<i8155_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
+ downcast<i8155_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
#define MCFG_I8155_IN_PORTC_CB(_devcb) \
- devcb = &downcast<i8155_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
+ downcast<i8155_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
#define MCFG_I8155_OUT_PORTA_CB(_devcb) \
- devcb = &downcast<i8155_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
+ downcast<i8155_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
#define MCFG_I8155_OUT_PORTB_CB(_devcb) \
- devcb = &downcast<i8155_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
+ downcast<i8155_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
#define MCFG_I8155_OUT_PORTC_CB(_devcb) \
- devcb = &downcast<i8155_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
+ downcast<i8155_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
#define MCFG_I8155_OUT_TIMEROUT_CB(_devcb) \
- devcb = &downcast<i8155_device &>(*device).set_out_to_callback(DEVCB_##_devcb);
+ downcast<i8155_device &>(*device).set_out_to_callback(DEVCB_##_devcb);
//**************************************************************************
@@ -82,6 +82,13 @@ public:
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_to_callback(Object &&cb) { return m_out_to_cb.set_callback(std::forward<Object>(cb)); }
+ 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 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_to_callback() { return m_out_to_cb.bind(); }
DECLARE_READ8_MEMBER( io_r );
DECLARE_WRITE8_MEMBER( io_w );
diff --git a/src/devices/machine/i8212.h b/src/devices/machine/i8212.h
index b98ab2c0c55..0d4accbb5c0 100644
--- a/src/devices/machine/i8212.h
+++ b/src/devices/machine/i8212.h
@@ -34,16 +34,16 @@
///*************************************************************************
#define MCFG_I8212_INT_CALLBACK(_write) \
- devcb = &downcast<i8212_device &>(*device).set_int_wr_callback(DEVCB_##_write);
+ downcast<i8212_device &>(*device).set_int_wr_callback(DEVCB_##_write);
#define MCFG_I8212_DI_CALLBACK(_read) \
- devcb = &downcast<i8212_device &>(*device).set_di_rd_callback(DEVCB_##_read);
+ downcast<i8212_device &>(*device).set_di_rd_callback(DEVCB_##_read);
#define MCFG_I8212_DO_CALLBACK(_write) \
- devcb = &downcast<i8212_device &>(*device).set_do_wr_callback(DEVCB_##_write);
+ downcast<i8212_device &>(*device).set_do_wr_callback(DEVCB_##_write);
#define MCFG_I8212_MD_CALLBACK(_read) \
- devcb = &downcast<i8212_device &>(*device).set_md_rd_callback(DEVCB_##_read);
+ downcast<i8212_device &>(*device).set_md_rd_callback(DEVCB_##_read);
diff --git a/src/devices/machine/i8214.h b/src/devices/machine/i8214.h
index aafcde5f908..dc609c24f15 100644
--- a/src/devices/machine/i8214.h
+++ b/src/devices/machine/i8214.h
@@ -33,10 +33,10 @@
///*************************************************************************
#define MCFG_I8214_INT_CALLBACK(_write) \
- devcb = &downcast<i8214_device &>(*device).set_int_wr_callback(DEVCB_##_write);
+ downcast<i8214_device &>(*device).set_int_wr_callback(DEVCB_##_write);
#define MCFG_I8214_ENLG_CALLBACK(_write) \
- devcb = &downcast<i8214_device &>(*device).set_enlg_wr_callback(DEVCB_##_write);
+ downcast<i8214_device &>(*device).set_enlg_wr_callback(DEVCB_##_write);
@@ -54,6 +54,8 @@ 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_enlg_wr_callback(Object &&cb) { return m_write_enlg.set_callback(std::forward<Object>(cb)); }
+ auto int_wr_callback() { return m_write_int.bind(); }
+ auto enlg_wr_callback() { return m_write_enlg.bind(); }
DECLARE_WRITE_LINE_MEMBER( sgs_w );
DECLARE_WRITE_LINE_MEMBER( etlg_w );
diff --git a/src/devices/machine/i82371sb.cpp b/src/devices/machine/i82371sb.cpp
index ff757cdbf6b..291e9fb0c56 100644
--- a/src/devices/machine/i82371sb.cpp
+++ b/src/devices/machine/i82371sb.cpp
@@ -90,12 +90,12 @@ MACHINE_CONFIG_START(i82371sb_isa_device::device_add_mconfig)
MCFG_DEVICE_ADD("pic8259_master", 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, i82371sb_isa_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)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/devices/machine/i82371sb.h b/src/devices/machine/i82371sb.h
index 8289dc47b40..6118ff61b6a 100644
--- a/src/devices/machine/i82371sb.h
+++ b/src/devices/machine/i82371sb.h
@@ -25,10 +25,10 @@
#define MCFG_I82371SB_SMI_CB(_devcb) \
- devcb = &downcast<i82371sb_isa_device &>(*device).set_smi_callback(DEVCB_##_devcb);
+ downcast<i82371sb_isa_device &>(*device).set_smi_callback(DEVCB_##_devcb);
#define MCFG_I82371SB_BOOT_STATE_HOOK(_devcb) \
- devcb = &downcast<i82371sb_isa_device &>(*device).set_boot_state_hook(DEVCB_##_devcb);
+ downcast<i82371sb_isa_device &>(*device).set_boot_state_hook(DEVCB_##_devcb);
class i82371sb_isa_device : public pci_device {
public:
@@ -182,10 +182,10 @@ private:
DECLARE_DEVICE_TYPE(I82371SB_ISA, i82371sb_isa_device)
#define MCFG_I82371SB_IDE_IRQ_PRI_CB(_devcb) \
- devcb = &downcast<i82371sb_ide_device &>(*device).set_irq_pri_callback(DEVCB_##_devcb);
+ downcast<i82371sb_ide_device &>(*device).set_irq_pri_callback(DEVCB_##_devcb);
#define MCFG_I82371SB_IDE_IRQ_SEC_CB(_devcb) \
- devcb = &downcast<i82371sb_ide_device &>(*device).set_irq_sec_callback(DEVCB_##_devcb);
+ downcast<i82371sb_ide_device &>(*device).set_irq_sec_callback(DEVCB_##_devcb);
#define MCFG_I82371SB_IDE_INTERRUPTS(_tag, _dev, _irq_pri, _irq_sec) \
MCFG_I82371SB_IDE_IRQ_PRI_CB(WRITELINE(_tag, _dev, _irq_pri)) \
diff --git a/src/devices/machine/i8243.h b/src/devices/machine/i8243.h
index fef950ffacb..76c4b601bd8 100644
--- a/src/devices/machine/i8243.h
+++ b/src/devices/machine/i8243.h
@@ -24,9 +24,9 @@
MCFG_I8243_READHANDLER(_read) \
MCFG_I8243_WRITEHANDLER(_write)
#define MCFG_I8243_READHANDLER(_devcb) \
- devcb = &downcast<i8243_device &>(*device).set_read_handler(DEVCB_##_devcb);
+ downcast<i8243_device &>(*device).set_read_handler(DEVCB_##_devcb);
#define MCFG_I8243_WRITEHANDLER(_devcb) \
- devcb = &downcast<i8243_device &>(*device).set_write_handler(DEVCB_##_devcb);
+ downcast<i8243_device &>(*device).set_write_handler(DEVCB_##_devcb);
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/machine/i8251.h b/src/devices/machine/i8251.h
index a475e39ae36..4eab12602d9 100644
--- a/src/devices/machine/i8251.h
+++ b/src/devices/machine/i8251.h
@@ -20,25 +20,25 @@
//**************************************************************************
#define MCFG_I8251_TXD_HANDLER(_devcb) \
- devcb = &downcast<i8251_device &>(*device).set_txd_handler(DEVCB_##_devcb);
+ downcast<i8251_device &>(*device).set_txd_handler(DEVCB_##_devcb);
#define MCFG_I8251_DTR_HANDLER(_devcb) \
- devcb = &downcast<i8251_device &>(*device).set_dtr_handler(DEVCB_##_devcb);
+ downcast<i8251_device &>(*device).set_dtr_handler(DEVCB_##_devcb);
#define MCFG_I8251_RTS_HANDLER(_devcb) \
- devcb = &downcast<i8251_device &>(*device).set_rts_handler(DEVCB_##_devcb);
+ downcast<i8251_device &>(*device).set_rts_handler(DEVCB_##_devcb);
#define MCFG_I8251_RXRDY_HANDLER(_devcb) \
- devcb = &downcast<i8251_device &>(*device).set_rxrdy_handler(DEVCB_##_devcb);
+ downcast<i8251_device &>(*device).set_rxrdy_handler(DEVCB_##_devcb);
#define MCFG_I8251_TXRDY_HANDLER(_devcb) \
- devcb = &downcast<i8251_device &>(*device).set_txrdy_handler(DEVCB_##_devcb);
+ downcast<i8251_device &>(*device).set_txrdy_handler(DEVCB_##_devcb);
#define MCFG_I8251_TXEMPTY_HANDLER(_devcb) \
- devcb = &downcast<i8251_device &>(*device).set_txempty_handler(DEVCB_##_devcb);
+ downcast<i8251_device &>(*device).set_txempty_handler(DEVCB_##_devcb);
#define MCFG_I8251_SYNDET_HANDLER(_devcb) \
- devcb = &downcast<i8251_device &>(*device).set_syndet_handler(DEVCB_##_devcb);
+ downcast<i8251_device &>(*device).set_syndet_handler(DEVCB_##_devcb);
class i8251_device : public device_t,
public device_serial_interface
@@ -55,6 +55,13 @@ public:
template <class Object> devcb_base &set_txrdy_handler(Object &&cb) { return m_txrdy_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_txempty_handler(Object &&cb) { return m_txempty_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_syndet_handler(Object &&cb) { return m_syndet_handler.set_callback(std::forward<Object>(cb)); }
+ auto txd_handler() { return m_txd_handler.bind(); }
+ auto dtr_handler() { return m_dtr_handler.bind(); }
+ auto rts_handler() { return m_rts_handler.bind(); }
+ auto rxrdy_handler() { return m_rxrdy_handler.bind(); }
+ auto txrdy_handler() { return m_txrdy_handler.bind(); }
+ auto txempty_handler() { return m_txempty_handler.bind(); }
+ auto syndet_handler() { return m_syndet_handler.bind(); }
DECLARE_READ8_MEMBER(data_r);
DECLARE_WRITE8_MEMBER(data_w);
diff --git a/src/devices/machine/i8255.h b/src/devices/machine/i8255.h
index 4c2c28c42db..3d7e1e0daa7 100644
--- a/src/devices/machine/i8255.h
+++ b/src/devices/machine/i8255.h
@@ -40,29 +40,29 @@
//**************************************************************************
#define MCFG_I8255_IN_PORTA_CB(_devcb) \
- devcb = &downcast<i8255_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
+ downcast<i8255_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
#define MCFG_I8255_IN_PORTB_CB(_devcb) \
- devcb = &downcast<i8255_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
+ downcast<i8255_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
#define MCFG_I8255_IN_PORTC_CB(_devcb) \
- devcb = &downcast<i8255_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
+ downcast<i8255_device &>(*device).set_in_pc_callback(DEVCB_##_devcb);
#define MCFG_I8255_OUT_PORTA_CB(_devcb) \
- devcb = &downcast<i8255_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
+ downcast<i8255_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
#define MCFG_I8255_OUT_PORTB_CB(_devcb) \
- devcb = &downcast<i8255_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
+ downcast<i8255_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
#define MCFG_I8255_OUT_PORTC_CB(_devcb) \
- devcb = &downcast<i8255_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
+ downcast<i8255_device &>(*device).set_out_pc_callback(DEVCB_##_devcb);
// output state when pins are in tri-state, default 0xff
#define MCFG_I8255_TRISTATE_PORTA_CB(_devcb) \
- devcb = &downcast<i8255_device &>(*device).set_tri_pa_callback(DEVCB_##_devcb);
+ downcast<i8255_device &>(*device).set_tri_pa_callback(DEVCB_##_devcb);
#define MCFG_I8255_TRISTATE_PORTB_CB(_devcb) \
- devcb = &downcast<i8255_device &>(*device).set_tri_pb_callback(DEVCB_##_devcb);
+ downcast<i8255_device &>(*device).set_tri_pb_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -84,6 +84,14 @@ public:
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_tri_pa_callback(Object &&cb) { return m_tri_pa_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_tri_pb_callback(Object &&cb) { return m_tri_pb_cb.set_callback(std::forward<Object>(cb)); }
+ 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 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 tri_pa_callback() { return m_tri_pa_cb.bind(); }
+ auto tri_pb_callback() { return m_tri_pb_cb.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/machine/i8257.h b/src/devices/machine/i8257.h
index 80e268f1b2d..b1311314aee 100644
--- a/src/devices/machine/i8257.h
+++ b/src/devices/machine/i8257.h
@@ -42,52 +42,52 @@
***************************************************************************/
#define MCFG_I8257_OUT_HRQ_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_out_hrq_callback(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_out_hrq_callback(DEVCB_##_devcb);
#define MCFG_I8257_OUT_TC_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_out_tc_callback(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_out_tc_callback(DEVCB_##_devcb);
#define MCFG_I8257_IN_MEMR_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_in_memr_callback(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_in_memr_callback(DEVCB_##_devcb);
#define MCFG_I8257_OUT_MEMW_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_out_memw_callback(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_out_memw_callback(DEVCB_##_devcb);
#define MCFG_I8257_IN_IOR_0_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_in_ior_callback<0>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_in_ior_callback<0>(DEVCB_##_devcb);
#define MCFG_I8257_IN_IOR_1_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_in_ior_callback<1>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_in_ior_callback<1>(DEVCB_##_devcb);
#define MCFG_I8257_IN_IOR_2_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_in_ior_callback<2>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_in_ior_callback<2>(DEVCB_##_devcb);
#define MCFG_I8257_IN_IOR_3_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_in_ior_callback<3>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_in_ior_callback<3>(DEVCB_##_devcb);
#define MCFG_I8257_OUT_IOW_0_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_out_iow_callback<0>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_out_iow_callback<0>(DEVCB_##_devcb);
#define MCFG_I8257_OUT_IOW_1_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_out_iow_callback<1>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_out_iow_callback<1>(DEVCB_##_devcb);
#define MCFG_I8257_OUT_IOW_2_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_out_iow_callback<2>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_out_iow_callback<2>(DEVCB_##_devcb);
#define MCFG_I8257_OUT_IOW_3_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_out_iow_callback<3>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_out_iow_callback<3>(DEVCB_##_devcb);
#define MCFG_I8257_OUT_DACK_0_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_out_dack_callback<0>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_out_dack_callback<0>(DEVCB_##_devcb);
#define MCFG_I8257_OUT_DACK_1_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_out_dack_callback<1>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_out_dack_callback<1>(DEVCB_##_devcb);
#define MCFG_I8257_OUT_DACK_2_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_out_dack_callback<2>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_out_dack_callback<2>(DEVCB_##_devcb);
#define MCFG_I8257_OUT_DACK_3_CB(_devcb) \
- devcb = &downcast<i8257_device &>(*device).set_out_dack_callback<3>(DEVCB_##_devcb);
+ downcast<i8257_device &>(*device).set_out_dack_callback<3>(DEVCB_##_devcb);
// HACK: the radio86 and alikes require this, is it a bug in the soviet clone or is there something else happening?
#define MCFG_I8257_REVERSE_RW_MODE(_flag) \
diff --git a/src/devices/machine/i82586.h b/src/devices/machine/i82586.h
index dfd073190ae..93f45d82574 100644
--- a/src/devices/machine/i82586.h
+++ b/src/devices/machine/i82586.h
@@ -7,7 +7,7 @@
#pragma once
#define MCFG_I82586_IRQ_CB(_out_irq) \
- devcb = &downcast<i82586_base_device &>(*device).set_out_irq_callback(DEVCB_##_out_irq);
+ downcast<i82586_base_device &>(*device).set_out_irq_callback(DEVCB_##_out_irq);
class i82586_base_device :
public device_t,
diff --git a/src/devices/machine/i8271.h b/src/devices/machine/i8271.h
index 3db17379760..32d70b507a0 100644
--- a/src/devices/machine/i8271.h
+++ b/src/devices/machine/i8271.h
@@ -9,16 +9,16 @@
#include "fdc_pll.h"
#define MCFG_I8271_IRQ_CALLBACK(_write) \
- devcb = &downcast<i8271_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
+ downcast<i8271_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
#define MCFG_I8271_DRQ_CALLBACK(_write) \
- devcb = &downcast<i8271_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
+ downcast<i8271_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
#define MCFG_I8271_HDL_CALLBACK(_write) \
- devcb = &downcast<i8271_device &>(*device).set_hdl_wr_callback(DEVCB_##_write);
+ downcast<i8271_device &>(*device).set_hdl_wr_callback(DEVCB_##_write);
#define MCFG_I8271_OPT_CALLBACK(_write) \
- devcb = &downcast<i8271_device &>(*device).set_opt_wr_callback(DEVCB_##_write);
+ downcast<i8271_device &>(*device).set_opt_wr_callback(DEVCB_##_write);
/***************************************************************************
MACROS
diff --git a/src/devices/machine/i8279.h b/src/devices/machine/i8279.h
index c50dfd1d54d..80c492b2b6e 100644
--- a/src/devices/machine/i8279.h
+++ b/src/devices/machine/i8279.h
@@ -43,25 +43,25 @@
***************************************************************************/
#define MCFG_I8279_OUT_IRQ_CB(_devcb) \
- devcb = &downcast<i8279_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
+ downcast<i8279_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_I8279_OUT_SL_CB(_devcb) \
- devcb = &downcast<i8279_device &>(*device).set_out_sl_callback(DEVCB_##_devcb);
+ downcast<i8279_device &>(*device).set_out_sl_callback(DEVCB_##_devcb);
#define MCFG_I8279_OUT_DISP_CB(_devcb) \
- devcb = &downcast<i8279_device &>(*device).set_out_disp_callback(DEVCB_##_devcb);
+ downcast<i8279_device &>(*device).set_out_disp_callback(DEVCB_##_devcb);
#define MCFG_I8279_OUT_BD_CB(_devcb) \
- devcb = &downcast<i8279_device &>(*device).set_out_bd_callback(DEVCB_##_devcb);
+ downcast<i8279_device &>(*device).set_out_bd_callback(DEVCB_##_devcb);
#define MCFG_I8279_IN_RL_CB(_devcb) \
- devcb = &downcast<i8279_device &>(*device).set_in_rl_callback(DEVCB_##_devcb);
+ downcast<i8279_device &>(*device).set_in_rl_callback(DEVCB_##_devcb);
#define MCFG_I8279_IN_SHIFT_CB(_devcb) \
- devcb = &downcast<i8279_device &>(*device).set_in_shift_callback(DEVCB_##_devcb);
+ downcast<i8279_device &>(*device).set_in_shift_callback(DEVCB_##_devcb);
#define MCFG_I8279_IN_CTRL_CB(_devcb) \
- devcb = &downcast<i8279_device &>(*device).set_in_ctrl_callback(DEVCB_##_devcb);
+ downcast<i8279_device &>(*device).set_in_ctrl_callback(DEVCB_##_devcb);
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/devices/machine/i8355.h b/src/devices/machine/i8355.h
index a9d5297bc26..be2e83d17eb 100644
--- a/src/devices/machine/i8355.h
+++ b/src/devices/machine/i8355.h
@@ -49,16 +49,16 @@
///*************************************************************************
#define MCFG_I8355_IN_PA_CB(_devcb) \
- devcb = &downcast<i8355_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
+ downcast<i8355_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
#define MCFG_I8355_OUT_PA_CB(_devcb) \
- devcb = &downcast<i8355_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
+ downcast<i8355_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
#define MCFG_I8355_IN_PB_CB(_devcb) \
- devcb = &downcast<i8355_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
+ downcast<i8355_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
#define MCFG_I8355_OUT_PB_CB(_devcb) \
- devcb = &downcast<i8355_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
+ downcast<i8355_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
///*************************************************************************
diff --git a/src/devices/machine/ie15_kbd.h b/src/devices/machine/ie15_kbd.h
index 4d5c7370160..d0d38286b8d 100644
--- a/src/devices/machine/ie15_kbd.h
+++ b/src/devices/machine/ie15_kbd.h
@@ -11,7 +11,7 @@
***************************************************************************/
#define MCFG_IE15_KEYBOARD_CB(_devcb) \
- devcb = &downcast<ie15_keyboard_device &>(*device).set_keyboard_callback(DEVCB_##_devcb);
+ downcast<ie15_keyboard_device &>(*device).set_keyboard_callback(DEVCB_##_devcb);
/***************************************************************************
FUNCTION PROTOTYPES
diff --git a/src/devices/machine/im6402.h b/src/devices/machine/im6402.h
index ae505ef54c1..6908db0d9c6 100644
--- a/src/devices/machine/im6402.h
+++ b/src/devices/machine/im6402.h
@@ -55,16 +55,16 @@
downcast<im6402_device &>(*device).set_trc(_trc);
#define MCFG_IM6402_TRO_CALLBACK(_write) \
- devcb = &downcast<im6402_device &>(*device).set_tro_wr_callback(DEVCB_##_write);
+ downcast<im6402_device &>(*device).set_tro_wr_callback(DEVCB_##_write);
#define MCFG_IM6402_DR_CALLBACK(_write) \
- devcb = &downcast<im6402_device &>(*device).set_dr_wr_callback(DEVCB_##_write);
+ downcast<im6402_device &>(*device).set_dr_wr_callback(DEVCB_##_write);
#define MCFG_IM6402_TBRE_CALLBACK(_write) \
- devcb = &downcast<im6402_device &>(*device).set_tbre_wr_callback(DEVCB_##_write);
+ downcast<im6402_device &>(*device).set_tbre_wr_callback(DEVCB_##_write);
#define MCFG_IM6402_TRE_CALLBACK(_write) \
- devcb = &downcast<im6402_device &>(*device).set_tre_wr_callback(DEVCB_##_write);
+ downcast<im6402_device &>(*device).set_tre_wr_callback(DEVCB_##_write);
diff --git a/src/devices/machine/input_merger.h b/src/devices/machine/input_merger.h
index 6cf9701b6df..53af1a38cfd 100644
--- a/src/devices/machine/input_merger.h
+++ b/src/devices/machine/input_merger.h
@@ -33,7 +33,7 @@
MCFG_DEVICE_ADD(_tag, INPUT_MERGER_ALL_LOW, 0)
#define MCFG_INPUT_MERGER_OUTPUT_HANDLER(_devcb) \
- devcb = &downcast<input_merger_device &>(*device).set_output_handler(DEVCB_##_devcb);
+ downcast<input_merger_device &>(*device).set_output_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -45,6 +45,7 @@ class input_merger_device : public device_t
public:
// callback
template <class Object> devcb_base &set_output_handler(Object &&cb) { return m_output_handler.set_callback(std::forward<Object>(cb)); }
+ auto output_handler() { return m_output_handler.bind(); }
// input lines
template <unsigned Bit> DECLARE_WRITE_LINE_MEMBER(in_w) { static_assert(Bit < 32, "invalid bit"); machine().scheduler().synchronize(timer_expired_delegate(FUNC(input_merger_device::update_state), this), (Bit << 1) | (state ? 1U : 0U)); }
diff --git a/src/devices/machine/ins8154.h b/src/devices/machine/ins8154.h
index 1c6596ccc13..9f401c87f2d 100644
--- a/src/devices/machine/ins8154.h
+++ b/src/devices/machine/ins8154.h
@@ -43,19 +43,19 @@
***************************************************************************/
#define MCFG_INS8154_IN_A_CB(_devcb) \
- devcb = &downcast<ins8154_device &>(*device).set_in_a_callback(DEVCB_##_devcb);
+ downcast<ins8154_device &>(*device).set_in_a_callback(DEVCB_##_devcb);
#define MCFG_INS8154_OUT_A_CB(_devcb) \
- devcb = &downcast<ins8154_device &>(*device).set_out_a_callback(DEVCB_##_devcb);
+ downcast<ins8154_device &>(*device).set_out_a_callback(DEVCB_##_devcb);
#define MCFG_INS8154_IN_B_CB(_devcb) \
- devcb = &downcast<ins8154_device &>(*device).set_in_b_callback(DEVCB_##_devcb);
+ downcast<ins8154_device &>(*device).set_in_b_callback(DEVCB_##_devcb);
#define MCFG_INS8154_OUT_B_CB(_devcb) \
- devcb = &downcast<ins8154_device &>(*device).set_out_b_callback(DEVCB_##_devcb);
+ downcast<ins8154_device &>(*device).set_out_b_callback(DEVCB_##_devcb);
#define MCFG_INS8154_OUT_IRQ_CB(_devcb) \
- devcb = &downcast<ins8154_device &>(*device).set_out_irq_callback(DEVCB_##_devcb); //currently unused
+ downcast<ins8154_device &>(*device).set_out_irq_callback(DEVCB_##_devcb); //currently unused
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/devices/machine/ins8250.h b/src/devices/machine/ins8250.h
index 7bd6753b391..af68f36887b 100644
--- a/src/devices/machine/ins8250.h
+++ b/src/devices/machine/ins8250.h
@@ -17,8 +17,7 @@
CLASS DEFINITIONS
***************************************************************************/
-class ins8250_uart_device : public device_t,
- public device_serial_interface
+class ins8250_uart_device : public device_t, public device_serial_interface
{
public:
template <class Object> devcb_base &set_out_tx_callback(Object &&cb) { return m_out_tx_cb.set_callback(std::forward<Object>(cb)); }
@@ -27,6 +26,12 @@ public:
template <class Object> devcb_base &set_out_int_callback(Object &&cb) { return m_out_int_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_out_out1_callback(Object &&cb) { return m_out_out1_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_out_out2_callback(Object &&cb) { return m_out_out2_cb.set_callback(std::forward<Object>(cb)); }
+ auto out_tx_callback() { return m_out_tx_cb.bind(); }
+ auto out_dtr_callback() { return m_out_dtr_cb.bind(); }
+ auto out_rts_callback() { return m_out_rts_cb.bind(); }
+ auto out_int_callback() { return m_out_int_cb.bind(); }
+ auto out_out1_callback() { return m_out_out1_cb.bind(); }
+ auto out_out2_callback() { return m_out_out2_cb.bind(); }
DECLARE_WRITE8_MEMBER( ins8250_w );
DECLARE_READ8_MEMBER( ins8250_r );
@@ -159,21 +164,21 @@ DECLARE_DEVICE_TYPE(NS16550, ns16550_device)
***************************************************************************/
#define MCFG_INS8250_OUT_TX_CB(_devcb) \
- devcb = &downcast<ins8250_uart_device &>(*device).set_out_tx_callback(DEVCB_##_devcb);
+ downcast<ins8250_uart_device &>(*device).set_out_tx_callback(DEVCB_##_devcb);
#define MCFG_INS8250_OUT_DTR_CB(_devcb) \
- devcb = &downcast<ins8250_uart_device &>(*device).set_out_dtr_callback(DEVCB_##_devcb);
+ downcast<ins8250_uart_device &>(*device).set_out_dtr_callback(DEVCB_##_devcb);
#define MCFG_INS8250_OUT_RTS_CB(_devcb) \
- devcb = &downcast<ins8250_uart_device &>(*device).set_out_rts_callback(DEVCB_##_devcb);
+ downcast<ins8250_uart_device &>(*device).set_out_rts_callback(DEVCB_##_devcb);
#define MCFG_INS8250_OUT_INT_CB(_devcb) \
- devcb = &downcast<ins8250_uart_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<ins8250_uart_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
#define MCFG_INS8250_OUT_OUT1_CB(_devcb) \
- devcb = &downcast<ins8250_uart_device &>(*device).set_out_out1_callback(DEVCB_##_devcb);
+ downcast<ins8250_uart_device &>(*device).set_out_out1_callback(DEVCB_##_devcb);
#define MCFG_INS8250_OUT_OUT2_CB(_devcb) \
- devcb = &downcast<ins8250_uart_device &>(*device).set_out_out2_callback(DEVCB_##_devcb);
+ downcast<ins8250_uart_device &>(*device).set_out_out2_callback(DEVCB_##_devcb);
#endif // MAME_MACHINE_INS8250_H
diff --git a/src/devices/machine/k053252.h b/src/devices/machine/k053252.h
index 7fe29893479..c8a76b8ff20 100644
--- a/src/devices/machine/k053252.h
+++ b/src/devices/machine/k053252.h
@@ -11,19 +11,19 @@
#include "screen.h"
#define MCFG_K053252_INT1_EN_CB(_devcb) \
- devcb = &downcast<k053252_device &>(*device).set_int1_en_callback(DEVCB_##_devcb);
+ downcast<k053252_device &>(*device).set_int1_en_callback(DEVCB_##_devcb);
#define MCFG_K053252_INT2_EN_CB(_devcb) \
- devcb = &downcast<k053252_device &>(*device).set_int2_en_callback(DEVCB_##_devcb);
+ downcast<k053252_device &>(*device).set_int2_en_callback(DEVCB_##_devcb);
#define MCFG_K053252_INT1_ACK_CB(_devcb) \
- devcb = &downcast<k053252_device &>(*device).set_int1_ack_callback(DEVCB_##_devcb);
+ downcast<k053252_device &>(*device).set_int1_ack_callback(DEVCB_##_devcb);
#define MCFG_K053252_INT2_ACK_CB(_devcb) \
- devcb = &downcast<k053252_device &>(*device).set_int2_ack_callback(DEVCB_##_devcb);
+ downcast<k053252_device &>(*device).set_int2_ack_callback(DEVCB_##_devcb);
#define MCFG_K053252_INT_TIME_CB(_devcb) \
- devcb = &downcast<k053252_device &>(*device).set_int_time_callback(DEVCB_##_devcb);
+ downcast<k053252_device &>(*device).set_int_time_callback(DEVCB_##_devcb);
#define MCFG_K053252_OFFSETS(_offsx, _offsy) \
downcast<k053252_device &>(*device).set_offsets(_offsx, _offsy);
diff --git a/src/devices/machine/kb3600.h b/src/devices/machine/kb3600.h
index 14c738d9f22..e77de332bc2 100644
--- a/src/devices/machine/kb3600.h
+++ b/src/devices/machine/kb3600.h
@@ -64,31 +64,31 @@
//**************************************************************************
#define MCFG_AY3600_MATRIX_X0(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_x0_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_x0_cb(DEVCB_##_cb);
#define MCFG_AY3600_MATRIX_X1(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_x1_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_x1_cb(DEVCB_##_cb);
#define MCFG_AY3600_MATRIX_X2(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_x2_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_x2_cb(DEVCB_##_cb);
#define MCFG_AY3600_MATRIX_X3(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_x3_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_x3_cb(DEVCB_##_cb);
#define MCFG_AY3600_MATRIX_X4(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_x4_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_x4_cb(DEVCB_##_cb);
#define MCFG_AY3600_MATRIX_X5(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_x5_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_x5_cb(DEVCB_##_cb);
#define MCFG_AY3600_MATRIX_X6(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_x6_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_x6_cb(DEVCB_##_cb);
#define MCFG_AY3600_MATRIX_X7(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_x7_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_x7_cb(DEVCB_##_cb);
#define MCFG_AY3600_MATRIX_X8(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_x8_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_x8_cb(DEVCB_##_cb);
#define MCFG_AY3600_SHIFT_CB(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_shift_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_shift_cb(DEVCB_##_cb);
#define MCFG_AY3600_CONTROL_CB(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_control_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_control_cb(DEVCB_##_cb);
#define MCFG_AY3600_DATA_READY_CB(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_data_ready_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_data_ready_cb(DEVCB_##_cb);
#define MCFG_AY3600_AKO_CB(_cb) \
- devcb = &downcast<ay3600_device &>(*device).set_ako_cb(DEVCB_##_cb);
+ downcast<ay3600_device &>(*device).set_ako_cb(DEVCB_##_cb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/kr2376.h b/src/devices/machine/kr2376.h
index 49cfbb4f9cd..5a9529fd7c7 100644
--- a/src/devices/machine/kr2376.h
+++ b/src/devices/machine/kr2376.h
@@ -40,27 +40,27 @@
//**************************************************************************
#define MCFG_KR2376_MATRIX_X0(_cb) \
- devcb = &downcast<kr2376_device &>(*device).set_x_cb<0>(DEVCB_##_cb);
+ downcast<kr2376_device &>(*device).set_x_cb<0>(DEVCB_##_cb);
#define MCFG_KR2376_MATRIX_X1(_cb) \
- devcb = &downcast<kr2376_device &>(*device).set_x_cb<1>(DEVCB_##_cb);
+ downcast<kr2376_device &>(*device).set_x_cb<1>(DEVCB_##_cb);
#define MCFG_KR2376_MATRIX_X2(_cb) \
- devcb = &downcast<kr2376_device &>(*device).set_x_cb<2>(DEVCB_##_cb);
+ downcast<kr2376_device &>(*device).set_x_cb<2>(DEVCB_##_cb);
#define MCFG_KR2376_MATRIX_X3(_cb) \
- devcb = &downcast<kr2376_device &>(*device).set_x_cb<3>(DEVCB_##_cb);
+ downcast<kr2376_device &>(*device).set_x_cb<3>(DEVCB_##_cb);
#define MCFG_KR2376_MATRIX_X4(_cb) \
- devcb = &downcast<kr2376_device &>(*device).set_x_cb<4>(DEVCB_##_cb);
+ downcast<kr2376_device &>(*device).set_x_cb<4>(DEVCB_##_cb);
#define MCFG_KR2376_MATRIX_X5(_cb) \
- devcb = &downcast<kr2376_device &>(*device).set_x_cb<5>(DEVCB_##_cb);
+ downcast<kr2376_device &>(*device).set_x_cb<5>(DEVCB_##_cb);
#define MCFG_KR2376_MATRIX_X6(_cb) \
- devcb = &downcast<kr2376_device &>(*device).set_x_cb<6>(DEVCB_##_cb);
+ downcast<kr2376_device &>(*device).set_x_cb<6>(DEVCB_##_cb);
#define MCFG_KR2376_MATRIX_X7(_cb) \
- devcb = &downcast<kr2376_device &>(*device).set_x_cb<7>(DEVCB_##_cb);
+ downcast<kr2376_device &>(*device).set_x_cb<7>(DEVCB_##_cb);
#define MCFG_KR2376_SHIFT_CB(_cb) \
- devcb = &downcast<kr2376_device &>(*device).set_shift_cb(DEVCB_##_cb);
+ downcast<kr2376_device &>(*device).set_shift_cb(DEVCB_##_cb);
#define MCFG_KR2376_CONTROL_CB(_cb) \
- devcb = &downcast<kr2376_device &>(*device).set_control_cb(DEVCB_##_cb);
+ downcast<kr2376_device &>(*device).set_control_cb(DEVCB_##_cb);
#define MCFG_KR2376_STROBE_CB(_cb) \
- devcb = &downcast<kr2376_device &>(*device).set_strobe_cb(DEVCB_##_cb);
+ downcast<kr2376_device &>(*device).set_strobe_cb(DEVCB_##_cb);
class kr2376_device : public device_t
{
diff --git a/src/devices/machine/latch8.h b/src/devices/machine/latch8.h
index e7d3e0bb006..44644c5952c 100644
--- a/src/devices/machine/latch8.h
+++ b/src/devices/machine/latch8.h
@@ -131,53 +131,53 @@ DECLARE_DEVICE_TYPE(LATCH8, latch8_device)
/* Write bit to discrete node */
#define MCFG_LATCH8_WRITE_0(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_write_cb<0>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_write_cb<0>(DEVCB_##_devcb);
#define MCFG_LATCH8_WRITE_1(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_write_cb<1>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_write_cb<1>(DEVCB_##_devcb);
#define MCFG_LATCH8_WRITE_2(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_write_cb<2>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_write_cb<2>(DEVCB_##_devcb);
#define MCFG_LATCH8_WRITE_3(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_write_cb<3>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_write_cb<3>(DEVCB_##_devcb);
#define MCFG_LATCH8_WRITE_4(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_write_cb<4>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_write_cb<4>(DEVCB_##_devcb);
#define MCFG_LATCH8_WRITE_5(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_write_cb<5>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_write_cb<5>(DEVCB_##_devcb);
#define MCFG_LATCH8_WRITE_6(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_write_cb<6>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_write_cb<6>(DEVCB_##_devcb);
#define MCFG_LATCH8_WRITE_7(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_write_cb<7>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_write_cb<7>(DEVCB_##_devcb);
/* Upon read, replace bits by reading from another device handler */
#define MCFG_LATCH8_READ_0(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_read_cb<0>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_read_cb<0>(DEVCB_##_devcb);
#define MCFG_LATCH8_READ_1(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_read_cb<1>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_read_cb<1>(DEVCB_##_devcb);
#define MCFG_LATCH8_READ_2(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_read_cb<2>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_read_cb<2>(DEVCB_##_devcb);
#define MCFG_LATCH8_READ_3(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_read_cb<3>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_read_cb<3>(DEVCB_##_devcb);
#define MCFG_LATCH8_READ_4(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_read_cb<4>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_read_cb<4>(DEVCB_##_devcb);
#define MCFG_LATCH8_READ_5(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_read_cb<5>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_read_cb<5>(DEVCB_##_devcb);
#define MCFG_LATCH8_READ_6(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_read_cb<6>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_read_cb<6>(DEVCB_##_devcb);
#define MCFG_LATCH8_READ_7(_devcb) \
- devcb = &downcast<latch8_device &>(*device).set_read_cb<7>(DEVCB_##_devcb);
+ downcast<latch8_device &>(*device).set_read_cb<7>(DEVCB_##_devcb);
#endif // MAME_MACHINE_LATCH8_H
diff --git a/src/devices/machine/ldv1000.h b/src/devices/machine/ldv1000.h
index 11abc109f51..661d0a44f0b 100644
--- a/src/devices/machine/ldv1000.h
+++ b/src/devices/machine/ldv1000.h
@@ -27,7 +27,7 @@
MCFG_DEVICE_ADD(_tag, PIONEER_LDV1000, 0)
#define MCFG_LASERDISC_LDV1000_COMMAND_STROBE_CB(_cb) \
- devcb = &downcast<pioneer_ldv1000_device *>(device)->set_command_strobe_callback(DEVCB_##_cb);
+ downcast<pioneer_ldv1000_device *>(device)->set_command_strobe_callback(DEVCB_##_cb);
diff --git a/src/devices/machine/lh5810.h b/src/devices/machine/lh5810.h
index 51b288be8e3..776e5497d56 100644
--- a/src/devices/machine/lh5810.h
+++ b/src/devices/machine/lh5810.h
@@ -17,22 +17,22 @@
//*************************************************************************
#define MCFG_LH5810_PORTA_R_CB(_devcb) \
- devcb = &downcast<lh5810_device &>(*device).set_porta_r_callback(DEVCB_##_devcb);
+ downcast<lh5810_device &>(*device).set_porta_r_callback(DEVCB_##_devcb);
#define MCFG_LH5810_PORTA_W_CB(_devcb) \
- devcb = &downcast<lh5810_device &>(*device).set_porta_w_callback(DEVCB_##_devcb);
+ downcast<lh5810_device &>(*device).set_porta_w_callback(DEVCB_##_devcb);
#define MCFG_LH5810_PORTB_R_CB(_devcb) \
- devcb = &downcast<lh5810_device &>(*device).set_portb_r_callback(DEVCB_##_devcb);
+ downcast<lh5810_device &>(*device).set_portb_r_callback(DEVCB_##_devcb);
#define MCFG_LH5810_PORTB_W_CB(_devcb) \
- devcb = &downcast<lh5810_device &>(*device).set_portb_w_callback(DEVCB_##_devcb);
+ downcast<lh5810_device &>(*device).set_portb_w_callback(DEVCB_##_devcb);
#define MCFG_LH5810_PORTC_W_CB(_devcb) \
- devcb = &downcast<lh5810_device &>(*device).set_portc_w_callback(DEVCB_##_devcb);
+ downcast<lh5810_device &>(*device).set_portc_w_callback(DEVCB_##_devcb);
#define MCFG_LH5810_OUT_INT_CB(_devcb) \
- devcb = &downcast<lh5810_device &>(*device).set_out_int_callback(DEVCB_##_devcb); //currently unused
+ downcast<lh5810_device &>(*device).set_out_int_callback(DEVCB_##_devcb); //currently unused
diff --git a/src/devices/machine/mb8421.h b/src/devices/machine/mb8421.h
index 705e4c0c1e7..e0ac6edd610 100644
--- a/src/devices/machine/mb8421.h
+++ b/src/devices/machine/mb8421.h
@@ -20,10 +20,10 @@
// note: INT pins are only available on MB84x1
// INTL is for the CPU on the left side, INTR for the one on the right
#define MCFG_MB8421_INTL_HANDLER(_devcb) \
- devcb = &downcast<mb8421_master_device &>(*device).set_intl_handler(DEVCB_##_devcb);
+ downcast<mb8421_master_device &>(*device).set_intl_handler(DEVCB_##_devcb);
#define MCFG_MB8421_INTR_HANDLER(_devcb) \
- devcb = &downcast<mb8421_master_device &>(*device).set_intr_handler(DEVCB_##_devcb);
+ downcast<mb8421_master_device &>(*device).set_intr_handler(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/mb87078.h b/src/devices/machine/mb87078.h
index bb7700bbfcf..61ef9aac8ea 100644
--- a/src/devices/machine/mb87078.h
+++ b/src/devices/machine/mb87078.h
@@ -18,7 +18,7 @@
***************************************************************************/
#define MCFG_MB87078_GAIN_CHANGED_CB(_devcb) \
- devcb = &downcast<mb87078_device &>(*device).set_gain_changed_callback(DEVCB_##_devcb);
+ downcast<mb87078_device &>(*device).set_gain_changed_callback(DEVCB_##_devcb);
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/devices/machine/mb8795.h b/src/devices/machine/mb8795.h
index 018ef6ef1e6..a3b6e6244cc 100644
--- a/src/devices/machine/mb8795.h
+++ b/src/devices/machine/mb8795.h
@@ -9,16 +9,16 @@
downcast<mb8795_device *>(device)->set_drq_cb(_tx_drq, _rx_drq);
#define MCFG_MB8795_TX_IRQ_CALLBACK(_write) \
- devcb = &downcast<mb8795_device &>(*device).set_tx_irq_wr_callback(DEVCB_##_write);
+ downcast<mb8795_device &>(*device).set_tx_irq_wr_callback(DEVCB_##_write);
#define MCFG_MB8795_RX_IRQ_CALLBACK(_write) \
- devcb = &downcast<mb8795_device &>(*device).set_rx_irq_wr_callback(DEVCB_##_write);
+ downcast<mb8795_device &>(*device).set_rx_irq_wr_callback(DEVCB_##_write);
#define MCFG_MB8795_TX_DRQ_CALLBACK(_write) \
- devcb = &downcast<mb8795_device &>(*device).set_tx_drq_wr_callback(DEVCB_##_write);
+ downcast<mb8795_device &>(*device).set_tx_drq_wr_callback(DEVCB_##_write);
#define MCFG_MB8795_RX_DRQ_CALLBACK(_write) \
- devcb = &downcast<mb8795_device &>(*device).set_rx_drq_wr_callback(DEVCB_##_write);
+ downcast<mb8795_device &>(*device).set_rx_drq_wr_callback(DEVCB_##_write);
class mb8795_device : public device_t,
public device_network_interface
diff --git a/src/devices/machine/mb89352.h b/src/devices/machine/mb89352.h
index b30b1601fd0..dce6fe59ce9 100644
--- a/src/devices/machine/mb89352.h
+++ b/src/devices/machine/mb89352.h
@@ -12,10 +12,10 @@
#include "legscsi.h"
#define MCFG_MB89352A_IRQ_CB(_devcb) \
- devcb = &downcast<mb89352_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<mb89352_device &>(*device).set_irq_callback(DEVCB_##_devcb);
#define MCFG_MB89352A_DRQ_CB(_devcb) \
- devcb = &downcast<mb89352_device &>(*device).set_drq_callback(DEVCB_##_devcb);
+ downcast<mb89352_device &>(*device).set_drq_callback(DEVCB_##_devcb);
class mb89352_device : public legacy_scsi_host_adapter
{
diff --git a/src/devices/machine/mb89363b.h b/src/devices/machine/mb89363b.h
index 2aaad46c28e..755730d05aa 100644
--- a/src/devices/machine/mb89363b.h
+++ b/src/devices/machine/mb89363b.h
@@ -24,41 +24,41 @@ DECLARE_DEVICE_TYPE(MB89363B, mb89363b_device)
#define MCFG_MB89363B_IN_PORTA_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_in_a_pa_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_in_a_pa_callback(DEVCB_##_devcb);
#define MCFG_MB89363B_IN_PORTB_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_in_a_pb_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_in_a_pb_callback(DEVCB_##_devcb);
#define MCFG_MB89363B_IN_PORTC_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_in_a_pc_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_in_a_pc_callback(DEVCB_##_devcb);
#define MCFG_MB89363B_OUT_PORTA_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_out_a_pa_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_out_a_pa_callback(DEVCB_##_devcb);
#define MCFG_MB89363B_OUT_PORTB_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_out_a_pb_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_out_a_pb_callback(DEVCB_##_devcb);
#define MCFG_MB89363B_OUT_PORTC_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_out_a_pc_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_out_a_pc_callback(DEVCB_##_devcb);
#define MCFG_MB89363B_IN_PORTD_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_in_b_pa_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_in_b_pa_callback(DEVCB_##_devcb);
#define MCFG_MB89363B_IN_PORTE_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_in_b_pb_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_in_b_pb_callback(DEVCB_##_devcb);
#define MCFG_MB89363B_IN_PORTF_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_in_b_pc_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_in_b_pc_callback(DEVCB_##_devcb);
#define MCFG_MB89363B_OUT_PORTD_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_out_b_pa_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_out_b_pa_callback(DEVCB_##_devcb);
#define MCFG_MB89363B_OUT_PORTE_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_out_b_pb_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_out_b_pb_callback(DEVCB_##_devcb);
#define MCFG_MB89363B_OUT_PORTF_CB(_devcb) \
- devcb = &downcast<mb89363b_device &>(*device).set_out_b_pc_callback(DEVCB_##_devcb);
+ downcast<mb89363b_device &>(*device).set_out_b_pc_callback(DEVCB_##_devcb);
diff --git a/src/devices/machine/mb89374.h b/src/devices/machine/mb89374.h
index 460a4c2c6dc..1ee70cfff58 100644
--- a/src/devices/machine/mb89374.h
+++ b/src/devices/machine/mb89374.h
@@ -42,19 +42,19 @@ Data Link Controller
//**************************************************************************
#define MCFG_MB89374_IRQ_CB(_devcb) \
- devcb = &downcast<mb89374_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
+ downcast<mb89374_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_MB89374_PO0_CB(_devcb) \
- devcb = &downcast<mb89374_device &>(*device).set_out_po_callback<0>(DEVCB_##_devcb);
+ downcast<mb89374_device &>(*device).set_out_po_callback<0>(DEVCB_##_devcb);
#define MCFG_MB89374_PO1_CB(_devcb) \
- devcb = &downcast<mb89374_device &>(*device).set_out_po_callback<1>(DEVCB_##_devcb);
+ downcast<mb89374_device &>(*device).set_out_po_callback<1>(DEVCB_##_devcb);
#define MCFG_MB89374_PO2_CB(_devcb) \
- devcb = &downcast<mb89374_device &>(*device).set_out_po_callback<2>(DEVCB_##_devcb);
+ downcast<mb89374_device &>(*device).set_out_po_callback<2>(DEVCB_##_devcb);
#define MCFG_MB89374_PO3_CB(_devcb) \
- devcb = &downcast<mb89374_device &>(*device).set_out_po_callback<3>(DEVCB_##_devcb);
+ downcast<mb89374_device &>(*device).set_out_po_callback<3>(DEVCB_##_devcb);
class mb89374_device : public device_t,
diff --git a/src/devices/machine/mc14411.h b/src/devices/machine/mc14411.h
index 002ca5de65f..ef5196ef363 100644
--- a/src/devices/machine/mc14411.h
+++ b/src/devices/machine/mc14411.h
@@ -31,22 +31,22 @@
// DEVICE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_MC14411_F1_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb( 0, DEVCB_##_devcb);
-#define MCFG_MC14411_F2_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb( 1, DEVCB_##_devcb);
-#define MCFG_MC14411_F3_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb( 2, DEVCB_##_devcb);
-#define MCFG_MC14411_F4_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb( 3, DEVCB_##_devcb);
-#define MCFG_MC14411_F5_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb( 4, DEVCB_##_devcb);
-#define MCFG_MC14411_F6_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb( 5, DEVCB_##_devcb);
-#define MCFG_MC14411_F7_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb( 6, DEVCB_##_devcb);
-#define MCFG_MC14411_F8_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb( 7, DEVCB_##_devcb);
-#define MCFG_MC14411_F9_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb( 8, DEVCB_##_devcb);
-#define MCFG_MC14411_F10_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb( 9, DEVCB_##_devcb);
-#define MCFG_MC14411_F11_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb(10, DEVCB_##_devcb);
-#define MCFG_MC14411_F12_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb(11, DEVCB_##_devcb);
-#define MCFG_MC14411_F13_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb(12, DEVCB_##_devcb);
-#define MCFG_MC14411_F14_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb(13, DEVCB_##_devcb);
-#define MCFG_MC14411_F15_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb(14, DEVCB_##_devcb);
-#define MCFG_MC14411_F16_CB(_devcb) devcb = &downcast<mc14411_device &>(*device).set_out_fx_cb(15, DEVCB_##_devcb);
+#define MCFG_MC14411_F1_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb( 0, DEVCB_##_devcb);
+#define MCFG_MC14411_F2_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb( 1, DEVCB_##_devcb);
+#define MCFG_MC14411_F3_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb( 2, DEVCB_##_devcb);
+#define MCFG_MC14411_F4_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb( 3, DEVCB_##_devcb);
+#define MCFG_MC14411_F5_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb( 4, DEVCB_##_devcb);
+#define MCFG_MC14411_F6_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb( 5, DEVCB_##_devcb);
+#define MCFG_MC14411_F7_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb( 6, DEVCB_##_devcb);
+#define MCFG_MC14411_F8_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb( 7, DEVCB_##_devcb);
+#define MCFG_MC14411_F9_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb( 8, DEVCB_##_devcb);
+#define MCFG_MC14411_F10_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb( 9, DEVCB_##_devcb);
+#define MCFG_MC14411_F11_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb(10, DEVCB_##_devcb);
+#define MCFG_MC14411_F12_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb(11, DEVCB_##_devcb);
+#define MCFG_MC14411_F13_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb(12, DEVCB_##_devcb);
+#define MCFG_MC14411_F14_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb(13, DEVCB_##_devcb);
+#define MCFG_MC14411_F15_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb(14, DEVCB_##_devcb);
+#define MCFG_MC14411_F16_CB(_devcb) downcast<mc14411_device &>(*device).set_out_fx_cb(15, DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -87,6 +87,22 @@ public:
mc14411_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <class Object> devcb_base &set_out_fx_cb(int index, Object &&cb) { return m_out_fx_cbs[index].set_callback(std::forward<Object>(cb)); }
+ auto out_f1_cb() { return m_out_fx_cbs[0].bind(); }
+ auto out_f2_cb() { return m_out_fx_cbs[1].bind(); }
+ auto out_f3_cb() { return m_out_fx_cbs[2].bind(); }
+ auto out_f4_cb() { return m_out_fx_cbs[3].bind(); }
+ auto out_f5_cb() { return m_out_fx_cbs[4].bind(); }
+ auto out_f6_cb() { return m_out_fx_cbs[5].bind(); }
+ auto out_f7_cb() { return m_out_fx_cbs[6].bind(); }
+ auto out_f8_cb() { return m_out_fx_cbs[7].bind(); }
+ auto out_f9_cb() { return m_out_fx_cbs[8].bind(); }
+ auto out_f10_cb() { return m_out_fx_cbs[9].bind(); }
+ auto out_f11_cb() { return m_out_fx_cbs[10].bind(); }
+ auto out_f12_cb() { return m_out_fx_cbs[11].bind(); }
+ auto out_f13_cb() { return m_out_fx_cbs[12].bind(); }
+ auto out_f14_cb() { return m_out_fx_cbs[13].bind(); }
+ auto out_f15_cb() { return m_out_fx_cbs[14].bind(); }
+ auto out_f16_cb() { return m_out_fx_cbs[15].bind(); }
DECLARE_WRITE_LINE_MEMBER(reset_w);
DECLARE_WRITE8_MEMBER(rate_select_w);
diff --git a/src/devices/machine/mc146818.h b/src/devices/machine/mc146818.h
index 3bc79fb7d67..7b396e81320 100644
--- a/src/devices/machine/mc146818.h
+++ b/src/devices/machine/mc146818.h
@@ -22,7 +22,7 @@
//**************************************************************************
#define MCFG_MC146818_IRQ_HANDLER(_irq) \
- devcb = &downcast<mc146818_device &>(*device).set_irq_callback(DEVCB_##_irq);
+ downcast<mc146818_device &>(*device).set_irq_callback(DEVCB_##_irq);
// The MC146818 doesn't have century support, but when syncing the date & time at startup we can optionally store the century.
#define MCFG_MC146818_CENTURY_INDEX(_century_index) \
@@ -59,6 +59,8 @@ public:
// callbacks
template <class Object> devcb_base &set_irq_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ auto irq_callback() { return m_write_irq.bind(); }
+
void set_century_index(int century_index) { m_century_index = century_index; }
void set_use_utc(bool use_utc) { m_use_utc = use_utc; }
void set_binary(bool binary) { m_binary = binary; }
diff --git a/src/devices/machine/mc2661.h b/src/devices/machine/mc2661.h
index b4e575cd53b..44e319a292d 100644
--- a/src/devices/machine/mc2661.h
+++ b/src/devices/machine/mc2661.h
@@ -42,28 +42,28 @@
downcast<mc2661_device &>(*device).set_txc(_clock);
#define MCFG_MC2661_TXD_HANDLER(_write) \
- devcb = &downcast<mc2661_device &>(*device).set_txd_callback(DEVCB_##_write);
+ downcast<mc2661_device &>(*device).set_txd_callback(DEVCB_##_write);
#define MCFG_MC2661_RXRDY_HANDLER(_write) \
- devcb = &downcast<mc2661_device &>(*device).set_rxrdy_callback(DEVCB_##_write);
+ downcast<mc2661_device &>(*device).set_rxrdy_callback(DEVCB_##_write);
#define MCFG_MC2661_TXRDY_HANDLER(_write) \
- devcb = &downcast<mc2661_device &>(*device).set_txrdy_callback(DEVCB_##_write);
+ downcast<mc2661_device &>(*device).set_txrdy_callback(DEVCB_##_write);
#define MCFG_MC2661_RTS_HANDLER(_write) \
- devcb = &downcast<mc2661_device &>(*device).set_rts_callback(DEVCB_##_write);
+ downcast<mc2661_device &>(*device).set_rts_callback(DEVCB_##_write);
#define MCFG_MC2661_DTR_HANDLER(_write) \
- devcb = &downcast<mc2661_device &>(*device).set_dtr_callback(DEVCB_##_write);
+ downcast<mc2661_device &>(*device).set_dtr_callback(DEVCB_##_write);
#define MCFG_MC2661_TXEMT_DSCHG_HANDLER(_write) \
- devcb = &downcast<mc2661_device &>(*device).set_txemt_dschg_callback(DEVCB_##_write);
+ downcast<mc2661_device &>(*device).set_txemt_dschg_callback(DEVCB_##_write);
#define MCFG_MC2661_BKDET_HANDLER(_write) \
- devcb = &downcast<mc2661_device &>(*device).set_bkdet_callback(DEVCB_##_write);
+ downcast<mc2661_device &>(*device).set_bkdet_callback(DEVCB_##_write);
#define MCFG_MC2661_XSYNC_HANDLER(_write) \
- devcb = &downcast<mc2661_device &>(*device).set_xsync_callback(DEVCB_##_write);
+ downcast<mc2661_device &>(*device).set_xsync_callback(DEVCB_##_write);
diff --git a/src/devices/machine/mc68328.h b/src/devices/machine/mc68328.h
index 61df82ebe16..f146c6856c5 100644
--- a/src/devices/machine/mc68328.h
+++ b/src/devices/machine/mc68328.h
@@ -389,76 +389,76 @@ DECLARE_DEVICE_TYPE(MC68328, mc68328_device)
downcast<mc68328_device &>(*device).set_cpu_tag(_tag);
#define MCFG_MC68328_OUT_PORT_A_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_port_a_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_port_a_callback(DEVCB_##_devcb);
#define MCFG_MC68328_OUT_PORT_B_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_port_b_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_port_b_callback(DEVCB_##_devcb);
#define MCFG_MC68328_OUT_PORT_C_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_port_c_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_port_c_callback(DEVCB_##_devcb);
#define MCFG_MC68328_OUT_PORT_D_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_port_d_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_port_d_callback(DEVCB_##_devcb);
#define MCFG_MC68328_OUT_PORT_E_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_port_e_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_port_e_callback(DEVCB_##_devcb);
#define MCFG_MC68328_OUT_PORT_F_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_port_f_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_port_f_callback(DEVCB_##_devcb);
#define MCFG_MC68328_OUT_PORT_G_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_port_g_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_port_g_callback(DEVCB_##_devcb);
#define MCFG_MC68328_OUT_PORT_J_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_port_j_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_port_j_callback(DEVCB_##_devcb);
#define MCFG_MC68328_OUT_PORT_K_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_port_k_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_port_k_callback(DEVCB_##_devcb);
#define MCFG_MC68328_OUT_PORT_M_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_port_m_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_port_m_callback(DEVCB_##_devcb);
#define MCFG_MC68328_IN_PORT_A_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_in_port_a_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_in_port_a_callback(DEVCB_##_devcb);
#define MCFG_MC68328_IN_PORT_B_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_in_port_b_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_in_port_b_callback(DEVCB_##_devcb);
#define MCFG_MC68328_IN_PORT_C_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_in_port_c_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_in_port_c_callback(DEVCB_##_devcb);
#define MCFG_MC68328_IN_PORT_D_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_in_port_d_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_in_port_d_callback(DEVCB_##_devcb);
#define MCFG_MC68328_IN_PORT_E_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_in_port_e_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_in_port_e_callback(DEVCB_##_devcb);
#define MCFG_MC68328_IN_PORT_F_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_in_port_f_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_in_port_f_callback(DEVCB_##_devcb);
#define MCFG_MC68328_IN_PORT_G_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_in_port_g_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_in_port_g_callback(DEVCB_##_devcb);
#define MCFG_MC68328_IN_PORT_J_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_in_port_j_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_in_port_j_callback(DEVCB_##_devcb);
#define MCFG_MC68328_IN_PORT_K_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_in_port_k_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_in_port_k_callback(DEVCB_##_devcb);
#define MCFG_MC68328_IN_PORT_M_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_in_port_m_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_in_port_m_callback(DEVCB_##_devcb);
#define MCFG_MC68328_OUT_PWM_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_pwm_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_pwm_callback(DEVCB_##_devcb);
#define MCFG_MC68328_OUT_SPIM_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_out_spim_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_out_spim_callback(DEVCB_##_devcb);
#define MCFG_MC68328_IN_SPIM_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_in_spim_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_in_spim_callback(DEVCB_##_devcb);
#define MCFG_MC68328_SPIM_XCH_TRIGGER_CB(_devcb) \
- devcb = &downcast<mc68328_device &>(*device).set_spim_xch_trigger_callback(DEVCB_##_devcb);
+ downcast<mc68328_device &>(*device).set_spim_xch_trigger_callback(DEVCB_##_devcb);
#endif // MAME_MACHINE_MC68328_H
diff --git a/src/devices/machine/mc6843.h b/src/devices/machine/mc6843.h
index ef5e457958a..54f6fff58a3 100644
--- a/src/devices/machine/mc6843.h
+++ b/src/devices/machine/mc6843.h
@@ -16,7 +16,7 @@
#include "imagedev/flopdrv.h"
#define MCFG_MC6843_IRQ_CALLBACK(_write) \
- devcb = &downcast<mc6843_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
+ downcast<mc6843_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
class mc6843_device : public device_t
{
diff --git a/src/devices/machine/mc6846.h b/src/devices/machine/mc6846.h
index 676db3129f9..c5870dc6c39 100644
--- a/src/devices/machine/mc6846.h
+++ b/src/devices/machine/mc6846.h
@@ -15,22 +15,22 @@
#define MCFG_MC6846_OUT_PORT_CB(_devcb) \
- devcb = &downcast<mc6846_device &>(*device).set_out_port_callback(DEVCB_##_devcb);
+ downcast<mc6846_device &>(*device).set_out_port_callback(DEVCB_##_devcb);
#define MCFG_MC6846_OUT_CP1_CB(_devcb) \
- devcb = &downcast<mc6846_device &>(*device).set_out_cp1_callback(DEVCB_##_devcb);
+ downcast<mc6846_device &>(*device).set_out_cp1_callback(DEVCB_##_devcb);
#define MCFG_MC6846_OUT_CP2_CB(_devcb) \
- devcb = &downcast<mc6846_device &>(*device).set_out_cp2_callback(DEVCB_##_devcb);
+ downcast<mc6846_device &>(*device).set_out_cp2_callback(DEVCB_##_devcb);
#define MCFG_MC6846_IN_PORT_CB(_devcb) \
- devcb = &downcast<mc6846_device &>(*device).set_in_port_callback(DEVCB_##_devcb);
+ downcast<mc6846_device &>(*device).set_in_port_callback(DEVCB_##_devcb);
#define MCFG_MC6846_OUT_CTO_CB(_devcb) \
- devcb = &downcast<mc6846_device &>(*device).set_out_cto_callback(DEVCB_##_devcb);
+ downcast<mc6846_device &>(*device).set_out_cto_callback(DEVCB_##_devcb);
#define MCFG_MC6846_IRQ_CB(_devcb) \
- devcb = &downcast<mc6846_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<mc6846_device &>(*device).set_irq_callback(DEVCB_##_devcb);
class mc6846_device : public device_t
diff --git a/src/devices/machine/mc6852.h b/src/devices/machine/mc6852.h
index 2ca977cacdc..43076544e45 100644
--- a/src/devices/machine/mc6852.h
+++ b/src/devices/machine/mc6852.h
@@ -42,16 +42,16 @@
downcast<mc6852_device &>(*device).set_tx_clock(_clock);
#define MCFG_MC6852_TX_DATA_CALLBACK(_write) \
- devcb = &downcast<mc6852_device &>(*device).set_tx_data_wr_callback(DEVCB_##_write);
+ downcast<mc6852_device &>(*device).set_tx_data_wr_callback(DEVCB_##_write);
#define MCFG_MC6852_IRQ_CALLBACK(_write) \
- devcb = &downcast<mc6852_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
+ downcast<mc6852_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_MC6852_SM_DTR_CALLBACK(_write) \
- devcb = &downcast<mc6852_device &>(*device).set_sm_dtr_wr_callback(DEVCB_##_write);
+ downcast<mc6852_device &>(*device).set_sm_dtr_wr_callback(DEVCB_##_write);
#define MCFG_MC6852_TUF_CALLBACK(_write) \
- devcb = &downcast<mc6852_device &>(*device).set_tuf_wr_callback(DEVCB_##_write);
+ downcast<mc6852_device &>(*device).set_tuf_wr_callback(DEVCB_##_write);
diff --git a/src/devices/machine/mc6854.h b/src/devices/machine/mc6854.h
index 36548024bfd..a43cb4fa57c 100644
--- a/src/devices/machine/mc6854.h
+++ b/src/devices/machine/mc6854.h
@@ -18,19 +18,19 @@
#define MCFG_MC6854_OUT_IRQ_CB(_devcb) \
- devcb = &downcast<mc6854_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
+ downcast<mc6854_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_MC6854_OUT_TXD_CB(_devcb) \
- devcb = &downcast<mc6854_device &>(*device).set_out_txd_callback(DEVCB_##_devcb);
+ downcast<mc6854_device &>(*device).set_out_txd_callback(DEVCB_##_devcb);
#define MCFG_MC6854_OUT_FRAME_CB(_class, _method) \
downcast<mc6854_device &>(*device).set_out_frame_callback(mc6854_device::out_frame_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_MC6854_OUT_RTS_CB(_devcb) \
- devcb = &downcast<mc6854_device &>(*device).set_out_rts_callback(DEVCB_##_devcb);
+ downcast<mc6854_device &>(*device).set_out_rts_callback(DEVCB_##_devcb);
#define MCFG_MC6854_OUT_DTR_CB(_devcb) \
- devcb = &downcast<mc6854_device &>(*device).set_out_dtr_callback(DEVCB_##_devcb);
+ downcast<mc6854_device &>(*device).set_out_dtr_callback(DEVCB_##_devcb);
class mc6854_device : public device_t
diff --git a/src/devices/machine/mc68681.h b/src/devices/machine/mc68681.h
index 9b907ab703d..9a706ee6087 100644
--- a/src/devices/machine/mc68681.h
+++ b/src/devices/machine/mc68681.h
@@ -8,30 +8,30 @@
#include "diserial.h"
#define MCFG_MC68681_IRQ_CALLBACK(_cb) \
- devcb = &downcast<duart_base_device &>(*device).set_irq_cb(DEVCB_##_cb);
+ downcast<duart_base_device &>(*device).set_irq_cb(DEVCB_##_cb);
#define MCFG_MC68681_A_TX_CALLBACK(_cb) \
- devcb = &downcast<duart_base_device &>(*device).set_a_tx_cb(DEVCB_##_cb);
+ downcast<duart_base_device &>(*device).set_a_tx_cb(DEVCB_##_cb);
#define MCFG_MC68681_B_TX_CALLBACK(_cb) \
- devcb = &downcast<duart_base_device &>(*device).set_b_tx_cb(DEVCB_##_cb);
+ downcast<duart_base_device &>(*device).set_b_tx_cb(DEVCB_##_cb);
// deprecated: use ipX_w() instead
#define MCFG_MC68681_INPORT_CALLBACK(_cb) \
- devcb = &downcast<duart_base_device &>(*device).set_inport_cb(DEVCB_##_cb);
+ downcast<duart_base_device &>(*device).set_inport_cb(DEVCB_##_cb);
#define MCFG_MC68681_OUTPORT_CALLBACK(_cb) \
- devcb = &downcast<duart_base_device &>(*device).set_outport_cb(DEVCB_##_cb);
+ downcast<duart_base_device &>(*device).set_outport_cb(DEVCB_##_cb);
#define MCFG_MC68681_SET_EXTERNAL_CLOCKS(_a, _b, _c, _d) \
downcast<duart_base_device &>(*device).set_clocks(_a, _b, _c, _d);
// SC28C94 specific callbacks
#define MCFG_SC28C94_C_TX_CALLBACK(_cb) \
- devcb = &downcast<sc28c94_device &>(*device).set_c_tx_cb(DEVCB_##_cb);
+ downcast<sc28c94_device &>(*device).set_c_tx_cb(DEVCB_##_cb);
#define MCFG_SC28C94_D_TX_CALLBACK(_cb) \
- devcb = &downcast<sc28c94_device &>(*device).set_d_tx_cb(DEVCB_##_cb);
+ downcast<sc28c94_device &>(*device).set_d_tx_cb(DEVCB_##_cb);
#define MC68681_RX_FIFO_SIZE 3
@@ -131,6 +131,11 @@ public:
template <class Object> devcb_base &set_b_tx_cb(Object &&cb) { return write_b_tx.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_inport_cb(Object &&cb) { return read_inport.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_outport_cb(Object &&cb) { return write_outport.set_callback(std::forward<Object>(cb)); }
+ auto irq_cb() { return write_irq.bind(); }
+ auto a_tx_cb() { return write_a_tx.bind(); }
+ auto b_tx_cb() { return write_b_tx.bind(); }
+ auto inport_cb() { return read_inport.bind(); }
+ auto outport_cb() { return write_outport.bind(); }
// new-style push handlers for input port bits
DECLARE_WRITE_LINE_MEMBER( ip0_w );
diff --git a/src/devices/machine/mc68901.h b/src/devices/machine/mc68901.h
index b4a3e2a17b1..efba92e734b 100644
--- a/src/devices/machine/mc68901.h
+++ b/src/devices/machine/mc68901.h
@@ -55,31 +55,31 @@
downcast<mc68901_device &>(*device).set_tx_clock(_clk);
#define MCFG_MC68901_OUT_IRQ_CB(_devcb) \
- devcb = &downcast<mc68901_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
+ downcast<mc68901_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_MC68901_OUT_GPIO_CB(_devcb) \
- devcb = &downcast<mc68901_device &>(*device).set_out_gpio_callback(DEVCB_##_devcb);
+ downcast<mc68901_device &>(*device).set_out_gpio_callback(DEVCB_##_devcb);
#define MCFG_MC68901_OUT_TAO_CB(_devcb) \
- devcb = &downcast<mc68901_device &>(*device).set_out_tao_callback(DEVCB_##_devcb);
+ downcast<mc68901_device &>(*device).set_out_tao_callback(DEVCB_##_devcb);
#define MCFG_MC68901_OUT_TBO_CB(_devcb) \
- devcb = &downcast<mc68901_device &>(*device).set_out_tbo_callback(DEVCB_##_devcb);
+ downcast<mc68901_device &>(*device).set_out_tbo_callback(DEVCB_##_devcb);
#define MCFG_MC68901_OUT_TCO_CB(_devcb) \
- devcb = &downcast<mc68901_device &>(*device).set_out_tco_callback(DEVCB_##_devcb);
+ downcast<mc68901_device &>(*device).set_out_tco_callback(DEVCB_##_devcb);
#define MCFG_MC68901_OUT_TDO_CB(_devcb) \
- devcb = &downcast<mc68901_device &>(*device).set_out_tdo_callback(DEVCB_##_devcb);
+ downcast<mc68901_device &>(*device).set_out_tdo_callback(DEVCB_##_devcb);
#define MCFG_MC68901_OUT_SO_CB(_devcb) \
- devcb = &downcast<mc68901_device &>(*device).set_out_so_callback(DEVCB_##_devcb);
+ downcast<mc68901_device &>(*device).set_out_so_callback(DEVCB_##_devcb);
/*#define MCFG_MC68901_OUT_RR_CB(_devcb) \
- devcb = &downcast<mc68901_device &>(*device).set_out_rr_callback(DEVCB_##_devcb);
+ downcast<mc68901_device &>(*device).set_out_rr_callback(DEVCB_##_devcb);
#define MCFG_MC68901_OUT_TR_CB(_devcb) \
- devcb = &downcast<mc68901_device &>(*device).set_out_tr_callback(DEVCB_##_devcb);*/
+ downcast<mc68901_device &>(*device).set_out_tr_callback(DEVCB_##_devcb);*/
//**************************************************************************
diff --git a/src/devices/machine/mccs1850.h b/src/devices/machine/mccs1850.h
index 8241203c3aa..bd7771bc6a0 100644
--- a/src/devices/machine/mccs1850.h
+++ b/src/devices/machine/mccs1850.h
@@ -31,13 +31,13 @@
//**************************************************************************
#define MCFG_MCCS1850_INT_CALLBACK(_write) \
- devcb = &downcast<mccs1850_device &>(*device).set_int_wr_callback(DEVCB_##_write);
+ downcast<mccs1850_device &>(*device).set_int_wr_callback(DEVCB_##_write);
#define MCFG_MCCS1850_PSE_CALLBACK(_write) \
- devcb = &downcast<mccs1850_device &>(*device).set_pse_wr_callback(DEVCB_##_write);
+ downcast<mccs1850_device &>(*device).set_pse_wr_callback(DEVCB_##_write);
#define MCFG_MCCS1850_NUC_CALLBACK(_write) \
- devcb = &downcast<mccs1850_device &>(*device).set_nuc_wr_callback(DEVCB_##_write);
+ downcast<mccs1850_device &>(*device).set_nuc_wr_callback(DEVCB_##_write);
diff --git a/src/devices/machine/microtch.h b/src/devices/machine/microtch.h
index fcff6cfd552..9efa11d7eb0 100644
--- a/src/devices/machine/microtch.h
+++ b/src/devices/machine/microtch.h
@@ -74,7 +74,7 @@ DECLARE_DEVICE_TYPE(MICROTOUCH, microtouch_device)
#define MCFG_MICROTOUCH_ADD(_tag, _clock, _devcb) \
MCFG_DEVICE_ADD(_tag, MICROTOUCH, _clock) \
- devcb = &downcast<microtouch_device &>(*device).set_stx_callback(DEVCB_##_devcb);
+ downcast<microtouch_device &>(*device).set_stx_callback(DEVCB_##_devcb);
#define MCFG_MICROTOUCH_TOUCH_CB(_class, _touch_cb) \
downcast<microtouch_device &>(*device).set_touch_callback(microtouch_device::touch_cb(&_class::_touch_cb, this));
diff --git a/src/devices/machine/mm5740.h b/src/devices/machine/mm5740.h
index bbdc12f5c47..e28fbdc0956 100644
--- a/src/devices/machine/mm5740.h
+++ b/src/devices/machine/mm5740.h
@@ -83,18 +83,18 @@ Vgg 18 -12V
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_MM5740_MATRIX_X1(_cb) devcb = &downcast<mm5740_device &>(*device).set_x_cb<0>(DEVCB_##_cb);
-#define MCFG_MM5740_MATRIX_X2(_cb) devcb = &downcast<mm5740_device &>(*device).set_x_cb<1>(DEVCB_##_cb);
-#define MCFG_MM5740_MATRIX_X3(_cb) devcb = &downcast<mm5740_device &>(*device).set_x_cb<2>(DEVCB_##_cb);
-#define MCFG_MM5740_MATRIX_X4(_cb) devcb = &downcast<mm5740_device &>(*device).set_x_cb<3>(DEVCB_##_cb);
-#define MCFG_MM5740_MATRIX_X5(_cb) devcb = &downcast<mm5740_device &>(*device).set_x_cb<4>(DEVCB_##_cb);
-#define MCFG_MM5740_MATRIX_X6(_cb) devcb = &downcast<mm5740_device &>(*device).set_x_cb<5>(DEVCB_##_cb);
-#define MCFG_MM5740_MATRIX_X7(_cb) devcb = &downcast<mm5740_device &>(*device).set_x_cb<6>(DEVCB_##_cb);
-#define MCFG_MM5740_MATRIX_X8(_cb) devcb = &downcast<mm5740_device &>(*device).set_x_cb<7>(DEVCB_##_cb);
-#define MCFG_MM5740_MATRIX_X9(_cb) devcb = &downcast<mm5740_device &>(*device).set_x_cb<8>(DEVCB_##_cb);
-#define MCFG_MM5740_SHIFT_CB(_cb) devcb = &downcast<mm5740_device &>(*device).set_shift_cb(DEVCB_##_cb);
-#define MCFG_MM5740_CONTROL_CB(_cb) devcb = &downcast<mm5740_device &>(*device).set_control_cb(DEVCB_##_cb);
-#define MCFG_MM5740_DATA_READY_CB(_cb) devcb = &downcast<mm5740_device &>(*device).set_data_ready_cb(DEVCB_##_cb);
+#define MCFG_MM5740_MATRIX_X1(_cb) downcast<mm5740_device &>(*device).set_x_cb<0>(DEVCB_##_cb);
+#define MCFG_MM5740_MATRIX_X2(_cb) downcast<mm5740_device &>(*device).set_x_cb<1>(DEVCB_##_cb);
+#define MCFG_MM5740_MATRIX_X3(_cb) downcast<mm5740_device &>(*device).set_x_cb<2>(DEVCB_##_cb);
+#define MCFG_MM5740_MATRIX_X4(_cb) downcast<mm5740_device &>(*device).set_x_cb<3>(DEVCB_##_cb);
+#define MCFG_MM5740_MATRIX_X5(_cb) downcast<mm5740_device &>(*device).set_x_cb<4>(DEVCB_##_cb);
+#define MCFG_MM5740_MATRIX_X6(_cb) downcast<mm5740_device &>(*device).set_x_cb<5>(DEVCB_##_cb);
+#define MCFG_MM5740_MATRIX_X7(_cb) downcast<mm5740_device &>(*device).set_x_cb<6>(DEVCB_##_cb);
+#define MCFG_MM5740_MATRIX_X8(_cb) downcast<mm5740_device &>(*device).set_x_cb<7>(DEVCB_##_cb);
+#define MCFG_MM5740_MATRIX_X9(_cb) downcast<mm5740_device &>(*device).set_x_cb<8>(DEVCB_##_cb);
+#define MCFG_MM5740_SHIFT_CB(_cb) downcast<mm5740_device &>(*device).set_shift_cb(DEVCB_##_cb);
+#define MCFG_MM5740_CONTROL_CB(_cb) downcast<mm5740_device &>(*device).set_control_cb(DEVCB_##_cb);
+#define MCFG_MM5740_DATA_READY_CB(_cb) downcast<mm5740_device &>(*device).set_data_ready_cb(DEVCB_##_cb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/mm58167.h b/src/devices/machine/mm58167.h
index 63cad307e7b..4c5e0326a1d 100644
--- a/src/devices/machine/mm58167.h
+++ b/src/devices/machine/mm58167.h
@@ -19,7 +19,7 @@
//**************************************************************************
#define MCFG_MM58167_IRQ_CALLBACK(_cb) \
- devcb = &downcast<mm58167_device &>(*device).set_irq_cb(DEVCB_##_cb);
+ downcast<mm58167_device &>(*device).set_irq_cb(DEVCB_##_cb);
//**************************************************************************
diff --git a/src/devices/machine/mm74c922.h b/src/devices/machine/mm74c922.h
index a85c517adc1..bd448c2eb22 100644
--- a/src/devices/machine/mm74c922.h
+++ b/src/devices/machine/mm74c922.h
@@ -49,22 +49,22 @@
downcast<mm74c922_device &>(*device).set_cap_debounce(_value);
#define MCFG_MM74C922_DA_CALLBACK(_write) \
- devcb = &downcast<mm74c922_device &>(*device).set_da_wr_callback(DEVCB_##_write);
+ downcast<mm74c922_device &>(*device).set_da_wr_callback(DEVCB_##_write);
#define MCFG_MM74C922_X1_CALLBACK(_read) \
- devcb = &downcast<mm74c922_device &>(*device).set_x1_rd_callback(DEVCB_##_read);
+ downcast<mm74c922_device &>(*device).set_x1_rd_callback(DEVCB_##_read);
#define MCFG_MM74C922_X2_CALLBACK(_read) \
- devcb = &downcast<mm74c922_device &>(*device).set_x2_rd_callback(DEVCB_##_read);
+ downcast<mm74c922_device &>(*device).set_x2_rd_callback(DEVCB_##_read);
#define MCFG_MM74C922_X3_CALLBACK(_read) \
- devcb = &downcast<mm74c922_device &>(*device).set_x3_rd_callback(DEVCB_##_read);
+ downcast<mm74c922_device &>(*device).set_x3_rd_callback(DEVCB_##_read);
#define MCFG_MM74C922_X4_CALLBACK(_read) \
- devcb = &downcast<mm74c922_device &>(*device).set_x4_rd_callback(DEVCB_##_read);
+ downcast<mm74c922_device &>(*device).set_x4_rd_callback(DEVCB_##_read);
#define MCFG_MM74C922_X5_CALLBACK(_read) \
- devcb = &downcast<mm74c922_device &>(*device).set_x5_rd_callback(DEVCB_##_read);
+ downcast<mm74c922_device &>(*device).set_x5_rd_callback(DEVCB_##_read);
diff --git a/src/devices/machine/mos6526.h b/src/devices/machine/mos6526.h
index 2111106c76b..07001edf4d6 100644
--- a/src/devices/machine/mos6526.h
+++ b/src/devices/machine/mos6526.h
@@ -71,28 +71,28 @@
downcast<mos6526_device &>(*device).set_tod_clock(_clock);
#define MCFG_MOS6526_IRQ_CALLBACK(_write) \
- devcb = &downcast<mos6526_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
+ downcast<mos6526_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_MOS6526_CNT_CALLBACK(_write) \
- devcb = &downcast<mos6526_device &>(*device).set_cnt_wr_callback(DEVCB_##_write);
+ downcast<mos6526_device &>(*device).set_cnt_wr_callback(DEVCB_##_write);
#define MCFG_MOS6526_SP_CALLBACK(_write) \
- devcb = &downcast<mos6526_device &>(*device).set_sp_wr_callback(DEVCB_##_write);
+ downcast<mos6526_device &>(*device).set_sp_wr_callback(DEVCB_##_write);
#define MCFG_MOS6526_PA_INPUT_CALLBACK(_read) \
- devcb = &downcast<mos6526_device &>(*device).set_pa_rd_callback(DEVCB_##_read);
+ downcast<mos6526_device &>(*device).set_pa_rd_callback(DEVCB_##_read);
#define MCFG_MOS6526_PA_OUTPUT_CALLBACK(_write) \
- devcb = &downcast<mos6526_device &>(*device).set_pa_wr_callback(DEVCB_##_write);
+ downcast<mos6526_device &>(*device).set_pa_wr_callback(DEVCB_##_write);
#define MCFG_MOS6526_PB_INPUT_CALLBACK(_read) \
- devcb = &downcast<mos6526_device &>(*device).set_pb_rd_callback(DEVCB_##_read);
+ downcast<mos6526_device &>(*device).set_pb_rd_callback(DEVCB_##_read);
#define MCFG_MOS6526_PB_OUTPUT_CALLBACK(_write) \
- devcb = &downcast<mos6526_device &>(*device).set_pb_wr_callback(DEVCB_##_write);
+ downcast<mos6526_device &>(*device).set_pb_wr_callback(DEVCB_##_write);
#define MCFG_MOS6526_PC_CALLBACK(_write) \
- devcb = &downcast<mos6526_device &>(*device).set_pc_wr_callback(DEVCB_##_write);
+ downcast<mos6526_device &>(*device).set_pc_wr_callback(DEVCB_##_write);
@@ -119,6 +119,14 @@ public:
template <class Object> devcb_base &set_pb_rd_callback(Object &&cb) { return m_read_pb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_pb_wr_callback(Object &&cb) { return m_write_pb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_pc_wr_callback(Object &&cb) { return m_write_pc.set_callback(std::forward<Object>(cb)); }
+ auto irq_wr_callback() { return m_write_irq.bind(); }
+ auto cnt_wr_callback() { return m_write_cnt.bind(); }
+ auto sp_wr_callback() { return m_write_sp.bind(); }
+ auto pa_rd_callback() { return m_read_pa.bind(); }
+ auto pa_wr_callback() { return m_write_pa.bind(); }
+ auto pb_rd_callback() { return m_read_pb.bind(); }
+ auto pb_wr_callback() { return m_write_pb.bind(); }
+ auto pc_wr_callback() { return m_write_pc.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/machine/mos6529.h b/src/devices/machine/mos6529.h
index ca0a4525d1b..abddc4175c7 100644
--- a/src/devices/machine/mos6529.h
+++ b/src/devices/machine/mos6529.h
@@ -32,28 +32,28 @@
//**************************************************************************
#define MCFG_MOS6529_P0_HANDLER(_devcb) \
- devcb = &downcast<mos6529_device &>(*device).set_p0_handler(DEVCB_##_devcb);
+ downcast<mos6529_device &>(*device).set_p0_handler(DEVCB_##_devcb);
#define MCFG_MOS6529_P1_HANDLER(_devcb) \
- devcb = &downcast<mos6529_device &>(*device).set_p1_handler(DEVCB_##_devcb);
+ downcast<mos6529_device &>(*device).set_p1_handler(DEVCB_##_devcb);
#define MCFG_MOS6529_P2_HANDLER(_devcb) \
- devcb = &downcast<mos6529_device &>(*device).set_p2_handler(DEVCB_##_devcb);
+ downcast<mos6529_device &>(*device).set_p2_handler(DEVCB_##_devcb);
#define MCFG_MOS6529_P3_HANDLER(_devcb) \
- devcb = &downcast<mos6529_device &>(*device).set_p3_handler(DEVCB_##_devcb);
+ downcast<mos6529_device &>(*device).set_p3_handler(DEVCB_##_devcb);
#define MCFG_MOS6529_P4_HANDLER(_devcb) \
- devcb = &downcast<mos6529_device &>(*device).set_p4_handler(DEVCB_##_devcb);
+ downcast<mos6529_device &>(*device).set_p4_handler(DEVCB_##_devcb);
#define MCFG_MOS6529_P5_HANDLER(_devcb) \
- devcb = &downcast<mos6529_device &>(*device).set_p5_handler(DEVCB_##_devcb);
+ downcast<mos6529_device &>(*device).set_p5_handler(DEVCB_##_devcb);
#define MCFG_MOS6529_P6_HANDLER(_devcb) \
- devcb = &downcast<mos6529_device &>(*device).set_p6_handler(DEVCB_##_devcb);
+ downcast<mos6529_device &>(*device).set_p6_handler(DEVCB_##_devcb);
#define MCFG_MOS6529_P7_HANDLER(_devcb) \
- devcb = &downcast<mos6529_device &>(*device).set_p7_handler(DEVCB_##_devcb);
+ downcast<mos6529_device &>(*device).set_p7_handler(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/mos6530.h b/src/devices/machine/mos6530.h
index 2491e547a53..cc930fa8613 100644
--- a/src/devices/machine/mos6530.h
+++ b/src/devices/machine/mos6530.h
@@ -110,15 +110,15 @@ DECLARE_DEVICE_TYPE(MOS6530, mos6530_device)
#define MCFG_MOS6530_IN_PA_CB(_devcb) \
- devcb = &downcast<mos6530_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
+ downcast<mos6530_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
#define MCFG_MOS6530_OUT_PA_CB(_devcb) \
- devcb = &downcast<mos6530_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
+ downcast<mos6530_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
#define MCFG_MOS6530_IN_PB_CB(_devcb) \
- devcb = &downcast<mos6530_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
+ downcast<mos6530_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
#define MCFG_MOS6530_OUT_PB_CB(_devcb) \
- devcb = &downcast<mos6530_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
+ downcast<mos6530_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
#endif // MAME_MACHINE_MOS6530_H
diff --git a/src/devices/machine/mos6530n.h b/src/devices/machine/mos6530n.h
index 56080ff49dc..a5dfd3ee6fe 100644
--- a/src/devices/machine/mos6530n.h
+++ b/src/devices/machine/mos6530n.h
@@ -64,115 +64,115 @@
//**************************************************************************
#define MCFG_MOS6530n_IRQ_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_irq_wr_callback(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_MOS6530n_IN_PA_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_rd_callback(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pa_rd_callback(DEVCB_##_read);
#define MCFG_MOS6530n_OUT_PA_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_wr_callback(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pa_wr_callback(DEVCB_##_write);
#define MCFG_MOS6530n_IN_PB_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_rd_callback(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pb_rd_callback(DEVCB_##_read);
#define MCFG_MOS6530n_OUT_PB_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_wr_callback(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pb_wr_callback(DEVCB_##_write);
#define MCFG_MOS6530n_IN_PA0_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_rd_callback<0>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pa_rd_callback<0>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PA1_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_rd_callback<1>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pa_rd_callback<1>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PA2_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_rd_callback<2>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pa_rd_callback<2>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PA3_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_rd_callback<3>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pa_rd_callback<3>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PA4_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_rd_callback<4>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pa_rd_callback<4>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PA5_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_rd_callback<5>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pa_rd_callback<5>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PA6_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_rd_callback<6>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pa_rd_callback<6>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PA7_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_rd_callback<7>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pa_rd_callback<7>(DEVCB_##_read);
#define MCFG_MOS6530n_OUT_PA0_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_wr_callback<0>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pa_wr_callback<0>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PA1_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_wr_callback<1>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pa_wr_callback<1>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PA2_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_wr_callback<2>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pa_wr_callback<2>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PA3_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_wr_callback<3>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pa_wr_callback<3>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PA4_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_wr_callback<4>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pa_wr_callback<4>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PA5_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_wr_callback<5>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pa_wr_callback<5>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PA6_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_wr_callback<6>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pa_wr_callback<6>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PA7_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pa_wr_callback<7>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pa_wr_callback<7>(DEVCB_##_write);
#define MCFG_MOS6530n_IN_PB0_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_rd_callback<0>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pb_rd_callback<0>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PB1_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_rd_callback<1>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pb_rd_callback<1>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PB2_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_rd_callback<2>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pb_rd_callback<2>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PB3_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_rd_callback<3>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pb_rd_callback<3>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PB4_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_rd_callback<4>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pb_rd_callback<4>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PB5_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_rd_callback<5>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pb_rd_callback<5>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PB6_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_rd_callback<6>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pb_rd_callback<6>(DEVCB_##_read);
#define MCFG_MOS6530n_IN_PB7_CB(_read) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_rd_callback<7>(DEVCB_##_read);
+ downcast<mos6530_device_base &>(*device).set_pb_rd_callback<7>(DEVCB_##_read);
#define MCFG_MOS6530n_OUT_PB0_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_wr_callback<0>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pb_wr_callback<0>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PB1_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_wr_callback<1>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pb_wr_callback<1>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PB2_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_wr_callback<2>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pb_wr_callback<2>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PB3_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_wr_callback<3>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pb_wr_callback<3>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PB4_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_wr_callback<4>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pb_wr_callback<4>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PB5_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_wr_callback<5>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pb_wr_callback<5>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PB6_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_wr_callback<6>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pb_wr_callback<6>(DEVCB_##_write);
#define MCFG_MOS6530n_OUT_PB7_CB(_write) \
- devcb = &downcast<mos6530_device_base &>(*device).set_pb_wr_callback<7>(DEVCB_##_write);
+ downcast<mos6530_device_base &>(*device).set_pb_wr_callback<7>(DEVCB_##_write);
@@ -194,6 +194,15 @@ public:
template <unsigned N, class Object> devcb_base &set_pa_wr_callback(Object &&cb) { return m_out_pa_cb[N].set_callback(std::forward<Object>(cb)); }
template <unsigned N, class Object> devcb_base &set_pb_rd_callback(Object &&cb) { return m_in_pb_cb[N].set_callback(std::forward<Object>(cb)); }
template <unsigned N, class Object> devcb_base &set_pb_wr_callback(Object &&cb) { return m_out_pb_cb[N].set_callback(std::forward<Object>(cb)); }
+ auto irq_wr_callback() { return m_irq_cb.bind(); }
+ auto pa_rd_callback() { return m_in8_pa_cb.bind(); }
+ auto pa_wr_callback() { return m_out8_pa_cb.bind(); }
+ auto pb_rd_callback() { return m_in8_pb_cb.bind(); }
+ auto pb_wr_callback() { return m_out8_pb_cb.bind(); }
+ template <unsigned N> auto pa_rd_callback() { return m_in_pa_cb[N].bind(); }
+ template <unsigned N> auto pa_wr_callback() { return m_out_pa_cb[N].bind(); }
+ template <unsigned N> auto pb_rd_callback() { return m_in_pb_cb[N].bind(); }
+ template <unsigned N> auto pb_wr_callback() { return m_out_pb_cb[N].bind(); }
DECLARE_WRITE_LINE_MEMBER( pa0_w ) { pa_w(0, state); }
DECLARE_WRITE_LINE_MEMBER( pa1_w ) { pa_w(1, state); }
diff --git a/src/devices/machine/mos6551.h b/src/devices/machine/mos6551.h
index 07d1f7069ba..319f00e803d 100644
--- a/src/devices/machine/mos6551.h
+++ b/src/devices/machine/mos6551.h
@@ -34,19 +34,19 @@
downcast<mos6551_device &>(*device).set_xtal(_xtal);
#define MCFG_MOS6551_IRQ_HANDLER(_devcb) \
- devcb = &downcast<mos6551_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<mos6551_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_MOS6551_TXD_HANDLER(_devcb) \
- devcb = &downcast<mos6551_device &>(*device).set_txd_handler(DEVCB_##_devcb);
+ downcast<mos6551_device &>(*device).set_txd_handler(DEVCB_##_devcb);
#define MCFG_MOS6551_RXC_HANDLER(_devcb) \
- devcb = &downcast<mos6551_device &>(*device).set_rxc_handler(DEVCB_##_devcb);
+ downcast<mos6551_device &>(*device).set_rxc_handler(DEVCB_##_devcb);
#define MCFG_MOS6551_RTS_HANDLER(_devcb) \
- devcb = &downcast<mos6551_device &>(*device).set_rts_handler(DEVCB_##_devcb);
+ downcast<mos6551_device &>(*device).set_rts_handler(DEVCB_##_devcb);
#define MCFG_MOS6551_DTR_HANDLER(_devcb) \
- devcb = &downcast<mos6551_device &>(*device).set_dtr_handler(DEVCB_##_devcb);
+ downcast<mos6551_device &>(*device).set_dtr_handler(DEVCB_##_devcb);
class mos6551_device : public device_t
{
@@ -58,6 +58,11 @@ public:
template <class Object> devcb_base &set_rxc_handler(Object &&cb) { return m_rxc_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_rts_handler(Object &&cb) { return m_rts_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_dtr_handler(Object &&cb) { return m_dtr_handler.set_callback(std::forward<Object>(cb)); }
+ auto irq_handler() { return m_irq_handler.bind(); }
+ auto txd_handler() { return m_txd_handler.bind(); }
+ auto rxc_handler() { return m_rxc_handler.bind(); }
+ auto rts_handler() { return m_rts_handler.bind(); }
+ auto dtr_handler() { return m_dtr_handler.bind(); }
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
diff --git a/src/devices/machine/mos8722.h b/src/devices/machine/mos8722.h
index 330d22059b6..744adf415e7 100644
--- a/src/devices/machine/mos8722.h
+++ b/src/devices/machine/mos8722.h
@@ -46,19 +46,19 @@
//**************************************************************************
#define MCFG_MOS8722_Z80EN_CALLBACK(_write) \
- devcb = &downcast<mos8722_device &>(*device).set_z80en_wr_callback(DEVCB_##_write);
+ downcast<mos8722_device &>(*device).set_z80en_wr_callback(DEVCB_##_write);
#define MCFG_MOS8722_FSDIR_CALLBACK(_write) \
- devcb = &downcast<mos8722_device &>(*device).set_fsdir_wr_callback(DEVCB_##_write);
+ downcast<mos8722_device &>(*device).set_fsdir_wr_callback(DEVCB_##_write);
#define MCFG_MOS8722_GAME_CALLBACK(_read) \
- devcb = &downcast<mos8722_device &>(*device).set_game_rd_callback(DEVCB_##_read);
+ downcast<mos8722_device &>(*device).set_game_rd_callback(DEVCB_##_read);
#define MCFG_MOS8722_EXROM_CALLBACK(_read) \
- devcb = &downcast<mos8722_device &>(*device).set_exrom_rd_callback(DEVCB_##_read);
+ downcast<mos8722_device &>(*device).set_exrom_rd_callback(DEVCB_##_read);
#define MCFG_MOS8722_SENSE40_CALLBACK(_read) \
- devcb = &downcast<mos8722_device &>(*device).set_sense40_rd_callback(DEVCB_##_read);
+ downcast<mos8722_device &>(*device).set_sense40_rd_callback(DEVCB_##_read);
diff --git a/src/devices/machine/mpu401.h b/src/devices/machine/mpu401.h
index 1dd5d55243c..7fc7a718bb4 100644
--- a/src/devices/machine/mpu401.h
+++ b/src/devices/machine/mpu401.h
@@ -12,7 +12,7 @@
MCFG_IRQ_FUNC(irqf)
#define MCFG_IRQ_FUNC(irqf) \
- devcb = &downcast<mpu401_device *>(device)->set_irqf(DEVCB_##irqf);
+ downcast<mpu401_device *>(device)->set_irqf(DEVCB_##irqf);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/msm58321.h b/src/devices/machine/msm58321.h
index 2d0d9a4d424..24eb2dd327d 100644
--- a/src/devices/machine/msm58321.h
+++ b/src/devices/machine/msm58321.h
@@ -45,19 +45,19 @@
//**************************************************************************
#define MCFG_MSM58321_D0_HANDLER(_devcb) \
- devcb = &downcast<msm58321_device &>(*device).set_d0_handler(DEVCB_##_devcb);
+ downcast<msm58321_device &>(*device).set_d0_handler(DEVCB_##_devcb);
#define MCFG_MSM58321_D1_HANDLER(_devcb) \
- devcb = &downcast<msm58321_device &>(*device).set_d1_handler(DEVCB_##_devcb);
+ downcast<msm58321_device &>(*device).set_d1_handler(DEVCB_##_devcb);
#define MCFG_MSM58321_D2_HANDLER(_devcb) \
- devcb = &downcast<msm58321_device &>(*device).set_d2_handler(DEVCB_##_devcb);
+ downcast<msm58321_device &>(*device).set_d2_handler(DEVCB_##_devcb);
#define MCFG_MSM58321_D3_HANDLER(_devcb) \
- devcb = &downcast<msm58321_device &>(*device).set_d3_handler(DEVCB_##_devcb);
+ downcast<msm58321_device &>(*device).set_d3_handler(DEVCB_##_devcb);
#define MCFG_MSM58321_BUSY_HANDLER(_devcb) \
- devcb = &downcast<msm58321_device &>(*device).set_busy_handler(DEVCB_##_devcb);
+ downcast<msm58321_device &>(*device).set_busy_handler(DEVCB_##_devcb);
#define MCFG_MSM58321_YEAR0(_year0) \
downcast<msm58321_device &>(*device).set_year0(_year0);
diff --git a/src/devices/machine/msm6242.h b/src/devices/machine/msm6242.h
index 0c8d387df82..bd6bd89403e 100644
--- a/src/devices/machine/msm6242.h
+++ b/src/devices/machine/msm6242.h
@@ -41,7 +41,7 @@
#define MCFG_MSM6242_OUT_INT_HANDLER(_devcb) \
- devcb = &downcast<msm6242_device &>(*device).set_out_int_handler(DEVCB_##_devcb);
+ downcast<msm6242_device &>(*device).set_out_int_handler(DEVCB_##_devcb);
// ======================> msm6242_device
@@ -53,6 +53,7 @@ public:
msm6242_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <class Object> devcb_base &set_out_int_handler(Object &&cb) { return m_out_int_handler.set_callback(std::forward<Object>(cb)); }
+ auto out_int_handler() { return m_out_int_handler.bind(); }
// I/O operations
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/machine/msm6253.h b/src/devices/machine/msm6253.h
index a4f9e33efaa..4f617b29a4e 100644
--- a/src/devices/machine/msm6253.h
+++ b/src/devices/machine/msm6253.h
@@ -37,22 +37,22 @@
downcast<msm6253_device &>(*device).set_input_tag<3>(_input);
#define MCFG_MSM6253_IN0_ANALOG_READ(_class, _method) \
- downcast<msm6253_device &>(*device).set_input_cb<0>(msm6253_device::port_read_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<msm6253_device &>(*device).set_input_cb<0>(&_class::_method, #_class "::" #_method, this);
#define MCFG_MSM6253_IN1_ANALOG_READ(_class, _method) \
- downcast<msm6253_device &>(*device).set_input_cb<1>(msm6253_device::port_read_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<msm6253_device &>(*device).set_input_cb<1>(&_class::_method, #_class "::" #_method, this);
#define MCFG_MSM6253_IN2_ANALOG_READ(_class, _method) \
- downcast<msm6253_device &>(*device).set_input_cb<2>(msm6253_device::port_read_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<msm6253_device &>(*device).set_input_cb<2>(&_class::_method, #_class "::" #_method, this);
#define MCFG_MSM6253_IN3_ANALOG_READ(_class, _method) \
- downcast<msm6253_device &>(*device).set_input_cb<3>(msm6253_device::port_read_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<msm6253_device &>(*device).set_input_cb<3>(&_class::_method, #_class "::" #_method, this);
#define MCFG_MSM6253_IN0_ANALOG_DEVREAD(_tag, _class, _method) \
- downcast<msm6253_device &>(*device).set_input_cb<0>(msm6253_device::port_read_delegate(&_class::_method, #_class "::" #_method, _tag));
+ downcast<msm6253_device &>(*device).set_input_cb<0>(&_class::_method, #_class "::" #_method, _tag);
#define MCFG_MSM6253_IN1_ANALOG_DEVREAD(_tag, _class, _method) \
- downcast<msm6253_device &>(*device).set_input_cb<1>(msm6253_device::port_read_delegate(&_class::_method, #_class "::" #_method, _tag));
+ downcast<msm6253_device &>(*device).set_input_cb<1>(&_class::_method, #_class "::" #_method, _tag);
#define MCFG_MSM6253_IN2_ANALOG_DEVREAD(_tag, _class, _method) \
- downcast<msm6253_device &>(*device).set_input_cb<2>(msm6253_device::port_read_delegate(&_class::_method, #_class "::" #_method, _tag));
+ downcast<msm6253_device &>(*device).set_input_cb<2>(&_class::_method, #_class "::" #_method, _tag);
#define MCFG_MSM6253_IN3_ANALOG_DEVREAD(_tag, _class, _method) \
- downcast<msm6253_device &>(*device).set_input_cb<3>(msm6253_device::port_read_delegate(&_class::_method, #_class "::" #_method, _tag));
+ downcast<msm6253_device &>(*device).set_input_cb<3>(&_class::_method, #_class "::" #_method, _tag);
//**************************************************************************
@@ -71,7 +71,7 @@ public:
// configuration
template <unsigned P> void set_input_tag(const char *tag) { m_analog_ports[P].set_tag(tag); }
- template <unsigned P, typename Object> void set_input_cb(Object &&cb) { m_analog_input_cb[P] = std::forward<Object>(cb); }
+ template <unsigned P, typename... T> void set_input_cb(T &&... args) { m_analog_input_cb[P] = port_read_delegate(std::forward<T>(args)...); }
// write handlers
WRITE8_MEMBER(address_w);
diff --git a/src/devices/machine/ncr5380.h b/src/devices/machine/ncr5380.h
index ca63db53817..d6f5eb76d06 100644
--- a/src/devices/machine/ncr5380.h
+++ b/src/devices/machine/ncr5380.h
@@ -37,7 +37,7 @@ enum
// device stuff
#define MCFG_NCR5380_IRQ_CB(_devcb) \
- devcb = &downcast<ncr5380_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<ncr5380_device &>(*device).set_irq_callback(DEVCB_##_devcb);
class ncr5380_device : public legacy_scsi_host_adapter
{
diff --git a/src/devices/machine/ncr5380n.h b/src/devices/machine/ncr5380n.h
index 8d627970df9..973616c65a3 100644
--- a/src/devices/machine/ncr5380n.h
+++ b/src/devices/machine/ncr5380n.h
@@ -16,10 +16,10 @@
#include "machine/nscsi_bus.h"
#define MCFG_NCR5380N_IRQ_HANDLER(_devcb) \
- devcb = &downcast<ncr5380n_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<ncr5380n_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_NCR5380N_DRQ_HANDLER(_devcb) \
- devcb = &downcast<ncr5380n_device &>(*device).set_drq_handler(DEVCB_##_devcb);
+ downcast<ncr5380n_device &>(*device).set_drq_handler(DEVCB_##_devcb);
class ncr5380n_device : public nscsi_device
{
diff --git a/src/devices/machine/ncr5385.h b/src/devices/machine/ncr5385.h
index a7b551b2440..8cbe4ea9e79 100644
--- a/src/devices/machine/ncr5385.h
+++ b/src/devices/machine/ncr5385.h
@@ -50,7 +50,7 @@
//**************************************************************************
#define MCFG_NCR5385_INT_CB(_int) \
- devcb = &downcast<ncr5385_device &>(*device).set_int_callback(DEVCB_##_int);
+ downcast<ncr5385_device &>(*device).set_int_callback(DEVCB_##_int);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/ncr5390.h b/src/devices/machine/ncr5390.h
index 4e24a20eec8..a257bdf31d6 100644
--- a/src/devices/machine/ncr5390.h
+++ b/src/devices/machine/ncr5390.h
@@ -8,10 +8,10 @@
#include "machine/nscsi_bus.h"
#define MCFG_NCR5390_IRQ_HANDLER(_devcb) \
- devcb = &downcast<ncr5390_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<ncr5390_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_NCR5390_DRQ_HANDLER(_devcb) \
- devcb = &downcast<ncr5390_device &>(*device).set_drq_handler(DEVCB_##_devcb);
+ downcast<ncr5390_device &>(*device).set_drq_handler(DEVCB_##_devcb);
class ncr5390_device : public nscsi_device
{
diff --git a/src/devices/machine/ncr539x.h b/src/devices/machine/ncr539x.h
index 074a73c307d..2f024d643ec 100644
--- a/src/devices/machine/ncr539x.h
+++ b/src/devices/machine/ncr539x.h
@@ -15,10 +15,10 @@
// device stuff
#define MCFG_NCR539X_OUT_IRQ_CB(_devcb) \
- devcb = &downcast<ncr539x_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
+ downcast<ncr539x_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_NCR539X_OUT_DRQ_CB(_devcb) \
- devcb = &downcast<ncr539x_device &>(*device).set_out_drq_callback(DEVCB_##_devcb);
+ downcast<ncr539x_device &>(*device).set_out_drq_callback(DEVCB_##_devcb);
class ncr539x_device : public legacy_scsi_host_adapter
{
diff --git a/src/devices/machine/nsc810.h b/src/devices/machine/nsc810.h
index ca175ebd6b8..bebeb8f82a6 100644
--- a/src/devices/machine/nsc810.h
+++ b/src/devices/machine/nsc810.h
@@ -108,28 +108,28 @@ private:
downcast<nsc810_device *>(device)->set_timer1_clock(_t1clk);
#define MCFG_NSC810_PORTA_READ(_read) \
- devcb = &downcast<nsc810_device &>(*device).set_portA_read_callback(DEVCB_##_read);
+ downcast<nsc810_device &>(*device).set_portA_read_callback(DEVCB_##_read);
#define MCFG_NSC810_PORTB_READ(_read) \
- devcb = &downcast<nsc810_device &>(*device).set_portB_read_callback(DEVCB_##_read);
+ downcast<nsc810_device &>(*device).set_portB_read_callback(DEVCB_##_read);
#define MCFG_NSC810_PORTC_READ(_read) \
- devcb = &downcast<nsc810_device &>(*device).set_portC_read_callback(DEVCB_##_read);
+ downcast<nsc810_device &>(*device).set_portC_read_callback(DEVCB_##_read);
#define MCFG_NSC810_PORTA_WRITE(_write) \
- devcb = &downcast<nsc810_device &>(*device).set_portA_write_callback(DEVCB_##_write);
+ downcast<nsc810_device &>(*device).set_portA_write_callback(DEVCB_##_write);
#define MCFG_NSC810_PORTB_WRITE(_write) \
- devcb = &downcast<nsc810_device &>(*device).set_portB_write_callback(DEVCB_##_write);
+ downcast<nsc810_device &>(*device).set_portB_write_callback(DEVCB_##_write);
#define MCFG_NSC810_PORTC_WRITE(_write) \
- devcb = &downcast<nsc810_device &>(*device).set_portC_write_callback(DEVCB_##_write);
+ downcast<nsc810_device &>(*device).set_portC_write_callback(DEVCB_##_write);
#define MCFG_NSC810_TIMER0_OUT(_write) \
- devcb = &downcast<nsc810_device &>(*device).set_timer0_callback(DEVCB_##_write);
+ downcast<nsc810_device &>(*device).set_timer0_callback(DEVCB_##_write);
#define MCFG_NSC810_TIMER1_OUT(_write) \
- devcb = &downcast<nsc810_device &>(*device).set_timer1_callback(DEVCB_##_write);
+ downcast<nsc810_device &>(*device).set_timer1_callback(DEVCB_##_write);
// device type definition
DECLARE_DEVICE_TYPE(NSC810, nsc810_device)
diff --git a/src/devices/machine/nscsi_cb.h b/src/devices/machine/nscsi_cb.h
index 27279e5eb04..b5156935a98 100644
--- a/src/devices/machine/nscsi_cb.h
+++ b/src/devices/machine/nscsi_cb.h
@@ -9,22 +9,22 @@
#define MCFG_NSCSICB_RST_HANDLER(_line) \
- devcb = &downcast<nscsi_callback_device *>(device)->set_rst_callback(DEVCB_##_line);
+ downcast<nscsi_callback_device *>(device)->set_rst_callback(DEVCB_##_line);
#define MCFG_NSCSICB_ATN_HANDLER(_line) \
- devcb = &downcast<nscsi_callback_device *>(device)->set_atn_callback(DEVCB_##_line);
+ downcast<nscsi_callback_device *>(device)->set_atn_callback(DEVCB_##_line);
#define MCFG_NSCSICB_ACK_HANDLER(_line) \
- devcb = &downcast<nscsi_callback_device *>(device)->set_ack_callback(DEVCB_##_line);
+ downcast<nscsi_callback_device *>(device)->set_ack_callback(DEVCB_##_line);
#define MCFG_NSCSICB_REQ_HANDLER(_line) \
- devcb = &downcast<nscsi_callback_device *>(device)->set_req_callback(DEVCB_##_line);
+ downcast<nscsi_callback_device *>(device)->set_req_callback(DEVCB_##_line);
#define MCFG_NSCSICB_MSG_HANDLER(_line) \
- devcb = &downcast<nscsi_callback_device *>(device)->set_msg_callback(DEVCB_##_line);
+ downcast<nscsi_callback_device *>(device)->set_msg_callback(DEVCB_##_line);
#define MCFG_NSCSICB_IO_HANDLER(_line) \
- devcb = &downcast<nscsi_callback_device *>(device)->set_io_callback(DEVCB_##_line);
+ downcast<nscsi_callback_device *>(device)->set_io_callback(DEVCB_##_line);
#define MCFG_NSCSICB_CD_HANDLER(_line) \
downcast<nscsi_callback_device *>(device)->set_cd_callback(DEVCB_##_line);
diff --git a/src/devices/machine/output_latch.h b/src/devices/machine/output_latch.h
index bdadd772ade..c915b4c7207 100644
--- a/src/devices/machine/output_latch.h
+++ b/src/devices/machine/output_latch.h
@@ -7,28 +7,28 @@
#define MCFG_OUTPUT_LATCH_BIT0_HANDLER(_devcb) \
- devcb = &downcast<output_latch_device &>(*device).set_bit_handler<0>(DEVCB_##_devcb);
+ downcast<output_latch_device &>(*device).set_bit_handler<0>(DEVCB_##_devcb);
#define MCFG_OUTPUT_LATCH_BIT1_HANDLER(_devcb) \
- devcb = &downcast<output_latch_device &>(*device).set_bit_handler<1>(DEVCB_##_devcb);
+ downcast<output_latch_device &>(*device).set_bit_handler<1>(DEVCB_##_devcb);
#define MCFG_OUTPUT_LATCH_BIT2_HANDLER(_devcb) \
- devcb = &downcast<output_latch_device &>(*device).set_bit_handler<2>(DEVCB_##_devcb);
+ downcast<output_latch_device &>(*device).set_bit_handler<2>(DEVCB_##_devcb);
#define MCFG_OUTPUT_LATCH_BIT3_HANDLER(_devcb) \
- devcb = &downcast<output_latch_device &>(*device).set_bit_handler<3>(DEVCB_##_devcb);
+ downcast<output_latch_device &>(*device).set_bit_handler<3>(DEVCB_##_devcb);
#define MCFG_OUTPUT_LATCH_BIT4_HANDLER(_devcb) \
- devcb = &downcast<output_latch_device &>(*device).set_bit_handler<4>(DEVCB_##_devcb);
+ downcast<output_latch_device &>(*device).set_bit_handler<4>(DEVCB_##_devcb);
#define MCFG_OUTPUT_LATCH_BIT5_HANDLER(_devcb) \
- devcb = &downcast<output_latch_device &>(*device).set_bit_handler<5>(DEVCB_##_devcb);
+ downcast<output_latch_device &>(*device).set_bit_handler<5>(DEVCB_##_devcb);
#define MCFG_OUTPUT_LATCH_BIT6_HANDLER(_devcb) \
- devcb = &downcast<output_latch_device &>(*device).set_bit_handler<6>(DEVCB_##_devcb);
+ downcast<output_latch_device &>(*device).set_bit_handler<6>(DEVCB_##_devcb);
#define MCFG_OUTPUT_LATCH_BIT7_HANDLER(_devcb) \
- devcb = &downcast<output_latch_device &>(*device).set_bit_handler<7>(DEVCB_##_devcb);
+ downcast<output_latch_device &>(*device).set_bit_handler<7>(DEVCB_##_devcb);
class output_latch_device : public device_t
{
@@ -36,6 +36,7 @@ public:
output_latch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
template <unsigned Bit, class Object> devcb_base &set_bit_handler(Object &&cb) { return m_bit_handlers[Bit].set_callback(std::forward<Object>(cb)); }
+ template <unsigned Bit> auto bit_handler() { return m_bit_handlers[Bit].bind(); }
void write(uint8_t data);
DECLARE_WRITE8_MEMBER(bus_w) { write(data); }
diff --git a/src/devices/machine/pc_fdc.h b/src/devices/machine/pc_fdc.h
index 2cc6970a621..76fe6db1730 100644
--- a/src/devices/machine/pc_fdc.h
+++ b/src/devices/machine/pc_fdc.h
@@ -20,10 +20,10 @@
MCFG_DEVICE_ADD(_tag, PC_FDC_AT, 0)
#define MCFG_PC_FDC_INTRQ_CALLBACK(_write) \
- devcb = &downcast<pc_fdc_family_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
+ downcast<pc_fdc_family_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
#define MCFG_PC_FDC_DRQ_CALLBACK(_write) \
- devcb = &downcast<pc_fdc_family_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
+ downcast<pc_fdc_family_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
class pc_fdc_family_device : public pc_fdc_interface {
public:
diff --git a/src/devices/machine/pc_lpt.h b/src/devices/machine/pc_lpt.h
index e9d46e37247..d85768bb5d4 100644
--- a/src/devices/machine/pc_lpt.h
+++ b/src/devices/machine/pc_lpt.h
@@ -14,7 +14,7 @@
#include "bus/centronics/ctronics.h"
#define MCFG_PC_LPT_IRQ_HANDLER(_devcb) \
- devcb = &downcast<pc_lpt_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<pc_lpt_device &>(*device).set_irq_handler(DEVCB_##_devcb);
/***************************************************************************
DEVICE CONFIGURATION MACROS
diff --git a/src/devices/machine/pci-ide.h b/src/devices/machine/pci-ide.h
index c6bafacc8df..4a7519a531e 100644
--- a/src/devices/machine/pci-ide.h
+++ b/src/devices/machine/pci-ide.h
@@ -20,7 +20,7 @@ TODO:
#include "idectrl.h"
#define MCFG_IDE_PCI_IRQ_HANDLER(_devcb) \
- devcb = &downcast<ide_pci_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<ide_pci_device &>(*device).set_irq_handler(DEVCB_##_devcb);
// This will set the top 12 bits for address decoding in legacy mode. Needed for seattle driver.
#define MCFG_IDE_PCI_SET_LEGACY_TOP(_val) \
@@ -40,6 +40,7 @@ public:
ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ auto irq_handler() { return m_irq_handler.bind(); }
void set_legacy_top(int val) { m_legacy_top = val & 0xfff; };
void set_pif(int val) { m_pif = val & 0xff; };
diff --git a/src/devices/machine/pci9050.h b/src/devices/machine/pci9050.h
index d3915ea10d8..fe42ea4fa80 100644
--- a/src/devices/machine/pci9050.h
+++ b/src/devices/machine/pci9050.h
@@ -19,10 +19,10 @@
downcast<pci9050_device *>(device)->set_map(id, address_map_constructor(&map, #map, this), this);
#define MCFG_PCI9050_USER_INPUT_CALLBACK(_write) \
- devcb = &downcast<pci9050_device &>(*device).set_user_input_callback(DEVCB_##_write);
+ downcast<pci9050_device &>(*device).set_user_input_callback(DEVCB_##_write);
#define MCFG_PCI9050_USER_OUTPUT_CALLBACK(_read) \
- devcb = &downcast<pci9050_device &>(*device).set_user_output_callback(DEVCB_##_read);
+ downcast<pci9050_device &>(*device).set_user_output_callback(DEVCB_##_read);
class pci9050_device : public pci_device
{
diff --git a/src/devices/machine/pckeybrd.h b/src/devices/machine/pckeybrd.h
index 15e5cc92b3a..622af173bf8 100644
--- a/src/devices/machine/pckeybrd.h
+++ b/src/devices/machine/pckeybrd.h
@@ -115,16 +115,16 @@ DECLARE_DEVICE_TYPE(AT_KEYB, at_keyboard_device)
#define MCFG_PC_KEYB_ADD(_tag, _cb) \
MCFG_DEVICE_ADD(_tag, PC_KEYB, 0) \
- devcb = &downcast<pc_keyboard_device &>(*device).set_keypress_callback(DEVCB_##_cb);
+ downcast<pc_keyboard_device &>(*device).set_keypress_callback(DEVCB_##_cb);
#define MCFG_AT_KEYB_ADD(_tag, _def_set, _cb) \
MCFG_DEVICE_ADD(_tag, AT_KEYB, 0) \
downcast<at_keyboard_device &>(*device).set_type(pc_keyboard_device::KEYBOARD_TYPE::AT, _def_set); \
- devcb = &downcast<pc_keyboard_device &>(*device).set_keypress_callback(DEVCB_##_cb);
+ downcast<pc_keyboard_device &>(*device).set_keypress_callback(DEVCB_##_cb);
#define MCFG_AT_MF2_KEYB_ADD(_tag, _def_set, _cb) \
MCFG_DEVICE_ADD(_tag, AT_KEYB, 0) \
downcast<at_keyboard_device &>(*device).set_type(pc_keyboard_device::KEYBOARD_TYPE_MF2, _def_set); \
- devcb = &downcast<pc_keyboard_device &>(*device).set_keypress_callback(DEVCB_##_cb);
+ downcast<pc_keyboard_device &>(*device).set_keypress_callback(DEVCB_##_cb);
#endif // MAME_MACHINE_PCKEYBRD_H
diff --git a/src/devices/machine/pdc.h b/src/devices/machine/pdc.h
index 734a1849af6..984f93b27b5 100644
--- a/src/devices/machine/pdc.h
+++ b/src/devices/machine/pdc.h
@@ -115,8 +115,8 @@ DECLARE_DEVICE_TYPE(PDC, pdc_device)
/* MCFG defines */
#define MCFG_PDC_R_CB(_devcb) \
- devcb = &downcast<pdc_device &>(*device).m68k_r_callback(DEVCB_##_devcb);
+ downcast<pdc_device &>(*device).m68k_r_callback(DEVCB_##_devcb);
#define MCFG_PDC_W_CB(_devcb) \
- devcb = &downcast<pdc_device &>(*device).m68k_w_callback(DEVCB_##_devcb);
+ downcast<pdc_device &>(*device).m68k_w_callback(DEVCB_##_devcb);
#endif // MAME_MACHINE_PDC_H
diff --git a/src/devices/machine/phi.h b/src/devices/machine/phi.h
index 59b538e8fc8..ea3cad4c09a 100644
--- a/src/devices/machine/phi.h
+++ b/src/devices/machine/phi.h
@@ -72,23 +72,19 @@ public:
PHI_488_SIGNAL_COUNT
};
- template <class Object> devcb_base& set_dio_read_cb(Object &&cb)
- { return m_dio_read_func.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base& set_dio_write_cb(Object &&cb)
- { return m_dio_write_func.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base& set_488_signal_write_cb(phi_488_signal_t signal , Object &&cb)
- { return m_signal_wr_fns[ signal ].set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base& set_int_write_cb(Object &&cb)
- { return m_int_write_func.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base& set_dmarq_write_cb(Object &&cb)
- { return m_dmarq_write_func.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base &set_sys_cntrl_read_cb(Object &&cb)
- { return m_sys_cntrl_read_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base& set_dio_read_cb(Object &&cb) { return m_dio_read_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base& set_dio_write_cb(Object &&cb) { return m_dio_write_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base& set_488_signal_write_cb(phi_488_signal_t signal , Object &&cb) { return m_signal_wr_fns[ signal ].set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base& set_int_write_cb(Object &&cb) { return m_int_write_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base& set_dmarq_write_cb(Object &&cb) { return m_dmarq_write_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sys_cntrl_read_cb(Object &&cb) { return m_sys_cntrl_read_func.set_callback(std::forward<Object>(cb)); }
+
+ auto dio_read_cb() { return m_dio_read_func.bind(); }
+ auto dio_write_cb() { return m_dio_write_func.bind(); }
+ template <phi_488_signal_t Signal> auto signal_write_cb() { return m_signal_wr_fns[ Signal ].bind(); }
+ auto int_write_cb() { return m_int_write_func.bind(); }
+ auto dmarq_write_cb() { return m_dmarq_write_func.bind(); }
+ auto sys_cntrl_read_cb() { return m_sys_cntrl_read_func.bind(); }
DECLARE_WRITE_LINE_MEMBER(eoi_w);
DECLARE_WRITE_LINE_MEMBER(dav_w);
diff --git a/src/devices/machine/pic8259.h b/src/devices/machine/pic8259.h
index 23e706b8055..8003c5449a7 100644
--- a/src/devices/machine/pic8259.h
+++ b/src/devices/machine/pic8259.h
@@ -34,15 +34,15 @@
// Interrupt request output to CPU or master 8259 (active high)
#define MCFG_PIC8259_OUT_INT_CB(_devcb) \
- devcb = &downcast<pic8259_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<pic8259_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
// Slave program select (VCC = master; GND = slave; pin becomes EN output in buffered mode)
#define MCFG_PIC8259_IN_SP_CB(_devcb) \
- devcb = &downcast<pic8259_device &>(*device).set_in_sp_callback(DEVCB_##_devcb);
+ downcast<pic8259_device &>(*device).set_in_sp_callback(DEVCB_##_devcb);
// Cascaded interrupt acknowledge request for slave 8259 to place vector on data bus
#define MCFG_PIC8259_CASCADE_ACK_CB(_devcb) \
- devcb = &downcast<pic8259_device &>(*device).set_read_slave_ack_callback(DEVCB_##_devcb);
+ downcast<pic8259_device &>(*device).set_read_slave_ack_callback(DEVCB_##_devcb);
class pic8259_device : public device_t
@@ -53,6 +53,9 @@ public:
template <class Object> devcb_base &set_out_int_callback(Object &&cb) { return m_out_int_func.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_in_sp_callback(Object &&cb) { return m_in_sp_func.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_read_slave_ack_callback(Object &&cb) { return m_read_slave_ack_func.set_callback(std::forward<Object>(cb)); }
+ auto out_int_callback() { return m_out_int_func.bind(); }
+ auto in_sp_callback() { return m_in_sp_func.bind(); }
+ auto read_slave_ack_callback() { return m_read_slave_ack_func.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/machine/pit8253.h b/src/devices/machine/pit8253.h
index 4dc50854882..8ccb3474404 100644
--- a/src/devices/machine/pit8253.h
+++ b/src/devices/machine/pit8253.h
@@ -44,13 +44,13 @@
downcast<pit8253_device &>(*device).set_clk<2>(_clk);
#define MCFG_PIT8253_OUT0_HANDLER(_devcb) \
- devcb = &downcast<pit8253_device &>(*device).set_out_handler<0>(DEVCB_##_devcb);
+ downcast<pit8253_device &>(*device).set_out_handler<0>(DEVCB_##_devcb);
#define MCFG_PIT8253_OUT1_HANDLER(_devcb) \
- devcb = &downcast<pit8253_device &>(*device).set_out_handler<1>(DEVCB_##_devcb);
+ downcast<pit8253_device &>(*device).set_out_handler<1>(DEVCB_##_devcb);
#define MCFG_PIT8253_OUT2_HANDLER(_devcb) \
- devcb = &downcast<pit8253_device &>(*device).set_out_handler<2>(DEVCB_##_devcb);
+ downcast<pit8253_device &>(*device).set_out_handler<2>(DEVCB_##_devcb);
enum class pit_type
@@ -133,6 +133,7 @@ public:
template <unsigned N> void set_clk(double clk) { m_clk[N] = clk; }
template <unsigned N> void set_clk(const XTAL &xtal) { set_clk<N>(xtal.dvalue()); }
template <unsigned N, class Object> devcb_base &set_out_handler(Object &&cb) { return m_out_handler[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N> auto out_handler() { return m_out_handler[N].bind(); }
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
diff --git a/src/devices/machine/pxa255.h b/src/devices/machine/pxa255.h
index 4f0ce7bdab6..1f125108d57 100644
--- a/src/devices/machine/pxa255.h
+++ b/src/devices/machine/pxa255.h
@@ -22,13 +22,13 @@
#include "pxa255defs.h"
#define MCFG_PXA255_GPIO0_SET_CALLBACK(_devcb) \
- devcb = &downcast<pxa255_periphs_device &>(*device).set_gpio0_set_cb(DEVCB_##_devcb);
+ downcast<pxa255_periphs_device &>(*device).set_gpio0_set_cb(DEVCB_##_devcb);
#define MCFG_PXA255_GPIO0_CLEAR_CALLBACK(_devcb) \
- devcb = &downcast<pxa255_periphs_device &>(*device).set_gpio0_clear_cb(DEVCB_##_devcb);
+ downcast<pxa255_periphs_device &>(*device).set_gpio0_clear_cb(DEVCB_##_devcb);
#define MCFG_PXA255_GPIO0_IN_CALLBACK(_devcb) \
- devcb = &downcast<pxa255_periphs_device &>(*device).set_gpio0_in_cb(DEVCB_##_devcb);
+ downcast<pxa255_periphs_device &>(*device).set_gpio0_in_cb(DEVCB_##_devcb);
class pxa255_periphs_device : public device_t
{
diff --git a/src/devices/machine/ripple_counter.h b/src/devices/machine/ripple_counter.h
index cdbcb214d7d..c322b4fa718 100644
--- a/src/devices/machine/ripple_counter.h
+++ b/src/devices/machine/ripple_counter.h
@@ -20,9 +20,9 @@
// output callbacks
#define MCFG_RIPPLE_COUNTER_COUNT_OUT_CB(_devcb) \
- devcb = &downcast<ripple_counter_device &>(*device).set_count_out_cb(DEVCB_##_devcb);
+ downcast<ripple_counter_device &>(*device).set_count_out_cb(DEVCB_##_devcb);
#define MCFG_RIPPLE_COUNTER_ROM_OUT_CB(_devcb) \
- devcb = &downcast<ripple_counter_device &>(*device).set_rom_out_cb(DEVCB_##_devcb);
+ downcast<ripple_counter_device &>(*device).set_rom_out_cb(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -40,6 +40,8 @@ public:
void set_stages(u8 stages) { m_count_mask = (1U << stages) - 1; set_rom_addr_width(stages); }
template<class Object> devcb_base &set_count_out_cb(Object &&cb) { return m_count_out_cb.set_callback(std::forward<Object>(cb)); }
template<class Object> devcb_base &set_rom_out_cb(Object &&cb) { return m_rom_out_cb.set_callback(std::forward<Object>(cb)); }
+ auto count_out_cb() { return m_count_out_cb.bind(); }
+ auto rom_out_cb() { return m_rom_out_cb.bind(); }
// control line handlers
DECLARE_WRITE_LINE_MEMBER(clock_w);
diff --git a/src/devices/machine/rp5c01.h b/src/devices/machine/rp5c01.h
index 6c0cf00050b..fe2c92f19ac 100644
--- a/src/devices/machine/rp5c01.h
+++ b/src/devices/machine/rp5c01.h
@@ -32,7 +32,7 @@
//**************************************************************************
#define MCFG_RP5C01_OUT_ALARM_CB(_devcb) \
- devcb = &downcast<rp5c01_device &>(*device).set_out_alarm_callback(DEVCB_##_devcb);
+ downcast<rp5c01_device &>(*device).set_out_alarm_callback(DEVCB_##_devcb);
// include this macro if the chip is not battery backed
#define MCFG_RP5C01_REMOVE_BATTERY() \
diff --git a/src/devices/machine/rp5c15.h b/src/devices/machine/rp5c15.h
index 21633834f07..f3191c4df9a 100644
--- a/src/devices/machine/rp5c15.h
+++ b/src/devices/machine/rp5c15.h
@@ -32,10 +32,10 @@
//**************************************************************************
#define MCFG_RP5C15_OUT_ALARM_CB(_devcb) \
- devcb = &downcast<rp5c15_device &>(*device).set_out_alarm_callback(DEVCB_##_devcb);
+ downcast<rp5c15_device &>(*device).set_out_alarm_callback(DEVCB_##_devcb);
#define MCFG_RP5C15_OUT_CLKOUT_CB(_devcb) \
- devcb = &downcast<rp5c15_device &>(*device).set_out_clkout_callback(DEVCB_##_devcb);
+ downcast<rp5c15_device &>(*device).set_out_clkout_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/rstbuf.h b/src/devices/machine/rstbuf.h
index fe808b473e6..af0d8ffbef2 100644
--- a/src/devices/machine/rstbuf.h
+++ b/src/devices/machine/rstbuf.h
@@ -16,7 +16,7 @@
//**************************************************************************
#define MCFG_RST_BUFFER_INT_CALLBACK(_devcb) \
- devcb = &downcast<rst_buffer_device &>(*device).set_int_callback(DEVCB_##_devcb);
+ downcast<rst_buffer_device &>(*device).set_int_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/rtc4543.h b/src/devices/machine/rtc4543.h
index 3741f8a46d8..da51b7cf440 100644
--- a/src/devices/machine/rtc4543.h
+++ b/src/devices/machine/rtc4543.h
@@ -24,7 +24,7 @@
MCFG_DEVICE_ADD((tag), RTC4543, (clock))
#define MCFG_RTC4543_DATA_CALLBACK(cb) \
- devcb = &downcast<rtc4543_device &>(*device).set_data_cb(DEVCB_##cb);
+ downcast<rtc4543_device &>(*device).set_data_cb(DEVCB_##cb);
#define MCFG_JRC6355E_ADD(tag, clock) \
MCFG_DEVICE_ADD((tag), JRC6355E, (clock))
diff --git a/src/devices/machine/rtc65271.h b/src/devices/machine/rtc65271.h
index 93284622b1a..3042c738659 100644
--- a/src/devices/machine/rtc65271.h
+++ b/src/devices/machine/rtc65271.h
@@ -15,7 +15,7 @@
//**************************************************************************
#define MCFG_RTC65271_INTERRUPT_CB(cb) \
- devcb = &downcast<rtc65271_device &>(*device).set_interrupt_callback(DEVCB_##cb);
+ downcast<rtc65271_device &>(*device).set_interrupt_callback(DEVCB_##cb);
// ======================> rtc65271_device
diff --git a/src/devices/machine/s2636.h b/src/devices/machine/s2636.h
index 4653273c281..85c4a587c54 100644
--- a/src/devices/machine/s2636.h
+++ b/src/devices/machine/s2636.h
@@ -29,7 +29,7 @@
downcast<s2636_device &>(*device).set_divider((divider));
#define MCFG_S2623_SET_INTREQ_CALLBACK(cb) \
- devcb = &downcast<s2636_device &>(*device).set_intreq_cb(DEVCB_##cb);
+ downcast<s2636_device &>(*device).set_intreq_cb(DEVCB_##cb);
/*************************************
diff --git a/src/devices/machine/s3c2400.h b/src/devices/machine/s3c2400.h
index e11da131972..b22f306af2f 100644
--- a/src/devices/machine/s3c2400.h
+++ b/src/devices/machine/s3c2400.h
@@ -28,31 +28,31 @@
downcast<s3c2400_device &>(*device).set_screen_tag(screen_tag);
#define MCFG_S3C2400_CORE_PIN_R_CB(cb) \
- devcb = &downcast<s3c2400_device &>(*device).set_core_pin_r_callback(DEVCB_##cb);
+ downcast<s3c2400_device &>(*device).set_core_pin_r_callback(DEVCB_##cb);
#define MCFG_S3C2400_CORE_PIN_W_CB(cb) \
- devcb = &downcast<s3c2400_device &>(*device).set_core_pin_w_callback(DEVCB_##cb);
+ downcast<s3c2400_device &>(*device).set_core_pin_w_callback(DEVCB_##cb);
#define MCFG_S3C2400_GPIO_PORT_R_CB(cb) \
- devcb = &downcast<s3c2400_device &>(*device).set_gpio_port_r_callback(DEVCB_##cb);
+ downcast<s3c2400_device &>(*device).set_gpio_port_r_callback(DEVCB_##cb);
#define MCFG_S3C2400_GPIO_PORT_W_CB(cb) \
- devcb = &downcast<s3c2400_device &>(*device).set_gpio_port_w_callback(DEVCB_##cb);
+ downcast<s3c2400_device &>(*device).set_gpio_port_w_callback(DEVCB_##cb);
#define MCFG_S3C2400_I2C_SCL_W_CB(cb) \
- devcb = &downcast<s3c2400_device &>(*device).set_i2c_scl_w_callback(DEVCB_##cb);
+ downcast<s3c2400_device &>(*device).set_i2c_scl_w_callback(DEVCB_##cb);
#define MCFG_S3C2400_I2C_SDA_R_CB(cb) \
- devcb = &downcast<s3c2400_device &>(*device).set_i2c_sda_r_callback(DEVCB_##cb);
+ downcast<s3c2400_device &>(*device).set_i2c_sda_r_callback(DEVCB_##cb);
#define MCFG_S3C2400_I2C_SDA_W_CB(cb) \
- devcb = &downcast<s3c2400_device &>(*device).set_i2c_sda_w_callback(DEVCB_##cb);
+ downcast<s3c2400_device &>(*device).set_i2c_sda_w_callback(DEVCB_##cb);
#define MCFG_S3C2400_ADC_DATA_R_CB(cb) \
- devcb = &downcast<s3c2400_device &>(*device).set_adc_data_r_callback(DEVCB_##cb);
+ downcast<s3c2400_device &>(*device).set_adc_data_r_callback(DEVCB_##cb);
#define MCFG_S3C2400_I2S_DATA_W_CB(cb) \
- devcb = &downcast<s3c2400_device &>(*device).set_i2s_data_w_callback(DEVCB_##cb);
+ downcast<s3c2400_device &>(*device).set_i2s_data_w_callback(DEVCB_##cb);
#define MCFG_S3C2400_LCD_FLAGS(flags) \
downcast<s3c2400_device &>(*device).set_lcd_flags((flags));
diff --git a/src/devices/machine/s3c2410.h b/src/devices/machine/s3c2410.h
index 480c15b52e5..fe0507b5a68 100644
--- a/src/devices/machine/s3c2410.h
+++ b/src/devices/machine/s3c2410.h
@@ -28,43 +28,43 @@
downcast<s3c2410_device &>(*device).set_screen_tag(screen_tag);
#define MCFG_S3C2410_CORE_PIN_R_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_core_pin_r_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_core_pin_r_callback(DEVCB_##cb);
#define MCFG_S3C2410_CORE_PIN_W_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_core_pin_w_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_core_pin_w_callback(DEVCB_##cb);
#define MCFG_S3C2410_GPIO_PORT_R_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_gpio_port_r_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_gpio_port_r_callback(DEVCB_##cb);
#define MCFG_S3C2410_GPIO_PORT_W_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_gpio_port_w_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_gpio_port_w_callback(DEVCB_##cb);
#define MCFG_S3C2410_I2C_SCL_W_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_i2c_scl_w_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_i2c_scl_w_callback(DEVCB_##cb);
#define MCFG_S3C2410_I2C_SDA_R_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_i2c_sda_r_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_i2c_sda_r_callback(DEVCB_##cb);
#define MCFG_S3C2410_I2C_SDA_W_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_i2c_sda_w_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_i2c_sda_w_callback(DEVCB_##cb);
#define MCFG_S3C2410_ADC_DATA_R_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_adc_data_r_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_adc_data_r_callback(DEVCB_##cb);
#define MCFG_S3C2410_I2S_DATA_W_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_i2s_data_w_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_i2s_data_w_callback(DEVCB_##cb);
#define MCFG_S3C2410_NAND_COMMAND_W_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_nand_command_w_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_nand_command_w_callback(DEVCB_##cb);
#define MCFG_S3C2410_NAND_ADDRESS_W_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_nand_address_w_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_nand_address_w_callback(DEVCB_##cb);
#define MCFG_S3C2410_NAND_DATA_R_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_nand_data_r_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_nand_data_r_callback(DEVCB_##cb);
#define MCFG_S3C2410_NAND_DATA_W_CB(cb) \
- devcb = &downcast<s3c2410_device &>(*device).set_nand_data_w_callback(DEVCB_##cb);
+ downcast<s3c2410_device &>(*device).set_nand_data_w_callback(DEVCB_##cb);
#define MCFG_S3C2410_LCD_FLAGS(flags) \
downcast<s3c2410_device &>(*device).set_lcd_flags((flags));
diff --git a/src/devices/machine/s3c2440.h b/src/devices/machine/s3c2440.h
index 38aa6423a09..066e6f70d77 100644
--- a/src/devices/machine/s3c2440.h
+++ b/src/devices/machine/s3c2440.h
@@ -27,43 +27,43 @@
downcast<s3c2440_device &>(*device).set_screen_tag(screen_tag);
#define MCFG_S3C2440_CORE_PIN_R_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_core_pin_r_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_core_pin_r_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_CORE_PIN_W_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_core_pin_w_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_core_pin_w_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_GPIO_PORT_R_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_gpio_port_r_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_gpio_port_r_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_GPIO_PORT_W_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_gpio_port_w_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_gpio_port_w_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_I2C_SCL_W_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_i2c_scl_w_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_i2c_scl_w_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_I2C_SDA_R_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_i2c_sda_r_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_i2c_sda_r_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_I2C_SDA_W_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_i2c_sda_w_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_i2c_sda_w_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_ADC_DATA_R_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_adc_data_r_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_adc_data_r_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_I2S_DATA_W_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_i2s_data_w_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_i2s_data_w_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_NAND_COMMAND_W_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_nand_command_w_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_nand_command_w_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_NAND_ADDRESS_W_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_nand_address_w_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_nand_address_w_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_NAND_DATA_R_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_nand_data_r_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_nand_data_r_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_NAND_DATA_W_CB(_devcb) \
- devcb = &downcast<s3c2440_device &>(*device).set_nand_data_w_callback(DEVCB_##_devcb);
+ downcast<s3c2440_device &>(*device).set_nand_data_w_callback(DEVCB_##_devcb);
#define MCFG_S3C2440_LCD_FLAGS(_flags) \
downcast<s3c2440_device &>(*device).set_lcd_flags(_flags);
diff --git a/src/devices/machine/s3c44b0.h b/src/devices/machine/s3c44b0.h
index 601f1ccd395..21d6d7e0082 100644
--- a/src/devices/machine/s3c44b0.h
+++ b/src/devices/machine/s3c44b0.h
@@ -605,25 +605,25 @@ DECLARE_DEVICE_TYPE(S3C44B0, s3c44b0_device)
#define MCFG_S3C44B0_GPIO_PORT_R_CB(cb) \
- devcb = &downcast<s3c44b0_device &>(*device).set_gpio_port_r_callback(DEVCB_##cb);
+ downcast<s3c44b0_device &>(*device).set_gpio_port_r_callback(DEVCB_##cb);
#define MCFG_S3C44B0_GPIO_PORT_W_CB(cb) \
- devcb = &downcast<s3c44b0_device &>(*device).set_gpio_port_w_callback(DEVCB_##cb);
+ downcast<s3c44b0_device &>(*device).set_gpio_port_w_callback(DEVCB_##cb);
#define MCFG_S3C44B0_I2C_SCL_W_CB(cb) \
- devcb = &downcast<s3c44b0_device &>(*device).set_i2c_scl_w_callback(DEVCB_##cb);
+ downcast<s3c44b0_device &>(*device).set_i2c_scl_w_callback(DEVCB_##cb);
#define MCFG_S3C44B0_I2C_SDA_R_CB(cb) \
- devcb = &downcast<s3c44b0_device &>(*device).set_i2c_sda_r_callback(DEVCB_##cb);
+ downcast<s3c44b0_device &>(*device).set_i2c_sda_r_callback(DEVCB_##cb);
#define MCFG_S3C44B0_I2C_SDA_W_CB(cb) \
- devcb = &downcast<s3c44b0_device &>(*device).set_i2c_sda_w_callback(DEVCB_##cb);
+ downcast<s3c44b0_device &>(*device).set_i2c_sda_w_callback(DEVCB_##cb);
#define MCFG_S3C44B0_ADC_DATA_R_CB(cb) \
- devcb = &downcast<s3c44b0_device &>(*device).set_adc_data_r_callback(DEVCB_##cb);
+ downcast<s3c44b0_device &>(*device).set_adc_data_r_callback(DEVCB_##cb);
#define MCFG_S3C44B0_I2S_DATA_W_CB(cb) \
- devcb = &downcast<s3c44b0_device &>(*device).set_i2s_data_w_callback(DEVCB_##cb);
+ downcast<s3c44b0_device &>(*device).set_i2s_data_w_callback(DEVCB_##cb);
#endif // MAME_MACHINE_S3C44B0_H
diff --git a/src/devices/machine/saa1043.h b/src/devices/machine/saa1043.h
index 4ee4e39d57b..92f2f5a0669 100644
--- a/src/devices/machine/saa1043.h
+++ b/src/devices/machine/saa1043.h
@@ -42,58 +42,58 @@
&downcast<saa1043_device &>(*device).set_type(_type);
#define MCFG_SAA1043_BC_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_bc_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_bc_callback(DEVCB_##_write);
#define MCFG_SAA1043_FH2_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_fh2_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_fh2_callback(DEVCB_##_write);
#define MCFG_SAA1043_FH3_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_fh3_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_fh3_callback(DEVCB_##_write);
#define MCFG_SAA1043_FH80_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_fh80_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_fh80_callback(DEVCB_##_write);
#define MCFG_SAA1043_PH_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_ph_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_ph_callback(DEVCB_##_write);
#define MCFG_SAA1043_NS_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_ns_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_ns_callback(DEVCB_##_write);
#define MCFG_SAA1043_RI_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_ri_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_ri_callback(DEVCB_##_write);
#define MCFG_SAA1043_WMP_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_wmp_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_wmp_callback(DEVCB_##_write);
#define MCFG_SAA1043_RR_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_rr_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_rr_callback(DEVCB_##_write);
#define MCFG_SAA1043_V1_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_v1_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_v1_callback(DEVCB_##_write);
#define MCFG_SAA1043_V2_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_v2_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_v2_callback(DEVCB_##_write);
#define MCFG_SAA1043_CLP_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_clp_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_clp_callback(DEVCB_##_write);
#define MCFG_SAA1043_DL_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_dl_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_dl_callback(DEVCB_##_write);
#define MCFG_SAA1043_H1_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_h1_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_h1_callback(DEVCB_##_write);
#define MCFG_SAA1043_H2_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_h2_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_h2_callback(DEVCB_##_write);
#define MCFG_SAA1043_CB_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_cb_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_cb_callback(DEVCB_##_write);
#define MCFG_SAA1043_CS_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_cs_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_cs_callback(DEVCB_##_write);
#define MCFG_SAA1043_ID_CALLBACK(_write) \
- devcb = &downcast<saa1043_device &>(*device).set_id_callback(DEVCB_##_write);
+ downcast<saa1043_device &>(*device).set_id_callback(DEVCB_##_write);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/scnxx562.h b/src/devices/machine/scnxx562.h
index fe4f5442a87..72c2df22a17 100644
--- a/src/devices/machine/scnxx562.h
+++ b/src/devices/machine/scnxx562.h
@@ -78,44 +78,44 @@
// Port A callbacks
#define MCFG_DUSCC_OUT_TXDA_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_txda_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_txda_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_DTRA_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_dtra_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_dtra_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_RTSA_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_rtsa_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_rtsa_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_SYNCA_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_synca_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_synca_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_TRXCA_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_trxca_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_trxca_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_RTXCA_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_rtxca_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_rtxca_callback(DEVCB_##_devcb);
// Port B callbacks
#define MCFG_DUSCC_OUT_TXDB_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_txdb_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_txdb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_DTRB_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_dtrb_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_dtrb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_RTSB_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_rtsb_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_rtsb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_SYNCB_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_syncb_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_syncb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_TRXCB_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_trxcb_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_trxcb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_RTXCB_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_rtxcb_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_rtxcb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_INT_CB(_devcb) \
- devcb = &downcast<duscc_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<duscc_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/sis85c496.cpp b/src/devices/machine/sis85c496.cpp
index ebdbbfa797b..d5b784b84cc 100644
--- a/src/devices/machine/sis85c496.cpp
+++ b/src/devices/machine/sis85c496.cpp
@@ -89,12 +89,12 @@ MACHINE_CONFIG_START(sis85c496_host_device::device_add_mconfig)
MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE(*this, sis85c496_host_device, cpu_int_w))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, sis85c496_host_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)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("keybc", AT_KEYBOARD_CONTROLLER, XTAL(12'000'000))
MCFG_AT_KEYBOARD_CONTROLLER_SYSTEM_RESET_CB(WRITELINE(*this, sis85c496_host_device, cpu_reset_w))
diff --git a/src/devices/machine/smartmed.h b/src/devices/machine/smartmed.h
index 5c9d3cfd946..279f3f3f7c8 100644
--- a/src/devices/machine/smartmed.h
+++ b/src/devices/machine/smartmed.h
@@ -18,7 +18,7 @@
downcast<nand_device &>(*device).set_nand_type((nand_device::chip::type));
#define MCFG_NAND_RNB_CALLBACK(write) \
- devcb = &downcast<nand_device &>(*device).set_rnb_wr_callback(DEVCB_##write);
+ downcast<nand_device &>(*device).set_rnb_wr_callback(DEVCB_##write);
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/devices/machine/smc91c9x.h b/src/devices/machine/smc91c9x.h
index 398ccd58ab5..b0695c4f6cb 100644
--- a/src/devices/machine/smc91c9x.h
+++ b/src/devices/machine/smc91c9x.h
@@ -123,12 +123,12 @@ DECLARE_DEVICE_TYPE(SMC91C96, smc91c96_device)
MCFG_DEVICE_ADD((tag), SMC91C94, 0)
#define MCFG_SMC91C94_IRQ_CALLBACK(write) \
- devcb = &downcast<smc91c94_device &>(*device).set_irq_callback(DEVCB_##write);
+ downcast<smc91c94_device &>(*device).set_irq_callback(DEVCB_##write);
#define MCFG_SMC91C96_ADD(tag) \
MCFG_DEVICE_ADD((tag), SMC91C96, 0)
#define MCFG_SMC91C96_IRQ_CALLBACK(write) \
- devcb = &downcast<smc91c96_device &>(*device).set_irq_callback(DEVCB_##write);
+ downcast<smc91c96_device &>(*device).set_irq_callback(DEVCB_##write);
#endif // MAME_MACHINE_SMC91C9X_H
diff --git a/src/devices/machine/smpc.h b/src/devices/machine/smpc.h
index bb18b14da4f..2321448a67f 100644
--- a/src/devices/machine/smpc.h
+++ b/src/devices/machine/smpc.h
@@ -30,41 +30,41 @@
downcast<smpc_hle_device &>(*device).set_control_port_tags(ctrl1_tag, ctrl2_tag);
#define MCFG_SMPC_HLE_PDR1_IN_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_pdr1_in_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_pdr1_in_handler(DEVCB_##_devcb);
#define MCFG_SMPC_HLE_PDR2_IN_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_pdr2_in_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_pdr2_in_handler(DEVCB_##_devcb);
#define MCFG_SMPC_HLE_PDR1_OUT_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_pdr1_out_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_pdr1_out_handler(DEVCB_##_devcb);
#define MCFG_SMPC_HLE_PDR2_OUT_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_pdr2_out_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_pdr2_out_handler(DEVCB_##_devcb);
#define MCFG_SMPC_HLE_MASTER_RESET_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_master_reset_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_master_reset_handler(DEVCB_##_devcb);
#define MCFG_SMPC_HLE_MASTER_NMI_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_master_nmi_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_master_nmi_handler(DEVCB_##_devcb);
#define MCFG_SMPC_HLE_SLAVE_RESET_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_slave_reset_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_slave_reset_handler(DEVCB_##_devcb);
#define MCFG_SMPC_HLE_SOUND_RESET_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_sound_reset_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_sound_reset_handler(DEVCB_##_devcb);
#define MCFG_SMPC_HLE_SYSTEM_RESET_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_system_reset_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_system_reset_handler(DEVCB_##_devcb);
#define MCFG_SMPC_HLE_SYSTEM_HALT_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_system_halt_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_system_halt_handler(DEVCB_##_devcb);
#define MCFG_SMPC_HLE_DOT_SELECT_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_dot_select_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_dot_select_handler(DEVCB_##_devcb);
// set_irq_handler doesn't work in Saturn driver???
#define MCFG_SMPC_HLE_IRQ_HANDLER_CB(_devcb) \
- devcb = &downcast<smpc_hle_device &>(*device).set_interrupt_handler(DEVCB_##_devcb);
+ downcast<smpc_hle_device &>(*device).set_interrupt_handler(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/steppers.h b/src/devices/machine/steppers.h
index eace7904bcd..9674948d409 100644
--- a/src/devices/machine/steppers.h
+++ b/src/devices/machine/steppers.h
@@ -34,7 +34,7 @@
#define PROJECT_48STEP_REEL 10
#define MCFG_STEPPER_OPTIC_CALLBACK(_write) \
- devcb = &downcast<stepper_device &>(*device).set_optic_handler(DEVCB_##_write);
+ downcast<stepper_device &>(*device).set_optic_handler(DEVCB_##_write);
class stepper_device : public device_t
{
diff --git a/src/devices/machine/te7750.h b/src/devices/machine/te7750.h
index 8f3cc234060..32406b3c52c 100644
--- a/src/devices/machine/te7750.h
+++ b/src/devices/machine/te7750.h
@@ -16,45 +16,45 @@
//**************************************************************************
#define MCFG_TE7750_IN_PORT1_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_input_cb(0, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_input_cb(0, DEVCB_##_devcb);
#define MCFG_TE7750_IN_PORT2_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_input_cb(1, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_input_cb(1, DEVCB_##_devcb);
#define MCFG_TE7750_IN_PORT3_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_input_cb(2, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_input_cb(2, DEVCB_##_devcb);
#define MCFG_TE7750_IN_PORT4_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_input_cb(3, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_input_cb(3, DEVCB_##_devcb);
#define MCFG_TE7750_IN_PORT5_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_input_cb(4, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_input_cb(4, DEVCB_##_devcb);
#define MCFG_TE7750_IN_PORT6_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_input_cb(5, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_input_cb(5, DEVCB_##_devcb);
#define MCFG_TE7750_IN_PORT7_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_input_cb(6, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_input_cb(6, DEVCB_##_devcb);
#define MCFG_TE7750_IN_PORT8_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_input_cb(7, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_input_cb(7, DEVCB_##_devcb);
#define MCFG_TE7750_IN_PORT9_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_input_cb(8, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_input_cb(8, DEVCB_##_devcb);
#define MCFG_TE7750_OUT_PORT1_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_output_cb(0, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_output_cb(0, DEVCB_##_devcb);
#define MCFG_TE7750_OUT_PORT2_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_output_cb(1, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_output_cb(1, DEVCB_##_devcb);
#define MCFG_TE7750_OUT_PORT3_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_output_cb(2, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_output_cb(2, DEVCB_##_devcb);
#define MCFG_TE7750_OUT_PORT4_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_output_cb(3, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_output_cb(3, DEVCB_##_devcb);
#define MCFG_TE7750_OUT_PORT5_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_output_cb(4, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_output_cb(4, DEVCB_##_devcb);
#define MCFG_TE7750_OUT_PORT6_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_output_cb(5, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_output_cb(5, DEVCB_##_devcb);
#define MCFG_TE7750_OUT_PORT7_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_output_cb(6, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_output_cb(6, DEVCB_##_devcb);
#define MCFG_TE7750_OUT_PORT8_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_output_cb(7, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_output_cb(7, DEVCB_##_devcb);
#define MCFG_TE7750_OUT_PORT9_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_output_cb(8, DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_output_cb(8, DEVCB_##_devcb);
#define MCFG_TE7750_IOS_CB(_devcb) \
- devcb = &downcast<te7750_device &>(*device).set_ios_cb(DEVCB_##_devcb);
+ downcast<te7750_device &>(*device).set_ios_cb(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -83,6 +83,25 @@ public:
{
return m_ios_cb.set_callback(std::forward<Object>(obj));
}
+ auto in_port1_cb() { return m_input_cb[0].bind(); }
+ auto in_port2_cb() { return m_input_cb[1].bind(); }
+ auto in_port3_cb() { return m_input_cb[2].bind(); }
+ auto in_port4_cb() { return m_input_cb[3].bind(); }
+ auto in_port5_cb() { return m_input_cb[4].bind(); }
+ auto in_port6_cb() { return m_input_cb[5].bind(); }
+ auto in_port7_cb() { return m_input_cb[6].bind(); }
+ auto in_port8_cb() { return m_input_cb[7].bind(); }
+ auto in_port9_cb() { return m_input_cb[8].bind(); }
+ auto out_port1_cb() { return m_output_cb[0].bind(); }
+ auto out_port2_cb() { return m_output_cb[1].bind(); }
+ auto out_port3_cb() { return m_output_cb[2].bind(); }
+ auto out_port4_cb() { return m_output_cb[3].bind(); }
+ auto out_port5_cb() { return m_output_cb[4].bind(); }
+ auto out_port6_cb() { return m_output_cb[5].bind(); }
+ auto out_port7_cb() { return m_output_cb[6].bind(); }
+ auto out_port8_cb() { return m_output_cb[7].bind(); }
+ auto out_port9_cb() { return m_output_cb[8].bind(); }
+ auto ios_cb() { return m_ios_cb.bind(); }
// bus-compatible interface
DECLARE_READ8_MEMBER(read);
diff --git a/src/devices/machine/timekpr.h b/src/devices/machine/timekpr.h
index ffeef9efa63..c0f7fcdc83a 100644
--- a/src/devices/machine/timekpr.h
+++ b/src/devices/machine/timekpr.h
@@ -27,10 +27,10 @@
//**************************************************************************
#define MCFG_M48T37_RESET_HANDLER(_devcb) \
- devcb = &downcast<timekeeper_device &>(*device).set_reset_handler(DEVCB_##_devcb);
+ downcast<timekeeper_device &>(*device).set_reset_handler(DEVCB_##_devcb);
#define MCFG_M48T37_IRQ_HANDLER(_devcb) \
- devcb = &downcast<timekeeper_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<timekeeper_device &>(*device).set_irq_handler(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/tmp68301.h b/src/devices/machine/tmp68301.h
index c2d2c9cdbbd..eae1cd69a48 100644
--- a/src/devices/machine/tmp68301.h
+++ b/src/devices/machine/tmp68301.h
@@ -18,10 +18,10 @@
downcast<tmp68301_device &>(*device).set_cpu_tag(_tag);
#define MCFG_TMP68301_IN_PARALLEL_CB(cb) \
- devcb = &downcast<tmp68301_device &>(*device).set_in_parallel_callback((DEVCB_##cb));
+ downcast<tmp68301_device &>(*device).set_in_parallel_callback((DEVCB_##cb));
#define MCFG_TMP68301_OUT_PARALLEL_CB(cb) \
- devcb = &downcast<tmp68301_device &>(*device).set_out_parallel_callback((DEVCB_##cb));
+ downcast<tmp68301_device &>(*device).set_out_parallel_callback((DEVCB_##cb));
//**************************************************************************
diff --git a/src/devices/machine/tms1024.h b/src/devices/machine/tms1024.h
index eae25fca18d..6c11a50eafa 100644
--- a/src/devices/machine/tms1024.h
+++ b/src/devices/machine/tms1024.h
@@ -18,9 +18,9 @@
// 4-bit ports (3210 = DCBA)
// valid ports: 4-7 for TMS1024, 1-7 for TMS1025
#define MCFG_TMS1025_READ_PORT_CB(X, cb) \
- devcb = &downcast<tms1024_device &>(*device).set_read_port_callback<(tms1024_device::X)>((DEVCB_##cb));
+ downcast<tms1024_device &>(*device).set_read_port_callback<(tms1024_device::X)>((DEVCB_##cb));
#define MCFG_TMS1025_WRITE_PORT_CB(X, cb) \
- devcb = &downcast<tms1024_device &>(*device).set_write_port_callback<(tms1024_device::X)>((DEVCB_##cb));
+ downcast<tms1024_device &>(*device).set_write_port_callback<(tms1024_device::X)>((DEVCB_##cb));
// pinout reference
@@ -71,6 +71,14 @@ public:
// configuration helpers
template <unsigned N, class Object> devcb_base &set_read_port_callback(Object &&cb) { return m_read_port[N].set_callback(std::forward<Object>(cb)); }
template <unsigned N, class Object> devcb_base &set_write_port_callback(Object &&cb) { return m_write_port[N].set_callback(std::forward<Object>(cb)); }
+ auto read_port4_callback() { return m_read_port[3].bind(); }
+ auto read_port5_callback() { return m_read_port[4].bind(); }
+ auto read_port6_callback() { return m_read_port[5].bind(); }
+ auto read_port7_callback() { return m_read_port[6].bind(); }
+ auto write_port4_callback() { return m_write_port[3].bind(); }
+ auto write_port5_callback() { return m_write_port[4].bind(); }
+ auto write_port6_callback() { return m_write_port[5].bind(); }
+ auto write_port7_callback() { return m_write_port[6].bind(); }
DECLARE_WRITE8_MEMBER(write_h);
DECLARE_READ8_MEMBER(read_h);
@@ -99,6 +107,13 @@ class tms1025_device : public tms1024_device
{
public:
tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
+
+ auto read_port1_callback() { return m_read_port[0].bind(); }
+ auto read_port2_callback() { return m_read_port[1].bind(); }
+ auto read_port3_callback() { return m_read_port[2].bind(); }
+ auto write_port1_callback() { return m_write_port[0].bind(); }
+ auto write_port2_callback() { return m_write_port[1].bind(); }
+ auto write_port3_callback() { return m_write_port[2].bind(); }
};
diff --git a/src/devices/machine/tms5501.h b/src/devices/machine/tms5501.h
index b7970ed1a48..8510ccaced3 100644
--- a/src/devices/machine/tms5501.h
+++ b/src/devices/machine/tms5501.h
@@ -43,16 +43,16 @@
//**************************************************************************
#define MCFG_TMS5501_IRQ_CALLBACK(_write) \
- devcb = &downcast<tms5501_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
+ downcast<tms5501_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_TMS5501_XMT_CALLBACK(_write) \
- devcb = &downcast<tms5501_device &>(*device).set_xmt_wr_callback(DEVCB_##_write);
+ downcast<tms5501_device &>(*device).set_xmt_wr_callback(DEVCB_##_write);
#define MCFG_TMS5501_XI_CALLBACK(_read) \
- devcb = &downcast<tms5501_device &>(*device).set_xi_rd_callback(DEVCB_##_read);
+ downcast<tms5501_device &>(*device).set_xi_rd_callback(DEVCB_##_read);
#define MCFG_TMS5501_XO_CALLBACK(_write) \
- devcb = &downcast<tms5501_device &>(*device).set_xo_wr_callback(DEVCB_##_write);
+ downcast<tms5501_device &>(*device).set_xo_wr_callback(DEVCB_##_write);
diff --git a/src/devices/machine/tms9901.h b/src/devices/machine/tms9901.h
index f8b2685c174..5219ea1800e 100644
--- a/src/devices/machine/tms9901.h
+++ b/src/devices/machine/tms9901.h
@@ -139,57 +139,57 @@ private:
***************************************************************************/
#define MCFG_TMS9901_READBLOCK_HANDLER( _read ) \
- devcb = &downcast<tms9901_device &>(*device).set_readblock_callback(DEVCB_##_read);
+ downcast<tms9901_device &>(*device).set_readblock_callback(DEVCB_##_read);
#define MCFG_TMS9901_P0_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<0>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<0>(DEVCB_##_write);
#define MCFG_TMS9901_P1_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<1>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<1>(DEVCB_##_write);
#define MCFG_TMS9901_P2_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<2>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<2>(DEVCB_##_write);
#define MCFG_TMS9901_P3_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<3>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<3>(DEVCB_##_write);
#define MCFG_TMS9901_P4_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<4>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<4>(DEVCB_##_write);
#define MCFG_TMS9901_P5_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<5>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<5>(DEVCB_##_write);
#define MCFG_TMS9901_P6_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<6>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<6>(DEVCB_##_write);
#define MCFG_TMS9901_P7_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<7>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<7>(DEVCB_##_write);
#define MCFG_TMS9901_P8_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<8>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<8>(DEVCB_##_write);
#define MCFG_TMS9901_P9_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<9>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<9>(DEVCB_##_write);
#define MCFG_TMS9901_P10_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<10>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<10>(DEVCB_##_write);
#define MCFG_TMS9901_P11_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<11>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<11>(DEVCB_##_write);
#define MCFG_TMS9901_P12_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<12>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<12>(DEVCB_##_write);
#define MCFG_TMS9901_P13_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<13>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<13>(DEVCB_##_write);
#define MCFG_TMS9901_P14_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<14>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<14>(DEVCB_##_write);
#define MCFG_TMS9901_P15_HANDLER( _write ) \
- devcb = &downcast<tms9901_device &>(*device).set_p_callback<15>(DEVCB_##_write);
+ downcast<tms9901_device &>(*device).set_p_callback<15>(DEVCB_##_write);
#define MCFG_TMS9901_INTLEVEL_HANDLER( _intlevel ) \
- devcb = &downcast<tms9901_device &>(*device).set_intlevel_callback(DEVCB_##_intlevel);
+ downcast<tms9901_device &>(*device).set_intlevel_callback(DEVCB_##_intlevel);
#endif // MAME_MACHINE_TMS9901_H
diff --git a/src/devices/machine/tms9902.h b/src/devices/machine/tms9902.h
index 1cc824e73ff..1d3a96829db 100644
--- a/src/devices/machine/tms9902.h
+++ b/src/devices/machine/tms9902.h
@@ -190,15 +190,15 @@ private:
***************************************************************************/
#define MCFG_TMS9902_INT_CB(cb) \
- devcb = &downcast<tms9902_device &>(*device).set_int_callback((DEVCB_##cb));
+ downcast<tms9902_device &>(*device).set_int_callback((DEVCB_##cb));
#define MCFG_TMS9902_RCV_CB(cb) \
- devcb = &downcast<tms9902_device &>(*device).set_rcv_callback((DEVCB_##cb));
+ downcast<tms9902_device &>(*device).set_rcv_callback((DEVCB_##cb));
#define MCFG_TMS9902_XMIT_CB(cb) \
- devcb = &downcast<tms9902_device &>(*device).set_xmit_callback((DEVCB_##cb));
+ downcast<tms9902_device &>(*device).set_xmit_callback((DEVCB_##cb));
#define MCFG_TMS9902_CTRL_CB(cb) \
- devcb = &downcast<tms9902_device &>(*device).set_ctrl_callback((DEVCB_##cb));
+ downcast<tms9902_device &>(*device).set_ctrl_callback((DEVCB_##cb));
#endif // MAME_MACHINE_TMS9902_H
diff --git a/src/devices/machine/tube.h b/src/devices/machine/tube.h
index 71e7693a8ba..17223d22f84 100644
--- a/src/devices/machine/tube.h
+++ b/src/devices/machine/tube.h
@@ -21,16 +21,16 @@
MCFG_DEVICE_ADD(_tag, TUBE, 0);
#define MCFG_TUBE_HIRQ_HANDLER(_devcb) \
- devcb = &downcast<tube_device &>(*device).set_hirq_handler(DEVCB_##_devcb);
+ downcast<tube_device &>(*device).set_hirq_handler(DEVCB_##_devcb);
#define MCFG_TUBE_PNMI_HANDLER(_devcb) \
- devcb = &downcast<tube_device &>(*device).set_pnmi_handler(DEVCB_##_devcb);
+ downcast<tube_device &>(*device).set_pnmi_handler(DEVCB_##_devcb);
#define MCFG_TUBE_PIRQ_HANDLER(_devcb) \
- devcb = &downcast<tube_device &>(*device).set_pirq_handler(DEVCB_##_devcb);
+ downcast<tube_device &>(*device).set_pirq_handler(DEVCB_##_devcb);
#define MCFG_TUBE_DRQ_HANDLER(_devcb) \
- devcb = &downcast<tube_device &>(*device).set_drq_handler(DEVCB_##_devcb);
+ downcast<tube_device &>(*device).set_drq_handler(DEVCB_##_devcb);
@@ -52,6 +52,10 @@ public:
template <class Object> devcb_base &set_pnmi_handler(Object &&cb) { return m_pnmi_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_pirq_handler(Object &&cb) { return m_pirq_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_drq_handler(Object &&cb) { return m_drq_handler.set_callback(std::forward<Object>(cb)); }
+ auto hirq_handler() { return m_hirq_handler.bind(); }
+ auto pnmi_handler() { return m_pnmi_handler.bind(); }
+ auto pirq_handler() { return m_pirq_handler.bind(); }
+ auto drq_handler() { return m_drq_handler.bind(); }
DECLARE_READ8_MEMBER(host_r);
DECLARE_WRITE8_MEMBER(host_w);
diff --git a/src/devices/machine/upd71071.h b/src/devices/machine/upd71071.h
index 7989d180169..9b05766dd74 100644
--- a/src/devices/machine/upd71071.h
+++ b/src/devices/machine/upd71071.h
@@ -82,45 +82,45 @@ DECLARE_DEVICE_TYPE(UPD71071, upd71071_device)
downcast<upd71071_device &>(*device).set_clock((clk));
#define MCFG_UPD71071_OUT_HREQ_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_out_hreq_callback((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_out_hreq_callback((DEVCB_##cb));
#define MCFG_UPD71071_OUT_EOP_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_out_eop_callback((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_out_eop_callback((DEVCB_##cb));
#define MCFG_UPD71071_DMA_READ_0_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_dma_read_callback<0>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_dma_read_callback<0>((DEVCB_##cb));
#define MCFG_UPD71071_DMA_READ_1_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_dma_read_callback<1>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_dma_read_callback<1>((DEVCB_##cb));
#define MCFG_UPD71071_DMA_READ_2_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_dma_read_callback<2>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_dma_read_callback<2>((DEVCB_##cb));
#define MCFG_UPD71071_DMA_READ_3_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_dma_read_callback<3>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_dma_read_callback<3>((DEVCB_##cb));
#define MCFG_UPD71071_DMA_WRITE_0_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_dma_write_callback<0>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_dma_write_callback<0>((DEVCB_##cb));
#define MCFG_UPD71071_DMA_WRITE_1_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_dma_write_callback<1>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_dma_write_callback<1>((DEVCB_##cb));
#define MCFG_UPD71071_DMA_WRITE_2_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_dma_write_callback<2>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_dma_write_callback<2>((DEVCB_##cb));
#define MCFG_UPD71071_DMA_WRITE_3_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_dma_write_callback<3>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_dma_write_callback<3>((DEVCB_##cb));
#define MCFG_UPD71071_OUT_DACK_0_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_out_dack_callback<0>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_out_dack_callback<0>((DEVCB_##cb));
#define MCFG_UPD71071_OUT_DACK_1_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_out_dack_callback<1>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_out_dack_callback<1>((DEVCB_##cb));
#define MCFG_UPD71071_OUT_DACK_2_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_out_dack_callback<2>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_out_dack_callback<2>((DEVCB_##cb));
#define MCFG_UPD71071_OUT_DACK_3_CB(cb) \
- devcb = &downcast<upd71071_device &>(*device).set_out_dack_callback<3>((DEVCB_##cb));
+ downcast<upd71071_device &>(*device).set_out_dack_callback<3>((DEVCB_##cb));
#endif // MAME_MACHINE_UPD71071_H
diff --git a/src/devices/machine/upd765.h b/src/devices/machine/upd765.h
index 2eefbc9ae55..d0c7c6ac3ae 100644
--- a/src/devices/machine/upd765.h
+++ b/src/devices/machine/upd765.h
@@ -63,16 +63,16 @@
MCFG_DEVICE_ADD(_tag, TC8566AF, 0)
#define MCFG_MCS3201_INPUT_HANDLER(_devcb) \
- devcb = &downcast<mcs3201_device &>(*device).set_input_handler(DEVCB_##_devcb);
+ downcast<mcs3201_device &>(*device).set_input_handler(DEVCB_##_devcb);
#define MCFG_UPD765_INTRQ_CALLBACK(_write) \
- devcb = &downcast<upd765_family_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
+ downcast<upd765_family_device &>(*device).set_intrq_wr_callback(DEVCB_##_write);
#define MCFG_UPD765_DRQ_CALLBACK(_write) \
- devcb = &downcast<upd765_family_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
+ downcast<upd765_family_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
#define MCFG_UPD765_HDL_CALLBACK(_write) \
- devcb = &downcast<upd765_family_device &>(*device).set_hdl_wr_callback(DEVCB_##_write);
+ downcast<upd765_family_device &>(*device).set_hdl_wr_callback(DEVCB_##_write);
/* Interface required for PC ISA wrapping */
class pc_fdc_interface : public device_t {
@@ -104,6 +104,9 @@ public:
template <class Object> devcb_base &set_intrq_wr_callback(Object &&cb) { return intrq_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_drq_wr_callback(Object &&cb) { return drq_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_hdl_wr_callback(Object &&cb) { return hdl_cb.set_callback(std::forward<Object>(cb)); }
+ auto intrq_wr_callback() { return intrq_cb.bind(); }
+ auto drq_wr_callback() { return drq_cb.bind(); }
+ auto hdl_wr_callback() { return hdl_cb.bind(); }
virtual void map(address_map &map) override = 0;
@@ -435,6 +438,10 @@ protected:
class upd765a_device : public upd765_family_device {
public:
+ upd765a_device(const machine_config &mconfig, const char *tag, device_t *owner, bool ready, bool select) : upd765a_device(mconfig, tag, owner, 0U) {
+ set_ready_line_connected(ready);
+ set_select_lines_connected(select);
+ }
upd765a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual void map(address_map &map) override;
diff --git a/src/devices/machine/vrc4373.h b/src/devices/machine/vrc4373.h
index 0e4e205db11..d7c9d6b420c 100644
--- a/src/devices/machine/vrc4373.h
+++ b/src/devices/machine/vrc4373.h
@@ -17,7 +17,7 @@
downcast<vrc4373_device &>(*device).set_simm0_size(_size);
#define MCFG_VRC4373_IRQ_CB(_devcb) \
- devcb = &ide_pci_device::set_irq_cb(*device, DEVCB_##_devcb);
+ ide_pci_device::set_irq_cb(*device, DEVCB_##_devcb);
class vrc4373_device : public pci_host_device {
diff --git a/src/devices/machine/wd11c00_17.h b/src/devices/machine/wd11c00_17.h
index 8f644aba758..c0fb4391924 100644
--- a/src/devices/machine/wd11c00_17.h
+++ b/src/devices/machine/wd11c00_17.h
@@ -18,37 +18,37 @@
//**************************************************************************
#define MCFG_WD11C00_17_OUT_IRQ5_CB(_devcb) \
- devcb = &downcast<wd11c00_17_device &>(*device).set_out_irq5_callback(DEVCB_##_devcb);
+ downcast<wd11c00_17_device &>(*device).set_out_irq5_callback(DEVCB_##_devcb);
#define MCFG_WD11C00_17_OUT_DRQ3_CB(_devcb) \
- devcb = &downcast<wd11c00_17_device &>(*device).set_out_drq3_callback(DEVCB_##_devcb);
+ downcast<wd11c00_17_device &>(*device).set_out_drq3_callback(DEVCB_##_devcb);
#define MCFG_WD11C00_17_OUT_MR_CB(_devcb) \
- devcb = &downcast<wd11c00_17_device &>(*device).set_out_mr_callback(DEVCB_##_devcb);
+ downcast<wd11c00_17_device &>(*device).set_out_mr_callback(DEVCB_##_devcb);
#define MCFG_WD11C00_17_OUT_BUSY_CB(_devcb) \
- devcb = &downcast<wd11c00_17_device &>(*device).set_out_busy_callback(DEVCB_##_devcb);
+ downcast<wd11c00_17_device &>(*device).set_out_busy_callback(DEVCB_##_devcb);
#define MCFG_WD11C00_17_OUT_REQ_CB(_devcb) \
- devcb = &downcast<wd11c00_17_device &>(*device).set_out_req_callback(DEVCB_##_devcb);
+ downcast<wd11c00_17_device &>(*device).set_out_req_callback(DEVCB_##_devcb);
#define MCFG_WD11C00_17_OUT_RA3_CB(_devcb) \
- devcb = &downcast<wd11c00_17_device &>(*device).set_out_ra3_callback(DEVCB_##_devcb);
+ downcast<wd11c00_17_device &>(*device).set_out_ra3_callback(DEVCB_##_devcb);
#define MCFG_WD11C00_17_IN_RD322_CB(_devcb) \
- devcb = &downcast<wd11c00_17_device &>(*device).set_in_rd322_callback(DEVCB_##_devcb);
+ downcast<wd11c00_17_device &>(*device).set_in_rd322_callback(DEVCB_##_devcb);
#define MCFG_WD11C00_17_IN_RAMCS_CB(_devcb) \
- devcb = &downcast<wd11c00_17_device &>(*device).set_in_ramcs_callback(DEVCB_##_devcb);
+ downcast<wd11c00_17_device &>(*device).set_in_ramcs_callback(DEVCB_##_devcb);
#define MCFG_WD11C00_17_OUT_RAMWR_CB(_devcb) \
- devcb = &downcast<wd11c00_17_device &>(*device).set_out_ramwr_callback(DEVCB_##_devcb);
+ downcast<wd11c00_17_device &>(*device).set_out_ramwr_callback(DEVCB_##_devcb);
#define MCFG_WD11C00_17_IN_CS1010_CB(_devcb) \
- devcb = &downcast<wd11c00_17_device &>(*device).set_in_cs1010_callback(DEVCB_##_devcb);
+ downcast<wd11c00_17_device &>(*device).set_in_cs1010_callback(DEVCB_##_devcb);
#define MCFG_WD11C00_17_OUT_CS1010_CB(_devcb) \
- devcb = &downcast<wd11c00_17_device &>(*device).set_out_cs1010_callback(DEVCB_##_devcb);
+ downcast<wd11c00_17_device &>(*device).set_out_cs1010_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -73,6 +73,17 @@ public:
template <class Object> devcb_base &set_out_ramwr_callback(Object &&cb) { return m_out_ramwr_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_in_cs1010_callback(Object &&cb) { return m_in_cs1010_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_out_cs1010_callback(Object &&cb) { return m_out_cs1010_cb.set_callback(std::forward<Object>(cb)); }
+ auto out_irq5_callback() { return m_out_irq5_cb.bind(); }
+ auto out_drq3_callback() { return m_out_drq3_cb.bind(); }
+ auto out_mr_callback() { return m_out_mr_cb.bind(); }
+ auto out_busy_callback() { return m_out_busy_cb.bind(); }
+ auto out_req_callback() { return m_out_req_cb.bind(); }
+ auto out_ra3_callback() { return m_out_ra3_cb.bind(); }
+ auto in_rd322_callback() { return m_in_rd322_cb.bind(); }
+ auto in_ramcs_callback() { return m_in_ramcs_cb.bind(); }
+ auto out_ramwr_callback() { return m_out_ramwr_cb.bind(); }
+ auto in_cs1010_callback() { return m_in_cs1010_cb.bind(); }
+ auto out_cs1010_callback() { return m_out_cs1010_cb.bind(); }
DECLARE_READ8_MEMBER( io_r );
DECLARE_WRITE8_MEMBER( io_w );
diff --git a/src/devices/machine/wd2010.h b/src/devices/machine/wd2010.h
index 47e928d20cf..5cba995b3da 100644
--- a/src/devices/machine/wd2010.h
+++ b/src/devices/machine/wd2010.h
@@ -19,49 +19,49 @@
//**************************************************************************
#define MCFG_WD2010_OUT_INTRQ_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_out_intrq_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_out_intrq_callback(DEVCB_##_devcb);
#define MCFG_WD2010_OUT_BDRQ_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_out_bdrq_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_out_bdrq_callback(DEVCB_##_devcb);
#define MCFG_WD2010_OUT_BCR_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_out_bcr_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_out_bcr_callback(DEVCB_##_devcb);
#define MCFG_WD2010_IN_BRDY_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_in_brdy_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_in_brdy_callback(DEVCB_##_devcb);
#define MCFG_WD2010_IN_BCS_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_in_bcs_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_in_bcs_callback(DEVCB_##_devcb);
#define MCFG_WD2010_OUT_BCS_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_out_bcs_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_out_bcs_callback(DEVCB_##_devcb);
#define MCFG_WD2010_OUT_DIRIN_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_out_dirin_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_out_dirin_callback(DEVCB_##_devcb);
#define MCFG_WD2010_OUT_STEP_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_out_step_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_out_step_callback(DEVCB_##_devcb);
#define MCFG_WD2010_OUT_RWC_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_out_rwc_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_out_rwc_callback(DEVCB_##_devcb);
#define MCFG_WD2010_OUT_WG_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_out_wg_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_out_wg_callback(DEVCB_##_devcb);
#define MCFG_WD2010_IN_DRDY_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_in_drdy_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_in_drdy_callback(DEVCB_##_devcb);
#define MCFG_WD2010_IN_INDEX_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_in_index_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_in_index_callback(DEVCB_##_devcb);
#define MCFG_WD2010_IN_WF_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_in_wf_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_in_wf_callback(DEVCB_##_devcb);
#define MCFG_WD2010_IN_TK000_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_in_tk000_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_in_tk000_callback(DEVCB_##_devcb);
#define MCFG_WD2010_IN_SC_CB(_devcb) \
- devcb = &downcast<wd2010_device &>(*device).set_in_sc_callback(DEVCB_##_devcb);
+ downcast<wd2010_device &>(*device).set_in_sc_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -90,6 +90,21 @@ public:
template <class Object> devcb_base &set_in_wf_callback(Object &&cb) { return m_in_wf_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_in_tk000_callback(Object &&cb) { return m_in_tk000_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_in_sc_callback(Object &&cb) { return m_in_sc_cb.set_callback(std::forward<Object>(cb)); }
+ auto out_intrq_callback() { return m_out_intrq_cb.bind(); }
+ auto out_bdrq_callback() { return m_out_bdrq_cb.bind(); }
+ auto out_bcr_callback() { return m_out_bcr_cb.bind(); }
+ auto in_brdy_callback() { return m_in_brdy_cb.bind(); }
+ auto in_bcs_callback() { return m_in_bcs_cb.bind(); }
+ auto out_bcs_callback() { return m_out_bcs_cb.bind(); }
+ auto out_dirin_callback() { return m_out_dirin_cb.bind(); }
+ auto out_step_callback() { return m_out_step_cb.bind(); }
+ auto out_rwc_callback() { return m_out_rwc_cb.bind(); }
+ auto out_wg_callback() { return m_out_wg_cb.bind(); }
+ auto in_drdy_callback() { return m_in_drdy_cb.bind(); }
+ auto in_index_callback() { return m_in_index_cb.bind(); }
+ auto in_wf_callback() { return m_in_wf_cb.bind(); }
+ auto in_tk000_callback() { return m_in_tk000_cb.bind(); }
+ auto in_sc_callback() { return m_in_sc_cb.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/machine/wd33c93.h b/src/devices/machine/wd33c93.h
index a0dd224b1db..6f3e8ad2408 100644
--- a/src/devices/machine/wd33c93.h
+++ b/src/devices/machine/wd33c93.h
@@ -13,7 +13,7 @@
#include "legscsi.h"
#define MCFG_WD33C93_IRQ_CB(cb) \
- devcb = &downcast<wd33c93_device &>(*device).set_irq_callback((DEVCB_##cb));
+ downcast<wd33c93_device &>(*device).set_irq_callback((DEVCB_##cb));
class wd33c93_device : public legacy_scsi_host_adapter
{
diff --git a/src/devices/machine/wd7600.cpp b/src/devices/machine/wd7600.cpp
index a334a14428b..55553c3f92a 100644
--- a/src/devices/machine/wd7600.cpp
+++ b/src/devices/machine/wd7600.cpp
@@ -56,12 +56,12 @@ MACHINE_CONFIG_START(wd7600_device::device_add_mconfig)
MCFG_DEVICE_ADD("intc1", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE(*this, wd7600_device, pic1_int_w))
- MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(1))
MCFG_PIC8259_CASCADE_ACK_CB(READ8(*this, wd7600_device, pic1_slave_ack_r))
MCFG_DEVICE_ADD("intc2", PIC8259, 0)
MCFG_PIC8259_OUT_INT_CB(WRITELINE("intc1", pic8259_device, ir2_w))
- MCFG_PIC8259_IN_SP_CB(GND)
+ MCFG_PIC8259_IN_SP_CB(CONSTANT(0))
MCFG_DEVICE_ADD("ctc", PIT8254, 0)
MCFG_PIT8253_CLK0(XTAL(14'318'181) / 12.0)
diff --git a/src/devices/machine/wd7600.h b/src/devices/machine/wd7600.h
index 4e8093c5110..de70cef8e56 100644
--- a/src/devices/machine/wd7600.h
+++ b/src/devices/machine/wd7600.h
@@ -27,31 +27,31 @@
downcast<wd7600_device &>(*device).set_keybctag(_keybctag);
#define MCFG_WD7600_IOR(_ior) \
- devcb = &downcast<wd7600_device *>(device)->set_ior_callback(DEVCB_##_ior);
+ downcast<wd7600_device *>(device)->set_ior_callback(DEVCB_##_ior);
#define MCFG_WD7600_IOW(_iow) \
- devcb = &downcast<wd7600_device *>(device)->set_iow_callback(DEVCB_##_iow);
+ downcast<wd7600_device *>(device)->set_iow_callback(DEVCB_##_iow);
#define MCFG_WD7600_TC(_tc) \
- devcb = &downcast<wd7600_device *>(device)->set_tc_callback(DEVCB_##_tc);
+ downcast<wd7600_device *>(device)->set_tc_callback(DEVCB_##_tc);
#define MCFG_WD7600_HOLD(_hold) \
- devcb = &downcast<wd7600_device *>(device)->set_hold_callback(DEVCB_##_hold);
+ downcast<wd7600_device *>(device)->set_hold_callback(DEVCB_##_hold);
#define MCFG_WD7600_NMI(_nmi) \
- devcb = &downcast<wd7600_device *>(device)->set_nmi_callback(DEVCB_##_nmi);
+ downcast<wd7600_device *>(device)->set_nmi_callback(DEVCB_##_nmi);
#define MCFG_WD7600_INTR(_intr) \
- devcb = &downcast<wd7600_device *>(device)->set_intr_callback(DEVCB_##_intr);
+ downcast<wd7600_device *>(device)->set_intr_callback(DEVCB_##_intr);
#define MCFG_WD7600_CPURESET(_cpureset) \
- devcb = &downcast<wd7600_device *>(device)->set_cpureset_callback(DEVCB_##_cpureset);
+ downcast<wd7600_device *>(device)->set_cpureset_callback(DEVCB_##_cpureset);
#define MCFG_WD7600_A20M(_a20m) \
- devcb = &downcast<wd7600_device *>(device)->set_a20m_callback(DEVCB_##_a20m);
+ downcast<wd7600_device *>(device)->set_a20m_callback(DEVCB_##_a20m);
#define MCFG_WD7600_SPKR(_spkr) \
- devcb = &downcast<wd7600_device *>(device)->set_spkr_callback(DEVCB_##_spkr);
+ downcast<wd7600_device *>(device)->set_spkr_callback(DEVCB_##_spkr);
//**************************************************************************
diff --git a/src/devices/machine/wd_fdc.h b/src/devices/machine/wd_fdc.h
index 6f59190ea31..291cd384703 100644
--- a/src/devices/machine/wd_fdc.h
+++ b/src/devices/machine/wd_fdc.h
@@ -52,19 +52,19 @@
downcast<wd_fdc_device_base *>(device)->set_disable_motor_control(true);
#define MCFG_WD_FDC_INTRQ_CALLBACK(_write) \
- devcb = &downcast<wd_fdc_device_base &>(*device).set_intrq_wr_callback(DEVCB_##_write);
+ downcast<wd_fdc_device_base &>(*device).set_intrq_wr_callback(DEVCB_##_write);
#define MCFG_WD_FDC_DRQ_CALLBACK(_write) \
- devcb = &downcast<wd_fdc_device_base &>(*device).set_drq_wr_callback(DEVCB_##_write);
+ downcast<wd_fdc_device_base &>(*device).set_drq_wr_callback(DEVCB_##_write);
#define MCFG_WD_FDC_HLD_CALLBACK(_write) \
- devcb = &downcast<wd_fdc_device_base &>(*device).set_hld_wr_callback(DEVCB_##_write);
+ downcast<wd_fdc_device_base &>(*device).set_hld_wr_callback(DEVCB_##_write);
#define MCFG_WD_FDC_ENP_CALLBACK(_write) \
- devcb = &downcast<wd_fdc_device_base &>(*device).set_enp_wr_callback(DEVCB_##_write);
+ downcast<wd_fdc_device_base &>(*device).set_enp_wr_callback(DEVCB_##_write);
#define MCFG_WD_FDC_ENMF_CALLBACK(_read) \
- devcb = &downcast<wd_fdc_device_base &>(*device).set_enmf_rd_callback(DEVCB_##_read);
+ downcast<wd_fdc_device_base &>(*device).set_enmf_rd_callback(DEVCB_##_read);
class wd_fdc_device_base : public device_t {
public:
@@ -73,6 +73,11 @@ public:
template <class Object> devcb_base &set_hld_wr_callback(Object &&cb) { return hld_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_enp_wr_callback(Object &&cb) { return enp_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_enmf_rd_callback(Object &&cb) { return enmf_cb.set_callback(std::forward<Object>(cb)); }
+ auto intrq_wr_callback() { return intrq_cb.bind(); }
+ auto drq_wr_callback() { return drq_cb.bind(); }
+ auto hld_wr_callback() { return hld_cb.bind(); }
+ auto enp_wr_callback() { return enp_cb.bind(); }
+ auto enmf_rd_callback() { return enmf_cb.bind(); }
void soft_reset();
diff --git a/src/devices/machine/ym2148.h b/src/devices/machine/ym2148.h
index d3dad3db350..3e554cec240 100644
--- a/src/devices/machine/ym2148.h
+++ b/src/devices/machine/ym2148.h
@@ -20,16 +20,16 @@
//**************************************************************************
#define MCFG_YM2148_TXD_HANDLER(_devcb) \
- devcb = &downcast<ym2148_device &>(*device).set_txd_handler(DEVCB_##_devcb);
+ downcast<ym2148_device &>(*device).set_txd_handler(DEVCB_##_devcb);
#define MCFG_YM2148_PORT_WRITE_HANDLER(_devcb) \
- devcb = &downcast<ym2148_device &>(*device).set_port_write_handler(DEVCB_##_devcb);
+ downcast<ym2148_device &>(*device).set_port_write_handler(DEVCB_##_devcb);
#define MCFG_YM2148_PORT_READ_HANDLER(_devcb) \
- devcb = &downcast<ym2148_device &>(*device).set_port_read_handler(DEVCB_##_devcb);
+ downcast<ym2148_device &>(*device).set_port_read_handler(DEVCB_##_devcb);
#define MCFG_YM2148_IRQ_HANDLER(_devcb) \
- devcb = &downcast<ym2148_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<ym2148_device &>(*device).set_irq_handler(DEVCB_##_devcb);
class ym2148_device : public device_t, public device_serial_interface
diff --git a/src/devices/machine/ym3802.h b/src/devices/machine/ym3802.h
index 4b05098fc7d..f1f827cb619 100644
--- a/src/devices/machine/ym3802.h
+++ b/src/devices/machine/ym3802.h
@@ -24,10 +24,10 @@
#include <queue>
#define MCFG_YM3802_IRQ_HANDLER(_devcb) \
- devcb = &downcast<ym3802_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<ym3802_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_YM3802_TXD_HANDLER(_devcb) \
- devcb = &downcast<ym3802_device &>(*device).set_txd_handler(DEVCB_##_devcb);
+ downcast<ym3802_device &>(*device).set_txd_handler(DEVCB_##_devcb);
class ym3802_device : public device_t, public device_serial_interface
{
diff --git a/src/devices/machine/z80ctc.h b/src/devices/machine/z80ctc.h
index 158028c9e9f..ce07fd9cf61 100644
--- a/src/devices/machine/z80ctc.h
+++ b/src/devices/machine/z80ctc.h
@@ -36,20 +36,20 @@
//**************************************************************************
#define MCFG_Z80CTC_INTR_CB(_devcb) \
- devcb = &downcast<z80ctc_device &>(*device).set_intr_callback(DEVCB_##_devcb);
+ downcast<z80ctc_device &>(*device).set_intr_callback(DEVCB_##_devcb);
#define MCFG_Z80CTC_ZC0_CB(_devcb) \
- devcb = &downcast<z80ctc_device &>(*device).set_zc_callback<0>(DEVCB_##_devcb);
+ downcast<z80ctc_device &>(*device).set_zc_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80CTC_ZC1_CB(_devcb) \
- devcb = &downcast<z80ctc_device &>(*device).set_zc_callback<1>(DEVCB_##_devcb);
+ downcast<z80ctc_device &>(*device).set_zc_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80CTC_ZC2_CB(_devcb) \
- devcb = &downcast<z80ctc_device &>(*device).set_zc_callback<2>(DEVCB_##_devcb);
+ downcast<z80ctc_device &>(*device).set_zc_callback<2>(DEVCB_##_devcb);
// not supported on a standard ctc, only used for the tmpz84c015
#define MCFG_Z80CTC_ZC3_CB(_devcb) \
- devcb = &downcast<z80ctc_device &>(*device).set_zc_callback<3>(DEVCB_##_devcb);
+ downcast<z80ctc_device &>(*device).set_zc_callback<3>(DEVCB_##_devcb);
//**************************************************************************
@@ -105,6 +105,8 @@ public:
template <class Object> devcb_base &set_intr_callback(Object &&cb) { return m_intr_cb.set_callback(std::forward<Object>(cb)); }
template <int Channel, class Object> devcb_base &set_zc_callback(Object &&cb) { return m_zc_cb[Channel].set_callback(std::forward<Object>(cb)); }
+ auto intr_callback() { return m_intr_cb.bind(); }
+ template <int Channel> auto zc_callback() { return m_zc_cb[Channel].bind(); }
// read/write handlers
DECLARE_READ8_MEMBER( read );
diff --git a/src/devices/machine/z80daisy_generic.h b/src/devices/machine/z80daisy_generic.h
index e30cef85139..1270abf8659 100644
--- a/src/devices/machine/z80daisy_generic.h
+++ b/src/devices/machine/z80daisy_generic.h
@@ -23,7 +23,7 @@
downcast<z80daisy_generic_device &>(*device).set_vector(_vector); \
#define MCFG_Z80DAISY_GENERIC_INT_CB(_devcb) \
- devcb = &downcast<z80daisy_generic_device &>(*device).set_int_handler(DEVCB_##_devcb);
+ downcast<z80daisy_generic_device &>(*device).set_int_handler(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/z80dart.h b/src/devices/machine/z80dart.h
index 425f353fa0a..b539d2e6a02 100644
--- a/src/devices/machine/z80dart.h
+++ b/src/devices/machine/z80dart.h
@@ -159,49 +159,49 @@
downcast<z80dart_device &>(*device).configure_channels(_rxa, _txa, _rxb, _txb);
#define MCFG_Z80DART_OUT_TXDA_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_txda_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_txda_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_DTRA_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_dtra_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_dtra_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_RTSA_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_rtsa_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_rtsa_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_WRDYA_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_wrdya_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_wrdya_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_SYNCA_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_synca_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_synca_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_TXDB_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_txdb_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_txdb_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_DTRB_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_dtrb_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_dtrb_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_RTSB_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_rtsb_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_rtsb_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_WRDYB_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_wrdyb_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_wrdyb_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_SYNCB_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_syncb_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_syncb_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_INT_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_RXDRQA_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_rxdrqa_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_rxdrqa_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_TXDRQA_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_txdrqa_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_txdrqa_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_RXDRQB_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_rxdrqb_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_rxdrqb_callback(DEVCB_##_devcb);
#define MCFG_Z80DART_OUT_TXDRQB_CB(_devcb) \
- devcb = &downcast<z80dart_device &>(*device).set_out_txdrqb_callback(DEVCB_##_devcb);
+ downcast<z80dart_device &>(*device).set_out_txdrqb_callback(DEVCB_##_devcb);
//**************************************************************************
@@ -462,6 +462,21 @@ public:
template <class Object> devcb_base &set_out_txdrqa_callback(Object &&cb) { return m_out_txdrqa_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_out_rxdrqb_callback(Object &&cb) { return m_out_rxdrqb_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_out_txdrqb_callback(Object &&cb) { return m_out_txdrqb_cb.set_callback(std::forward<Object>(cb)); }
+ auto out_txda_callback() { return m_out_txda_cb.bind(); }
+ auto out_dtra_callback() { return m_out_dtra_cb.bind(); }
+ auto out_rtsa_callback() { return m_out_rtsa_cb.bind(); }
+ auto out_wrdya_callback() { return m_out_wrdya_cb.bind(); }
+ auto out_synca_callback() { return m_out_synca_cb.bind(); }
+ auto out_txdb_callback() { return m_out_txdb_cb.bind(); }
+ auto out_dtrb_callback() { return m_out_dtrb_cb.bind(); }
+ auto out_rtsb_callback() { return m_out_rtsb_cb.bind(); }
+ auto out_wrdyb_callback() { return m_out_wrdyb_cb.bind(); }
+ auto out_syncb_callback() { return m_out_syncb_cb.bind(); }
+ auto out_int_callback() { return m_out_int_cb.bind(); }
+ auto out_rxdrqa_callback() { return m_out_rxdrqa_cb.bind(); }
+ auto out_txdrqa_callback() { return m_out_txdrqa_cb.bind(); }
+ auto out_rxdrqb_callback() { return m_out_rxdrqb_cb.bind(); }
+ auto out_txdrqb_callback() { return m_out_txdrqb_cb.bind(); }
void configure_channels(int rxa, int txa, int rxb, int txb)
{
diff --git a/src/devices/machine/z80dma.h b/src/devices/machine/z80dma.h
index 1a9d425c9e1..02b7866463c 100644
--- a/src/devices/machine/z80dma.h
+++ b/src/devices/machine/z80dma.h
@@ -42,25 +42,25 @@
//**************************************************************************
#define MCFG_Z80DMA_OUT_BUSREQ_CB(_devcb) \
- devcb = &downcast<z80dma_device &>(*device).set_out_busreq_callback(DEVCB_##_devcb);
+ downcast<z80dma_device &>(*device).set_out_busreq_callback(DEVCB_##_devcb);
#define MCFG_Z80DMA_OUT_INT_CB(_devcb) \
- devcb = &downcast<z80dma_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<z80dma_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
#define MCFG_Z80DMA_OUT_BAO_CB(_devcb) \
- devcb = &downcast<z80dma_device &>(*device).set_out_bao_callback(DEVCB_##_devcb);
+ downcast<z80dma_device &>(*device).set_out_bao_callback(DEVCB_##_devcb);
#define MCFG_Z80DMA_IN_MREQ_CB(_devcb) \
- devcb = &downcast<z80dma_device &>(*device).set_in_mreq_callback(DEVCB_##_devcb);
+ downcast<z80dma_device &>(*device).set_in_mreq_callback(DEVCB_##_devcb);
#define MCFG_Z80DMA_OUT_MREQ_CB(_devcb) \
- devcb = &downcast<z80dma_device &>(*device).set_out_mreq_callback(DEVCB_##_devcb);
+ downcast<z80dma_device &>(*device).set_out_mreq_callback(DEVCB_##_devcb);
#define MCFG_Z80DMA_IN_IORQ_CB(_devcb) \
- devcb = &downcast<z80dma_device &>(*device).set_in_iorq_callback(DEVCB_##_devcb);
+ downcast<z80dma_device &>(*device).set_in_iorq_callback(DEVCB_##_devcb);
#define MCFG_Z80DMA_OUT_IORQ_CB(_devcb) \
- devcb = &downcast<z80dma_device &>(*device).set_out_iorq_callback(DEVCB_##_devcb);
+ downcast<z80dma_device &>(*device).set_out_iorq_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/z80pio.h b/src/devices/machine/z80pio.h
index 0fbfb246951..f0bfad62351 100644
--- a/src/devices/machine/z80pio.h
+++ b/src/devices/machine/z80pio.h
@@ -42,25 +42,25 @@
//**************************************************************************
#define MCFG_Z80PIO_OUT_INT_CB(_devcb) \
- devcb = &downcast<z80pio_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<z80pio_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
#define MCFG_Z80PIO_IN_PA_CB(_devcb) \
- devcb = &downcast<z80pio_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
+ downcast<z80pio_device &>(*device).set_in_pa_callback(DEVCB_##_devcb);
#define MCFG_Z80PIO_OUT_PA_CB(_devcb) \
- devcb = &downcast<z80pio_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
+ downcast<z80pio_device &>(*device).set_out_pa_callback(DEVCB_##_devcb);
#define MCFG_Z80PIO_OUT_ARDY_CB(_devcb) \
- devcb = &downcast<z80pio_device &>(*device).set_out_ardy_callback(DEVCB_##_devcb);
+ downcast<z80pio_device &>(*device).set_out_ardy_callback(DEVCB_##_devcb);
#define MCFG_Z80PIO_IN_PB_CB(_devcb) \
- devcb = &downcast<z80pio_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
+ downcast<z80pio_device &>(*device).set_in_pb_callback(DEVCB_##_devcb);
#define MCFG_Z80PIO_OUT_PB_CB(_devcb) \
- devcb = &downcast<z80pio_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
+ downcast<z80pio_device &>(*device).set_out_pb_callback(DEVCB_##_devcb);
#define MCFG_Z80PIO_OUT_BRDY_CB(_devcb) \
- devcb = &downcast<z80pio_device &>(*device).set_out_brdy_callback(DEVCB_##_devcb);
+ downcast<z80pio_device &>(*device).set_out_brdy_callback(DEVCB_##_devcb);
//**************************************************************************
@@ -91,6 +91,14 @@ public:
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_out_pb_callback(Object &&cb) { return m_out_pb_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_out_brdy_callback(Object &&cb) { return m_out_brdy_cb.set_callback(std::forward<Object>(cb)); }
+ auto out_int_callback() { return m_out_int_cb.bind(); }
+ auto in_pa_callback() { return m_in_pa_cb.bind(); }
+ auto out_pa_callback() { return m_out_pa_cb.bind(); }
+ auto out_ardy_callback() { return m_out_ardy_cb.bind(); }
+ auto in_pb_callback() { return m_in_pb_cb.bind(); }
+ auto out_pb_callback() { return m_out_pb_cb.bind(); }
+ auto out_brdy_callback() { return m_out_brdy_cb.bind(); }
+
// I/O line access
int rdy(int which) { return m_port[which].rdy(); }
diff --git a/src/devices/machine/z80scc.h b/src/devices/machine/z80scc.h
index 4a73fcfa3d6..50ba0ee0c02 100644
--- a/src/devices/machine/z80scc.h
+++ b/src/devices/machine/z80scc.h
@@ -48,51 +48,51 @@
downcast<z80scc_device &>(*device).configure_channels(_rxa, _txa, _rxb, _txb);
#define MCFG_Z80SCC_OUT_INT_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
// Port A callbacks
#define MCFG_Z80SCC_OUT_TXDA_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_txd_callback<0>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_txd_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_DTRA_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_dtr_callback<0>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_dtr_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_RTSA_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_rts_callback<0>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_rts_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_WREQA_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_wreq_callback<0>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_wreq_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_SYNCA_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_sync_callback<0>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_sync_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_RXDRQA_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_rxdrq_callback<0>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_rxdrq_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_TXDRQA_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_txdrq_callback<0>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_txdrq_callback<0>(DEVCB_##_devcb);
// Port B callbacks
#define MCFG_Z80SCC_OUT_TXDB_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_txd_callback<1>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_txd_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_DTRB_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_dtr_callback<1>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_dtr_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_RTSB_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_rts_callback<1>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_rts_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_WREQB_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_wreq_callback<1>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_wreq_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_SYNCB_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_sync_callback<1>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_sync_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_RXDRQB_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_rxdrq_callback<1>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_rxdrq_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SCC_OUT_TXDRQB_CB(_devcb) \
- devcb = &downcast<z80scc_device &>(*device).set_out_txdrq_callback<1>(DEVCB_##_devcb);
+ downcast<z80scc_device &>(*device).set_out_txdrq_callback<1>(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/machine/z80sio.cpp b/src/devices/machine/z80sio.cpp
index c52a29983b5..c190fb700a6 100644
--- a/src/devices/machine/z80sio.cpp
+++ b/src/devices/machine/z80sio.cpp
@@ -355,6 +355,7 @@ z80sio_device::z80sio_device(const machine_config &mconfig, device_type type, co
device_z80daisy_interface(mconfig, *this),
m_chanA(*this, CHANA_TAG),
m_chanB(*this, CHANB_TAG),
+ m_hostcpu(*this, finder_base::DUMMY_TAG),
m_out_txd_cb{ { *this }, { *this } },
m_out_dtr_cb{ { *this }, { *this } },
m_out_rts_cb{ { *this }, { *this } },
@@ -362,8 +363,7 @@ z80sio_device::z80sio_device(const machine_config &mconfig, device_type type, co
m_out_sync_cb{ { *this }, { *this } },
m_out_int_cb(*this),
m_out_rxdrq_cb{ { *this }, { *this } },
- m_out_txdrq_cb{ { *this }, { *this } },
- m_cputag(nullptr)
+ m_out_txdrq_cb{ { *this }, { *this } }
{
for (auto & elem : m_int_state)
elem = 0;
@@ -390,6 +390,15 @@ upd7201_new_device::upd7201_new_device(const machine_config &mconfig, const char
}
//-------------------------------------------------
+// device_validity_check - device-specific validation
+//-------------------------------------------------
+void z80sio_device::device_validity_check(validity_checker &valid) const
+{
+ if ((m_hostcpu.finder_tag() != finder_base::DUMMY_TAG) && !m_hostcpu)
+ osd_printf_error("Host CPU configured but not found.\n");
+}
+
+//-------------------------------------------------
// device_resolve_objects - device-specific setup
//-------------------------------------------------
void z80sio_device::device_resolve_objects()
@@ -487,12 +496,11 @@ int z80sio_device::z80daisy_irq_ack()
// Did we not find a vector? Get the notion of a default vector from the CPU implementation
logerror(" - failed to find an interrupt to ack!\n");
- if (m_cputag)
+ if (m_hostcpu)
{
// default irq vector is -1 for 68000 but 0 for z80 for example...
- // FIXME: use an optional_device or something
- int const ret = owner()->subdevice<cpu_device>(m_cputag)->default_irq_vector(INPUT_LINE_IRQ0);
- LOGINT(" - failed to find an interrupt to ack [%s], returning default IRQ vector: %02x\n", m_cputag, ret);
+ int const ret = m_hostcpu->default_irq_vector(INPUT_LINE_IRQ0);
+ LOGINT(" - failed to find an interrupt to ack [%s], returning default IRQ vector: %02x\n", m_hostcpu->tag(), ret);
return ret;
}
@@ -556,12 +564,11 @@ int i8274_new_device::z80daisy_irq_ack()
logerror(" - failed to find an interrupt to ack!\n");
}
- if (m_cputag)
+ if (m_hostcpu)
{
// default irq vector is -1 for 68000 but 0 for z80 for example...
- // FIXME: use an optional_device or something
- int const ret = owner()->subdevice<cpu_device>(m_cputag)->default_irq_vector(INPUT_LINE_IRQ0);
- LOGINT(" - failed to find an interrupt to ack [%s], returning default IRQ vector: %02x\n", m_cputag, ret);
+ int const ret = m_hostcpu->default_irq_vector(INPUT_LINE_IRQ0);
+ LOGINT(" - failed to find an interrupt to ack [%s], returning default IRQ vector: %02x\n", m_hostcpu->tag(), ret);
return ret;
}
diff --git a/src/devices/machine/z80sio.h b/src/devices/machine/z80sio.h
index f8a17dbfe8e..3c629208d64 100644
--- a/src/devices/machine/z80sio.h
+++ b/src/devices/machine/z80sio.h
@@ -68,54 +68,54 @@
/* Generic macros */
#define MCFG_Z80SIO_OUT_INT_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
#define MCFG_Z80SIO_CPU(_cputag) \
downcast<z80sio_device &>(*device).set_cputag(_cputag);
// Port A callbacks
#define MCFG_Z80SIO_OUT_TXDA_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_txd_callback<0>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_txd_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_DTRA_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_dtr_callback<0>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_dtr_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_RTSA_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_rts_callback<0>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_rts_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_WRDYA_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_wrdy_callback<0>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_wrdy_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_SYNCA_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_sync_callback<0>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_sync_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_RXDRQA_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_rxdrq_callback<0>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_rxdrq_callback<0>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_TXDRQA_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_txdrq_callback<0>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_txdrq_callback<0>(DEVCB_##_devcb);
// Port B callbacks
#define MCFG_Z80SIO_OUT_TXDB_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_txd_callback<1>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_txd_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_DTRB_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_dtr_callback<1>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_dtr_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_RTSB_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_rts_callback<1>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_rts_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_WRDYB_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_wrdy_callback<1>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_wrdy_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_SYNCB_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_sync_callback<1>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_sync_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_RXDRQB_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_rxdrq_callback<1>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_rxdrq_callback<1>(DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_TXDRQB_CB(_devcb) \
- devcb = &downcast<z80sio_device &>(*device).set_out_txdrq_callback<1>(DEVCB_##_devcb);
+ downcast<z80sio_device &>(*device).set_out_txdrq_callback<1>(DEVCB_##_devcb);
//**************************************************************************
@@ -347,7 +347,23 @@ public:
template <unsigned N, class Object> devcb_base &set_out_rxdrq_callback(Object &&cb) { return m_out_rxdrq_cb[N].set_callback(std::forward<Object>(cb)); }
template <unsigned N, class Object> devcb_base &set_out_txdrq_callback(Object &&cb) { return m_out_txdrq_cb[N].set_callback(std::forward<Object>(cb)); }
- void set_cputag(const char *tag) { m_cputag = tag; }
+ auto out_txda_callback() { return m_out_txd_cb[0].bind(); }
+ auto out_txdb_callback() { return m_out_txd_cb[1].bind(); }
+ auto out_dtra_callback() { return m_out_dtr_cb[0].bind(); }
+ auto out_dtrb_callback() { return m_out_dtr_cb[1].bind(); }
+ auto out_rtsa_callback() { return m_out_rts_cb[0].bind(); }
+ auto out_rtsb_callback() { return m_out_rts_cb[1].bind(); }
+ auto out_wrdya_callback() { return m_out_wrdy_cb[0].bind(); }
+ auto out_wrdyb_callback() { return m_out_wrdy_cb[1].bind(); }
+ auto out_synca_callback() { return m_out_sync_cb[0].bind(); }
+ auto out_syncb_callback() { return m_out_sync_cb[1].bind(); }
+ auto out_int_callback() { return m_out_int_cb.bind(); }
+ auto out_rxdrqa_callback() { return m_out_rxdrq_cb[0].bind(); }
+ auto out_rxdrqb_callback() { return m_out_rxdrq_cb[1].bind(); }
+ auto out_txdrqa_callback() { return m_out_txdrq_cb[0].bind(); }
+ auto out_txdrqb_callback() { return m_out_txdrq_cb[1].bind(); }
+
+ template <typename T> void set_cputag(T &&tag) { m_hostcpu.set_tag(std::forward<T>(tag)); }
DECLARE_READ8_MEMBER( cd_ba_r );
DECLARE_WRITE8_MEMBER( cd_ba_w );
@@ -385,6 +401,7 @@ protected:
z80sio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
+ virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_resolve_objects() override;
virtual void device_start() override;
virtual void device_reset() override;
@@ -414,6 +431,7 @@ protected:
required_device<z80sio_channel> m_chanA;
required_device<z80sio_channel> m_chanB;
+ optional_device<cpu_device> m_hostcpu;
// internal state
devcb_write_line m_out_txd_cb[2];
@@ -428,7 +446,6 @@ protected:
int m_int_state[8]; // interrupt state
int m_int_source[8]; // interrupt source
- const char *m_cputag;
};
class i8274_new_device : public z80sio_device
diff --git a/src/devices/machine/z80sti.h b/src/devices/machine/z80sti.h
index 794c5623a2e..e0926a98dc0 100644
--- a/src/devices/machine/z80sti.h
+++ b/src/devices/machine/z80sti.h
@@ -49,28 +49,28 @@
downcast<z80sti_device &>(*device).set_tx_clock(_clock);
#define MCFG_Z80STI_OUT_INT_CB(_devcb) \
- devcb = &downcast<z80sti_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
+ downcast<z80sti_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
#define MCFG_Z80STI_IN_GPIO_CB(_devcb) \
- devcb = &downcast<z80sti_device &>(*device).set_in_gpio_callback(DEVCB_##_devcb);
+ downcast<z80sti_device &>(*device).set_in_gpio_callback(DEVCB_##_devcb);
#define MCFG_Z80STI_OUT_GPIO_CB(_devcb) \
- devcb = &downcast<z80sti_device &>(*device).set_out_gpio_callback(DEVCB_##_devcb);
+ downcast<z80sti_device &>(*device).set_out_gpio_callback(DEVCB_##_devcb);
#define MCFG_Z80STI_OUT_SO_CB(_devcb) \
- devcb = &downcast<z80sti_device &>(*device).set_out_so_callback(DEVCB_##_devcb);
+ downcast<z80sti_device &>(*device).set_out_so_callback(DEVCB_##_devcb);
#define MCFG_Z80STI_OUT_TAO_CB(_devcb) \
- devcb = &downcast<z80sti_device &>(*device).set_out_tao_callback(DEVCB_##_devcb);
+ downcast<z80sti_device &>(*device).set_out_tao_callback(DEVCB_##_devcb);
#define MCFG_Z80STI_OUT_TBO_CB(_devcb) \
- devcb = &downcast<z80sti_device &>(*device).set_out_tbo_callback(DEVCB_##_devcb);
+ downcast<z80sti_device &>(*device).set_out_tbo_callback(DEVCB_##_devcb);
#define MCFG_Z80STI_OUT_TCO_CB(_devcb) \
- devcb = &downcast<z80sti_device &>(*device).set_out_tco_callback(DEVCB_##_devcb);
+ downcast<z80sti_device &>(*device).set_out_tco_callback(DEVCB_##_devcb);
#define MCFG_Z80STI_OUT_TDO_CB(_devcb) \
- devcb = &downcast<z80sti_device &>(*device).set_out_tdo_callback(DEVCB_##_devcb);
+ downcast<z80sti_device &>(*device).set_out_tdo_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/machine/z8536.h b/src/devices/machine/z8536.h
index be819b55ade..a0b0ab9b56c 100644
--- a/src/devices/machine/z8536.h
+++ b/src/devices/machine/z8536.h
@@ -65,25 +65,25 @@
//**************************************************************************
#define MCFG_Z8536_IRQ_CALLBACK(_write) \
- devcb = &downcast<z8536_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
+ downcast<z8536_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_Z8536_PA_IN_CALLBACK(_read) \
- devcb = &downcast<z8536_device &>(*device).set_pa_rd_callback(DEVCB_##_read);
+ downcast<z8536_device &>(*device).set_pa_rd_callback(DEVCB_##_read);
#define MCFG_Z8536_PA_OUT_CALLBACK(_write) \
- devcb = &downcast<z8536_device &>(*device).set_pa_wr_callback(DEVCB_##_write);
+ downcast<z8536_device &>(*device).set_pa_wr_callback(DEVCB_##_write);
#define MCFG_Z8536_PB_IN_CALLBACK(_read) \
- devcb = &downcast<z8536_device &>(*device).set_pb_rd_callback(DEVCB_##_read);
+ downcast<z8536_device &>(*device).set_pb_rd_callback(DEVCB_##_read);
#define MCFG_Z8536_PB_OUT_CALLBACK(_write) \
- devcb = &downcast<z8536_device &>(*device).set_pb_wr_callback(DEVCB_##_write);
+ downcast<z8536_device &>(*device).set_pb_wr_callback(DEVCB_##_write);
#define MCFG_Z8536_PC_IN_CALLBACK(_read) \
- devcb = &downcast<z8536_device &>(*device).set_pc_rd_callback(DEVCB_##_read);
+ downcast<z8536_device &>(*device).set_pc_rd_callback(DEVCB_##_read);
#define MCFG_Z8536_PC_OUT_CALLBACK(_write) \
- devcb = &downcast<z8536_device &>(*device).set_pc_wr_callback(DEVCB_##_write);
+ downcast<z8536_device &>(*device).set_pc_wr_callback(DEVCB_##_write);