summaryrefslogtreecommitdiffstats
path: root/src/devices/sound
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound')
-rw-r--r--src/devices/sound/2203intf.h3
-rw-r--r--src/devices/sound/2608intf.h2
-rw-r--r--src/devices/sound/2610intf.h3
-rw-r--r--src/devices/sound/2612intf.h2
-rw-r--r--src/devices/sound/262intf.h2
-rw-r--r--src/devices/sound/3526intf.h2
-rw-r--r--src/devices/sound/3812intf.h3
-rw-r--r--src/devices/sound/8950intf.h10
-rw-r--r--src/devices/sound/ad1848.h4
-rw-r--r--src/devices/sound/aica.h4
-rw-r--r--src/devices/sound/asc.h2
-rw-r--r--src/devices/sound/astrocde.h18
-rw-r--r--src/devices/sound/ay8910.h15
-rw-r--r--src/devices/sound/cdp1869.h4
-rw-r--r--src/devices/sound/dave.h6
-rw-r--r--src/devices/sound/es1373.h3
-rw-r--r--src/devices/sound/es5503.h4
-rw-r--r--src/devices/sound/es5506.h8
-rw-r--r--src/devices/sound/es8712.h4
-rw-r--r--src/devices/sound/ics2115.h2
-rw-r--r--src/devices/sound/k007232.h2
-rw-r--r--src/devices/sound/k054539.h2
-rw-r--r--src/devices/sound/k056800.h2
-rw-r--r--src/devices/sound/lc7535.h2
-rw-r--r--src/devices/sound/mea8000.h2
-rw-r--r--src/devices/sound/mm5837.h2
-rw-r--r--src/devices/sound/mos6560.h4
-rw-r--r--src/devices/sound/mos6581.h4
-rw-r--r--src/devices/sound/msm5205.h25
-rw-r--r--src/devices/sound/msm5232.h2
-rw-r--r--src/devices/sound/nes_apu.h4
-rw-r--r--src/devices/sound/pokey.h22
-rw-r--r--src/devices/sound/qs1000.h14
-rw-r--r--src/devices/sound/s14001a.h4
-rw-r--r--src/devices/sound/scsp.h6
-rw-r--r--src/devices/sound/sn76496.h2
-rw-r--r--src/devices/sound/sp0250.h2
-rw-r--r--src/devices/sound/sp0256.h4
-rw-r--r--src/devices/sound/spu.h2
-rw-r--r--src/devices/sound/st0016.h2
-rw-r--r--src/devices/sound/t6721a.h8
-rw-r--r--src/devices/sound/tms5110.h14
-rw-r--r--src/devices/sound/tms5220.h14
-rw-r--r--src/devices/sound/upd1771.h2
-rw-r--r--src/devices/sound/upd7759.h2
-rw-r--r--src/devices/sound/upd934g.h2
-rw-r--r--src/devices/sound/votrax.h2
-rw-r--r--src/devices/sound/ym2151.h6
-rw-r--r--src/devices/sound/ymf271.h2
-rw-r--r--src/devices/sound/ymf278b.h2
-rw-r--r--src/devices/sound/ymz280b.h3
-rw-r--r--src/devices/sound/zsg2.h2
52 files changed, 140 insertions, 129 deletions
diff --git a/src/devices/sound/2203intf.h b/src/devices/sound/2203intf.h
index 345129c98f7..5020702707b 100644
--- a/src/devices/sound/2203intf.h
+++ b/src/devices/sound/2203intf.h
@@ -12,7 +12,7 @@ struct ssg_callbacks;
#define MCFG_YM2203_IRQ_HANDLER(cb) \
- devcb = &downcast<ym2203_device &>(*device).set_irq_handler((DEVCB_##cb));
+ downcast<ym2203_device &>(*device).set_irq_handler((DEVCB_##cb));
class ym2203_device : public ay8910_device
{
@@ -21,6 +21,7 @@ public:
// configuration helpers
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(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/sound/2608intf.h b/src/devices/sound/2608intf.h
index 444d31a5efc..7272f5778e9 100644
--- a/src/devices/sound/2608intf.h
+++ b/src/devices/sound/2608intf.h
@@ -12,7 +12,7 @@ struct ssg_callbacks;
#define MCFG_YM2608_IRQ_HANDLER(cb) \
- devcb = &downcast<ym2608_device &>(*device).set_irq_handler(DEVCB_##cb);
+ downcast<ym2608_device &>(*device).set_irq_handler(DEVCB_##cb);
class ym2608_device : public ay8910_device
{
diff --git a/src/devices/sound/2610intf.h b/src/devices/sound/2610intf.h
index cc18a94cf3d..bb25f97b51e 100644
--- a/src/devices/sound/2610intf.h
+++ b/src/devices/sound/2610intf.h
@@ -12,7 +12,7 @@ struct ssg_callbacks;
#define MCFG_YM2610_IRQ_HANDLER(cb) \
- devcb = &downcast<ym2610_device &>(*device).set_irq_handler((DEVCB_##cb));
+ downcast<ym2610_device &>(*device).set_irq_handler((DEVCB_##cb));
class ym2610_device : public ay8910_device
{
@@ -21,6 +21,7 @@ public:
// configuration helpers
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(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/sound/2612intf.h b/src/devices/sound/2612intf.h
index d342fa148ec..22938d7aec0 100644
--- a/src/devices/sound/2612intf.h
+++ b/src/devices/sound/2612intf.h
@@ -7,7 +7,7 @@
#define MCFG_YM2612_IRQ_HANDLER(cb) \
- devcb = &downcast<ym2612_device &>(*device).set_irq_handler((DEVCB_##cb));
+ downcast<ym2612_device &>(*device).set_irq_handler((DEVCB_##cb));
class ym2612_device : public device_t, public device_sound_interface
{
diff --git a/src/devices/sound/262intf.h b/src/devices/sound/262intf.h
index c9650b97deb..9f1575ccb01 100644
--- a/src/devices/sound/262intf.h
+++ b/src/devices/sound/262intf.h
@@ -7,7 +7,7 @@
#define MCFG_YMF262_IRQ_HANDLER(cb) \
- devcb = &downcast<ymf262_device &>(*device).set_irq_handler((DEVCB_##cb));
+ downcast<ymf262_device &>(*device).set_irq_handler((DEVCB_##cb));
class ymf262_device : public device_t, public device_sound_interface
{
diff --git a/src/devices/sound/3526intf.h b/src/devices/sound/3526intf.h
index 24b77d16fbf..bba99b7f2b9 100644
--- a/src/devices/sound/3526intf.h
+++ b/src/devices/sound/3526intf.h
@@ -7,7 +7,7 @@
#define MCFG_YM3526_IRQ_HANDLER(cb) \
- devcb = &downcast<ym3526_device &>(*device).set_irq_handler((DEVCB_##cb));
+ downcast<ym3526_device &>(*device).set_irq_handler((DEVCB_##cb));
class ym3526_device : public device_t, public device_sound_interface
{
diff --git a/src/devices/sound/3812intf.h b/src/devices/sound/3812intf.h
index 910b51521ba..47fd0247314 100644
--- a/src/devices/sound/3812intf.h
+++ b/src/devices/sound/3812intf.h
@@ -5,7 +5,7 @@
#define MCFG_YM3812_IRQ_HANDLER(cb) \
- devcb = &downcast<ym3812_device &>(*device).set_irq_handler((DEVCB_##cb));
+ downcast<ym3812_device &>(*device).set_irq_handler((DEVCB_##cb));
class ym3812_device : public device_t, public device_sound_interface
{
@@ -14,6 +14,7 @@ public:
// configuration helpers
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(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/sound/8950intf.h b/src/devices/sound/8950intf.h
index a6a29e5b644..83aad8781c0 100644
--- a/src/devices/sound/8950intf.h
+++ b/src/devices/sound/8950intf.h
@@ -7,19 +7,19 @@
#define MCFG_Y8950_IRQ_HANDLER(cb) \
- devcb = &downcast<y8950_device &>(*device).set_irq_handler((DEVCB_##cb));
+ downcast<y8950_device &>(*device).set_irq_handler((DEVCB_##cb));
#define MCFG_Y8950_KEYBOARD_READ_HANDLER(cb) \
- devcb = &downcast<y8950_device &>(*device).set_keyboard_read_handler((DEVCB_##cb));
+ downcast<y8950_device &>(*device).set_keyboard_read_handler((DEVCB_##cb));
#define MCFG_Y8950_KEYBOARD_WRITE_HANDLER(cb) \
- devcb = &downcast<y8950_device &>(*device).set_keyboard_write_handler((DEVCB_##cb));
+ downcast<y8950_device &>(*device).set_keyboard_write_handler((DEVCB_##cb));
#define MCFG_Y8950_IO_READ_HANDLER(cb) \
- devcb = &downcast<y8950_device &>(*device).set_io_read_handler((DEVCB_##cb));
+ downcast<y8950_device &>(*device).set_io_read_handler((DEVCB_##cb));
#define MCFG_Y8950_IO_WRITE_HANDLER(cb) \
- devcb = &downcast<y8950_device &>(*device).set_io_write_handler((DEVCB_##cb));
+ downcast<y8950_device &>(*device).set_io_write_handler((DEVCB_##cb));
class y8950_device : public device_t, public device_sound_interface
{
diff --git a/src/devices/sound/ad1848.h b/src/devices/sound/ad1848.h
index efc5bf3228c..07aec2ee991 100644
--- a/src/devices/sound/ad1848.h
+++ b/src/devices/sound/ad1848.h
@@ -9,10 +9,10 @@
#define MCFG_AD1848_IRQ_CALLBACK(cb) \
- devcb = &downcast<ad1848_device &>(*device).set_irq_callback((DEVCB_##cb));
+ downcast<ad1848_device &>(*device).set_irq_callback((DEVCB_##cb));
#define MCFG_AD1848_DRQ_CALLBACK(cb) \
- devcb = &downcast<ad1848_device &>(*device).set_drq_callback((DEVCB_##cb));
+ downcast<ad1848_device &>(*device).set_drq_callback((DEVCB_##cb));
class ad1848_device : public device_t
{
diff --git a/src/devices/sound/aica.h b/src/devices/sound/aica.h
index a84fb3e31ae..91e7be6f6d2 100644
--- a/src/devices/sound/aica.h
+++ b/src/devices/sound/aica.h
@@ -21,10 +21,10 @@
downcast<aica_device &>(*device).set_roffset((offs));
#define MCFG_AICA_IRQ_CB(cb) \
- devcb = &downcast<aica_device &>(*device).set_irq_callback((DEVCB_##cb));
+ downcast<aica_device &>(*device).set_irq_callback((DEVCB_##cb));
#define MCFG_AICA_MAIN_IRQ_CB(cb) \
- devcb = &downcast<aica_device &>(*device).set_main_irq_callback((DEVCB_##cb));
+ downcast<aica_device &>(*device).set_main_irq_callback((DEVCB_##cb));
class aica_device : public device_t, public device_sound_interface
{
diff --git a/src/devices/sound/asc.h b/src/devices/sound/asc.h
index f3435c799b3..a723707a9e9 100644
--- a/src/devices/sound/asc.h
+++ b/src/devices/sound/asc.h
@@ -34,7 +34,7 @@
downcast<asc_device &>(*device).set_type(asc_device::asc_type::_type);
#define MCFG_IRQ_FUNC(_irqf) \
- devcb = &downcast<asc_device *>(device)->set_irqf(DEVCB_##_irqf);
+ downcast<asc_device *>(device)->set_irqf(DEVCB_##_irqf);
//**************************************************************************
diff --git a/src/devices/sound/astrocde.h b/src/devices/sound/astrocde.h
index 1ebeeae5e52..d5665b40f58 100644
--- a/src/devices/sound/astrocde.h
+++ b/src/devices/sound/astrocde.h
@@ -40,31 +40,31 @@
//**************************************************************************
#define MCFG_ASTROCADE_IO_SI_READ_CB(_devcb) \
- devcb = &downcast<astrocade_io_device &>(*device).set_si_callback(DEVCB_##_devcb);
+ downcast<astrocade_io_device &>(*device).set_si_callback(DEVCB_##_devcb);
#define MCFG_ASTROCADE_IO_SO0_STROBE_CB(_devcb) \
- devcb = &downcast<astrocade_io_device &>(*device).set_so_callback<0>(DEVCB_##_devcb);
+ downcast<astrocade_io_device &>(*device).set_so_callback<0>(DEVCB_##_devcb);
#define MCFG_ASTROCADE_IO_SO1_STROBE_CB(_devcb) \
- devcb = &downcast<astrocade_io_device &>(*device).set_so_callback<1>(DEVCB_##_devcb);
+ downcast<astrocade_io_device &>(*device).set_so_callback<1>(DEVCB_##_devcb);
#define MCFG_ASTROCADE_IO_SO2_STROBE_CB(_devcb) \
- devcb = &downcast<astrocade_io_device &>(*device).set_so_callback<2>(DEVCB_##_devcb);
+ downcast<astrocade_io_device &>(*device).set_so_callback<2>(DEVCB_##_devcb);
#define MCFG_ASTROCADE_IO_SO3_STROBE_CB(_devcb) \
- devcb = &downcast<astrocade_io_device &>(*device).set_so_callback<3>(DEVCB_##_devcb);
+ downcast<astrocade_io_device &>(*device).set_so_callback<3>(DEVCB_##_devcb);
#define MCFG_ASTROCADE_IO_SO4_STROBE_CB(_devcb) \
- devcb = &downcast<astrocade_io_device &>(*device).set_so_callback<4>(DEVCB_##_devcb);
+ downcast<astrocade_io_device &>(*device).set_so_callback<4>(DEVCB_##_devcb);
#define MCFG_ASTROCADE_IO_SO5_STROBE_CB(_devcb) \
- devcb = &downcast<astrocade_io_device &>(*device).set_so_callback<5>(DEVCB_##_devcb);
+ downcast<astrocade_io_device &>(*device).set_so_callback<5>(DEVCB_##_devcb);
#define MCFG_ASTROCADE_IO_SO6_STROBE_CB(_devcb) \
- devcb = &downcast<astrocade_io_device &>(*device).set_so_callback<6>(DEVCB_##_devcb);
+ downcast<astrocade_io_device &>(*device).set_so_callback<6>(DEVCB_##_devcb);
#define MCFG_ASTROCADE_IO_SO7_STROBE_CB(_devcb) \
- devcb = &downcast<astrocade_io_device &>(*device).set_so_callback<7>(DEVCB_##_devcb);
+ downcast<astrocade_io_device &>(*device).set_so_callback<7>(DEVCB_##_devcb);
#define MCFG_ASTROCADE_IO_POT0(_tag) \
downcast<astrocade_io_device &>(*device).set_pot_tag<0>(_tag);
diff --git a/src/devices/sound/ay8910.h b/src/devices/sound/ay8910.h
index 44f69041fe8..890d46a3670 100644
--- a/src/devices/sound/ay8910.h
+++ b/src/devices/sound/ay8910.h
@@ -59,20 +59,19 @@
downcast<ay8910_device &>(*device).set_resistors_load(_res0, _res1, _res2);
#define MCFG_AY8910_PORT_A_READ_CB(_devcb) \
- devcb = &downcast<ay8910_device &>(*device).set_port_a_read_callback(DEVCB_##_devcb);
+ downcast<ay8910_device &>(*device).set_port_a_read_callback(DEVCB_##_devcb);
#define MCFG_AY8910_PORT_B_READ_CB(_devcb) \
- devcb = &downcast<ay8910_device &>(*device).set_port_b_read_callback(DEVCB_##_devcb);
+ downcast<ay8910_device &>(*device).set_port_b_read_callback(DEVCB_##_devcb);
#define MCFG_AY8910_PORT_A_WRITE_CB(_devcb) \
- devcb = &downcast<ay8910_device &>(*device).set_port_a_write_callback(DEVCB_##_devcb);
+ downcast<ay8910_device &>(*device).set_port_a_write_callback(DEVCB_##_devcb);
#define MCFG_AY8910_PORT_B_WRITE_CB(_devcb) \
- devcb = &downcast<ay8910_device &>(*device).set_port_b_write_callback(DEVCB_##_devcb);
+ downcast<ay8910_device &>(*device).set_port_b_write_callback(DEVCB_##_devcb);
-class ay8910_device : public device_t,
- public device_sound_interface
+class ay8910_device : public device_t, public device_sound_interface
{
public:
enum psg_type_t
@@ -92,6 +91,10 @@ public:
template <class Object> devcb_base &set_port_b_read_callback(Object &&cb) { return m_port_b_read_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_port_a_write_callback(Object &&cb) { return m_port_a_write_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_port_b_write_callback(Object &&cb) { return m_port_b_write_cb.set_callback(std::forward<Object>(cb)); }
+ auto port_a_read_callback() { return m_port_a_read_cb.bind(); }
+ auto port_b_read_callback() { return m_port_b_read_cb.bind(); }
+ auto port_a_write_callback() { return m_port_a_write_cb.bind(); }
+ auto port_b_write_callback() { return m_port_b_write_cb.bind(); }
DECLARE_READ8_MEMBER( data_r );
DECLARE_WRITE8_MEMBER( address_w );
diff --git a/src/devices/sound/cdp1869.h b/src/devices/sound/cdp1869.h
index 0fca66fe14c..ecd34ddbd87 100644
--- a/src/devices/sound/cdp1869.h
+++ b/src/devices/sound/cdp1869.h
@@ -108,10 +108,10 @@
#define CDP1869_PCB_READ_MEMBER(name) int name(uint16_t pma, uint8_t cma, uint8_t pmd)
#define MCFG_CDP1869_PAL_NTSC_CALLBACK(_read) \
- devcb = &downcast<cdp1869_device &>(*device).set_pal_ntsc_rd_callback(DEVCB_##_read);
+ downcast<cdp1869_device &>(*device).set_pal_ntsc_rd_callback(DEVCB_##_read);
#define MCFG_CDP1869_PRD_CALLBACK(_write) \
- devcb = &downcast<cdp1869_device &>(*device).set_prd_wr_callback(DEVCB_##_write);
+ downcast<cdp1869_device &>(*device).set_prd_wr_callback(DEVCB_##_write);
#define MCFG_CDP1869_COLOR_CLOCK(_clk) \
downcast<cdp1869_device &>(*device).set_color_clock(_clk);
diff --git a/src/devices/sound/dave.h b/src/devices/sound/dave.h
index 61e26608f00..a9fe6dca6a6 100644
--- a/src/devices/sound/dave.h
+++ b/src/devices/sound/dave.h
@@ -33,13 +33,13 @@
#define MCFG_DAVE_IRQ_CALLBACK(_write) \
- devcb = &downcast<dave_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
+ downcast<dave_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_DAVE_LH_CALLBACK(_write) \
- devcb = &downcast<dave_device &>(*device).set_lh_wr_callback(DEVCB_##_write);
+ downcast<dave_device &>(*device).set_lh_wr_callback(DEVCB_##_write);
#define MCFG_DAVE_RH_CALLBACK(_write) \
- devcb = &downcast<dave_device &>(*device).set_rh_wr_callback(DEVCB_##_write);
+ downcast<dave_device &>(*device).set_rh_wr_callback(DEVCB_##_write);
diff --git a/src/devices/sound/es1373.h b/src/devices/sound/es1373.h
index a2705cba287..db3ea72b192 100644
--- a/src/devices/sound/es1373.h
+++ b/src/devices/sound/es1373.h
@@ -9,7 +9,7 @@
#include "machine/pci.h"
#define MCFG_ES1373_IRQ_HANDLER(cb) \
- devcb = &downcast<es1373_device &>(*device).set_irq_handler(DEVCB_##cb);
+ downcast<es1373_device &>(*device).set_irq_handler(DEVCB_##cb);
class es1373_device : public pci_device, public device_sound_interface
{
@@ -20,6 +20,7 @@ public:
uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) override;
template <typename T> devcb_base &set_irq_handler(T &&cb) { return m_irq_handler.set_callback(std::forward<T>(cb)); }
+ auto irq_handler() { return m_irq_handler.bind(); }
DECLARE_READ32_MEMBER (reg_r);
DECLARE_WRITE32_MEMBER(reg_w);
diff --git a/src/devices/sound/es5503.h b/src/devices/sound/es5503.h
index 825cdc65a0c..8bf49b6e3ba 100644
--- a/src/devices/sound/es5503.h
+++ b/src/devices/sound/es5503.h
@@ -14,10 +14,10 @@
downcast<es5503_device &>(*device).set_channels(_channels);
#define MCFG_ES5503_IRQ_FUNC(_write) \
- devcb = &downcast<es5503_device &>(*device).set_irqf(DEVCB_##_write);
+ downcast<es5503_device &>(*device).set_irqf(DEVCB_##_write);
#define MCFG_ES5503_ADC_FUNC(_read) \
- devcb = &downcast<es5503_device &>(*device).set_adcf(DEVCB_##_read);
+ downcast<es5503_device &>(*device).set_adcf(DEVCB_##_read);
// ======================> es5503_device
diff --git a/src/devices/sound/es5506.h b/src/devices/sound/es5506.h
index 5b8da91ebac..d8d87408402 100644
--- a/src/devices/sound/es5506.h
+++ b/src/devices/sound/es5506.h
@@ -30,10 +30,10 @@
downcast<es5506_device &>(*device).set_channels(_chan);
#define MCFG_ES5506_IRQ_CB(_devcb) \
- devcb = &downcast<es5506_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<es5506_device &>(*device).set_irq_callback(DEVCB_##_devcb);
#define MCFG_ES5506_READ_PORT_CB(_devcb) \
- devcb = &downcast<es5506_device &>(*device).set_read_port_callback(DEVCB_##_devcb);
+ downcast<es5506_device &>(*device).set_read_port_callback(DEVCB_##_devcb);
#define MCFG_ES5505_REGION0(_region) \
@@ -46,10 +46,10 @@
downcast<es5505_device &>(*device).set_channels(_chan);
#define MCFG_ES5505_IRQ_CB(_devcb) \
- devcb = &downcast<es5505_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<es5505_device &>(*device).set_irq_callback(DEVCB_##_devcb);
#define MCFG_ES5505_READ_PORT_CB(_devcb) \
- devcb = &downcast<es5505_device &>(*device).set_read_port_callback(DEVCB_##_devcb);
+ downcast<es5505_device &>(*device).set_read_port_callback(DEVCB_##_devcb);
class es550x_device : public device_t, public device_sound_interface
diff --git a/src/devices/sound/es8712.h b/src/devices/sound/es8712.h
index 796167331ed..61f98068cde 100644
--- a/src/devices/sound/es8712.h
+++ b/src/devices/sound/es8712.h
@@ -19,9 +19,9 @@
#define MCFG_ES8712_REPLACE(_tag, _clock) \
MCFG_DEVICE_REPLACE(_tag, ES8712, _clock)
#define MCFG_ES8712_RESET_HANDLER(_devcb) \
- devcb = &downcast<es8712_device &>(*device).set_reset_handler(DEVCB_##_devcb);
+ downcast<es8712_device &>(*device).set_reset_handler(DEVCB_##_devcb);
#define MCFG_ES8712_MSM_WRITE_CALLBACK(_devcb) \
- devcb = &downcast<es8712_device &>(*device).set_msm_write_callback(DEVCB_##_devcb);
+ downcast<es8712_device &>(*device).set_msm_write_callback(DEVCB_##_devcb);
#define MCFG_ES8712_MSM_TAG(_msmtag) \
downcast<es8712_device &>(*device).set_msm_tag(_msmtag);
diff --git a/src/devices/sound/ics2115.h b/src/devices/sound/ics2115.h
index af3d76be7da..66feda4b48e 100644
--- a/src/devices/sound/ics2115.h
+++ b/src/devices/sound/ics2115.h
@@ -14,7 +14,7 @@
MCFG_DEVICE_ADD(_tag, ICS2115, _clock)
#define MCFG_ICS2115_IRQ_CB(_devcb) \
- devcb = &downcast<ics2115_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<ics2115_device &>(*device).set_irq_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/sound/k007232.h b/src/devices/sound/k007232.h
index ee53a90fa94..845379b55e5 100644
--- a/src/devices/sound/k007232.h
+++ b/src/devices/sound/k007232.h
@@ -10,7 +10,7 @@
#pragma once
#define MCFG_K007232_PORT_WRITE_HANDLER(_devcb) \
- devcb = &downcast<k007232_device &>(*device).set_port_write_handler(DEVCB_##_devcb);
+ downcast<k007232_device &>(*device).set_port_write_handler(DEVCB_##_devcb);
class k007232_device : public device_t, public device_sound_interface
diff --git a/src/devices/sound/k054539.h b/src/devices/sound/k054539.h
index 4b1d55cf534..a8a6507963a 100644
--- a/src/devices/sound/k054539.h
+++ b/src/devices/sound/k054539.h
@@ -20,7 +20,7 @@
downcast<k054539_device &>(*device).set_override("^" _region);
#define MCFG_K054539_TIMER_HANDLER(_devcb) \
- devcb = &downcast<k054539_device &>(*device).set_timer_handler(DEVCB_##_devcb);
+ downcast<k054539_device &>(*device).set_timer_handler(DEVCB_##_devcb);
class k054539_device : public device_t,
diff --git a/src/devices/sound/k056800.h b/src/devices/sound/k056800.h
index aa05889234c..38d4902cfeb 100644
--- a/src/devices/sound/k056800.h
+++ b/src/devices/sound/k056800.h
@@ -18,7 +18,7 @@
MCFG_DEVICE_ADD((tag), K056800, (clock))
#define MCFG_K056800_INT_HANDLER(cb) \
- devcb = &downcast<k056800_device &>(*device).set_int_handler((DEVCB_##cb));
+ downcast<k056800_device &>(*device).set_int_handler((DEVCB_##cb));
diff --git a/src/devices/sound/lc7535.h b/src/devices/sound/lc7535.h
index bc3da9dc9c8..7b58f48ba37 100644
--- a/src/devices/sound/lc7535.h
+++ b/src/devices/sound/lc7535.h
@@ -32,7 +32,7 @@
//**************************************************************************
#define MCFG_LC7535_SELECT_CB(_read) \
- devcb = &downcast<lc7535_device &>(*device).set_select_callback(DEVCB_##_read);
+ downcast<lc7535_device &>(*device).set_select_callback(DEVCB_##_read);
#define MCFG_LC7535_VOLUME_CB(_class, _method) \
downcast<lc7535_device &>(*device).set_volume_callback(lc7535_device::volume_delegate(&_class::_method, #_class "::" #_method, this));
diff --git a/src/devices/sound/mea8000.h b/src/devices/sound/mea8000.h
index ffd7a2e76e2..21764e75b88 100644
--- a/src/devices/sound/mea8000.h
+++ b/src/devices/sound/mea8000.h
@@ -14,7 +14,7 @@
#pragma once
#define MCFG_MEA8000_REQ_CALLBACK(_write) \
- devcb = &downcast<mea8000_device &>(*device).set_reqwr_callback(*device, DEVCB_##_write);
+ downcast<mea8000_device &>(*device).set_reqwr_callback(*device, DEVCB_##_write);
/* define to use double instead of int (slow but useful for debugging) */
#undef MEA8000_FLOAT_MODE
diff --git a/src/devices/sound/mm5837.h b/src/devices/sound/mm5837.h
index 171cae609c4..388330190da 100644
--- a/src/devices/sound/mm5837.h
+++ b/src/devices/sound/mm5837.h
@@ -32,7 +32,7 @@
downcast<mm5837_device &>(*device).set_vdd_voltage(_voltage);
#define MCFG_MM5837_OUTPUT_CB(_devcb) \
- devcb = &downcast<mm5837_device &>(*device).set_output_callback(DEVCB_##_devcb);
+ downcast<mm5837_device &>(*device).set_output_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/sound/mos6560.h b/src/devices/sound/mos6560.h
index 25d8e3a9161..d4ee91e8ba2 100644
--- a/src/devices/sound/mos6560.h
+++ b/src/devices/sound/mos6560.h
@@ -79,10 +79,10 @@
#define MCFG_MOS6560_POTX_CALLBACK(_read) \
- devcb = &downcast<mos6560_device &>(*device).set_potx_rd_callback(DEVCB_##_read);
+ downcast<mos6560_device &>(*device).set_potx_rd_callback(DEVCB_##_read);
#define MCFG_MOS6560_POTY_CALLBACK(_read) \
- devcb = &downcast<mos6560_device &>(*device).set_poty_rd_callback(DEVCB_##_read);
+ downcast<mos6560_device &>(*device).set_poty_rd_callback(DEVCB_##_read);
diff --git a/src/devices/sound/mos6581.h b/src/devices/sound/mos6581.h
index 62c01036f44..6707be8ecac 100644
--- a/src/devices/sound/mos6581.h
+++ b/src/devices/sound/mos6581.h
@@ -36,10 +36,10 @@
//**************************************************************************
#define MCFG_MOS6581_POTX_CALLBACK(_read) \
- devcb = &downcast<mos6581_device &>(*device).set_potx_rd_callback(DEVCB_##_read);
+ downcast<mos6581_device &>(*device).set_potx_rd_callback(DEVCB_##_read);
#define MCFG_MOS6581_POTY_CALLBACK(_read) \
- devcb = &downcast<mos6581_device &>(*device).set_poty_rd_callback(DEVCB_##_read);
+ downcast<mos6581_device &>(*device).set_poty_rd_callback(DEVCB_##_read);
diff --git a/src/devices/sound/msm5205.h b/src/devices/sound/msm5205.h
index 7e6ef5f91f9..b4d69bc2029 100644
--- a/src/devices/sound/msm5205.h
+++ b/src/devices/sound/msm5205.h
@@ -11,30 +11,30 @@
downcast<msm5205_device &>(*device).set_prescaler_selector((msm5205_device::select));
#define MCFG_MSM5205_VCK_CALLBACK(cb) \
- devcb = &downcast<msm5205_device &>(*device).set_vck_callback((DEVCB_##cb));
+ downcast<msm5205_device &>(*device).set_vck_callback((DEVCB_##cb));
#define MCFG_MSM5205_VCLK_CB(cb) \
- devcb = &downcast<msm5205_device &>(*device).set_vck_legacy_callback((DEVCB_##cb));
+ downcast<msm5205_device &>(*device).set_vck_legacy_callback((DEVCB_##cb));
#define MCFG_MSM6585_PRESCALER_SELECTOR(select) \
downcast<msm5205_device &>(*device).set_prescaler_selector((msm6585_device::select));
#define MCFG_MSM6585_VCK_CALLBACK(cb) \
- devcb = &downcast<msm5205_device &>(*device).set_vck_callback((DEVCB_##cb));
+ downcast<msm5205_device &>(*device).set_vck_callback((DEVCB_##cb));
class msm5205_device : public device_t, public device_sound_interface
{
public:
- /* MSM5205 default master clock is 384KHz */
- static constexpr int S96_3B = 0; /* prescaler 1/96(4KHz) , data 3bit */
- static constexpr int S48_3B = 1; /* prescaler 1/48(8KHz) , data 3bit */
- static constexpr int S64_3B = 2; /* prescaler 1/64(6KHz) , data 3bit */
- static constexpr int SEX_3B = 3; /* VCK slave mode , data 3bit */
- static constexpr int S96_4B = 4; /* prescaler 1/96(4KHz) , data 4bit */
- static constexpr int S48_4B = 5; /* prescaler 1/48(8KHz) , data 4bit */
- static constexpr int S64_4B = 6; /* prescaler 1/64(6KHz) , data 4bit */
- static constexpr int SEX_4B = 7; /* VCK slave mode , data 4bit */
+ // MSM5205 default master clock is 384KHz
+ static constexpr int S96_3B = 0; // prescaler 1/96(4KHz) , data 3bit
+ static constexpr int S48_3B = 1; // prescaler 1/48(8KHz) , data 3bit
+ static constexpr int S64_3B = 2; // prescaler 1/64(6KHz) , data 3bit
+ static constexpr int SEX_3B = 3; // VCK slave mode , data 3bit
+ static constexpr int S96_4B = 4; // prescaler 1/96(4KHz) , data 4bit
+ static constexpr int S48_4B = 5; // prescaler 1/48(8KHz) , data 4bit
+ static constexpr int S64_4B = 6; // prescaler 1/64(6KHz) , data 4bit
+ static constexpr int SEX_4B = 7; // VCK slave mode , data 4bit
msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
@@ -46,6 +46,7 @@ public:
}
template <class Object> devcb_base &set_vck_callback(Object &&cb) { return m_vck_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_vck_legacy_callback(Object &&cb) { return m_vck_legacy_cb.set_callback(std::forward<Object>(cb)); }
+ auto vck_callback() { return m_vck_cb.bind(); }
// reset signal should keep for 2cycle of VCLK
DECLARE_WRITE_LINE_MEMBER(reset_w);
diff --git a/src/devices/sound/msm5232.h b/src/devices/sound/msm5232.h
index 0010999dedf..11e68c6ec02 100644
--- a/src/devices/sound/msm5232.h
+++ b/src/devices/sound/msm5232.h
@@ -10,7 +10,7 @@
downcast<msm5232_device &>(*device).set_capacitors(_a, _b, _c, _d, _e, _f, _g, _h);
#define MCFG_MSM5232_GATE_HANDLER_CB(_devcb) \
- devcb = &downcast<msm5232_device &>(*device).set_gate_handler_callback(DEVCB_##_devcb);
+ downcast<msm5232_device &>(*device).set_gate_handler_callback(DEVCB_##_devcb);
class msm5232_device : public device_t,
diff --git a/src/devices/sound/nes_apu.h b/src/devices/sound/nes_apu.h
index 0a244540abe..c6931463ca2 100644
--- a/src/devices/sound/nes_apu.h
+++ b/src/devices/sound/nes_apu.h
@@ -40,10 +40,10 @@
*/
#define MCFG_NES_APU_IRQ_HANDLER(_devcb) \
- devcb = &downcast<nesapu_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<nesapu_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_NES_APU_MEM_READ_CALLBACK(_devcb) \
- devcb = &downcast<nesapu_device &>(*device).set_mem_read_callback(DEVCB_##_devcb);
+ downcast<nesapu_device &>(*device).set_mem_read_callback(DEVCB_##_devcb);
class nesapu_device : public device_t,
public device_sound_interface
diff --git a/src/devices/sound/pokey.h b/src/devices/sound/pokey.h
index 1dafefeb184..10faf22c8da 100644
--- a/src/devices/sound/pokey.h
+++ b/src/devices/sound/pokey.h
@@ -59,37 +59,37 @@
//**************************************************************************
#define MCFG_POKEY_POT0_R_CB(_devcb) \
- devcb = &downcast<pokey_device &>(*device).set_pot_r_callback<0>(DEVCB_##_devcb);
+ downcast<pokey_device &>(*device).set_pot_r_callback<0>(DEVCB_##_devcb);
#define MCFG_POKEY_POT1_R_CB(_devcb) \
- devcb = &downcast<pokey_device &>(*device).set_pot_r_callback<1>(DEVCB_##_devcb);
+ downcast<pokey_device &>(*device).set_pot_r_callback<1>(DEVCB_##_devcb);
#define MCFG_POKEY_POT2_R_CB(_devcb) \
- devcb = &downcast<pokey_device &>(*device).set_pot_r_callback<2>(DEVCB_##_devcb);
+ downcast<pokey_device &>(*device).set_pot_r_callback<2>(DEVCB_##_devcb);
#define MCFG_POKEY_POT3_R_CB(_devcb) \
- devcb = &downcast<pokey_device &>(*device).set_pot_r_callback<3>(DEVCB_##_devcb);
+ downcast<pokey_device &>(*device).set_pot_r_callback<3>(DEVCB_##_devcb);
#define MCFG_POKEY_POT4_R_CB(_devcb) \
- devcb = &downcast<pokey_device &>(*device).set_pot_r_callback<4>(DEVCB_##_devcb);
+ downcast<pokey_device &>(*device).set_pot_r_callback<4>(DEVCB_##_devcb);
#define MCFG_POKEY_POT5_R_CB(_devcb) \
- devcb = &downcast<pokey_device &>(*device).set_pot_r_callback<5>(DEVCB_##_devcb);
+ downcast<pokey_device &>(*device).set_pot_r_callback<5>(DEVCB_##_devcb);
#define MCFG_POKEY_POT6_R_CB(_devcb) \
- devcb = &downcast<pokey_device &>(*device).set_pot_r_callback<6>(DEVCB_##_devcb);
+ downcast<pokey_device &>(*device).set_pot_r_callback<6>(DEVCB_##_devcb);
#define MCFG_POKEY_POT7_R_CB(_devcb) \
- devcb = &downcast<pokey_device &>(*device).set_pot_r_callback<7>(DEVCB_##_devcb);
+ downcast<pokey_device &>(*device).set_pot_r_callback<7>(DEVCB_##_devcb);
#define MCFG_POKEY_ALLPOT_R_CB(_devcb) \
- devcb = &downcast<pokey_device &>(*device).set_allpot_r_callback(DEVCB_##_devcb);
+ downcast<pokey_device &>(*device).set_allpot_r_callback(DEVCB_##_devcb);
#define MCFG_POKEY_SERIN_R_CB(_devcb) \
- devcb = &downcast<pokey_device &>(*device).set_serin_r_callback(DEVCB_##_devcb);
+ downcast<pokey_device &>(*device).set_serin_r_callback(DEVCB_##_devcb);
#define MCFG_POKEY_SEROUT_W_CB(_devcb) \
- devcb = &downcast<pokey_device &>(*device).set_serout_w_callback(DEVCB_##_devcb);
+ downcast<pokey_device &>(*device).set_serout_w_callback(DEVCB_##_devcb);
/* k543210 = k5 ... k0 returns bit0: kr1, bit1: kr2 */
/* all are, in contrast to actual hardware, ACTIVE_HIGH */
diff --git a/src/devices/sound/qs1000.h b/src/devices/sound/qs1000.h
index af648e11d88..b5f1c4b6b12 100644
--- a/src/devices/sound/qs1000.h
+++ b/src/devices/sound/qs1000.h
@@ -24,25 +24,25 @@
downcast<qs1000_device &>(*device).set_external_rom(_bool);
#define MCFG_QS1000_IN_P1_CB(_devcb) \
- devcb = &downcast<qs1000_device &>(*device).set_in_p1_callback(DEVCB_##_devcb);
+ downcast<qs1000_device &>(*device).set_in_p1_callback(DEVCB_##_devcb);
#define MCFG_QS1000_IN_P2_CB(_devcb) \
- devcb = &downcast<qs1000_device &>(*device).set_in_p2_callback(DEVCB_##_devcb);
+ downcast<qs1000_device &>(*device).set_in_p2_callback(DEVCB_##_devcb);
#define MCFG_QS1000_IN_P3_CB(_devcb) \
- devcb = &downcast<qs1000_device &>(*device).set_in_p3_callback(DEVCB_##_devcb);
+ downcast<qs1000_device &>(*device).set_in_p3_callback(DEVCB_##_devcb);
#define MCFG_QS1000_OUT_P1_CB(_devcb) \
- devcb = &downcast<qs1000_device &>(*device).set_out_p1_callback(DEVCB_##_devcb);
+ downcast<qs1000_device &>(*device).set_out_p1_callback(DEVCB_##_devcb);
#define MCFG_QS1000_OUT_P2_CB(_devcb) \
- devcb = &downcast<qs1000_device &>(*device).set_out_p2_callback(DEVCB_##_devcb);
+ downcast<qs1000_device &>(*device).set_out_p2_callback(DEVCB_##_devcb);
#define MCFG_QS1000_OUT_P3_CB(_devcb) \
- devcb = &downcast<qs1000_device &>(*device).set_out_p3_callback(DEVCB_##_devcb);
+ downcast<qs1000_device &>(*device).set_out_p3_callback(DEVCB_##_devcb);
/*#define MCFG_QS1000_SERIAL_W_CB(_devcb) \
- devcb = &downcast<qs1000_device &>(*device).set_serial_w_callback(DEVCB_##_devcb);*/
+ downcast<qs1000_device &>(*device).set_serial_w_callback(DEVCB_##_devcb);*/
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/sound/s14001a.h b/src/devices/sound/s14001a.h
index 78547f0b618..a7294559fb4 100644
--- a/src/devices/sound/s14001a.h
+++ b/src/devices/sound/s14001a.h
@@ -9,10 +9,10 @@
#define MAME_SOUND_S14001A_H
#define MCFG_S14001A_BSY_HANDLER(_devcb) \
- devcb = &downcast<s14001a_device &>(*device).set_bsy_handler(DEVCB_##_devcb);
+ downcast<s14001a_device &>(*device).set_bsy_handler(DEVCB_##_devcb);
#define MCFG_S14001A_EXT_READ_HANDLER(_devcb) \
- devcb = &downcast<s14001a_device &>(*device).set_ext_read_handler(DEVCB_##_devcb);
+ downcast<s14001a_device &>(*device).set_ext_read_handler(DEVCB_##_devcb);
class s14001a_device : public device_t, public device_sound_interface
diff --git a/src/devices/sound/scsp.h b/src/devices/sound/scsp.h
index 54bf92ef59d..983e37c3a9f 100644
--- a/src/devices/sound/scsp.h
+++ b/src/devices/sound/scsp.h
@@ -19,13 +19,13 @@
downcast<scsp_device &>(*device).set_roffset(_offs);
#define MCFG_SCSP_IRQ_CB(_devcb) \
- devcb = &downcast<scsp_device &>(*device).set_irq_callback(DEVCB_##_devcb);
+ downcast<scsp_device &>(*device).set_irq_callback(DEVCB_##_devcb);
#define MCFG_SCSP_MAIN_IRQ_CB(_devcb) \
- devcb = &downcast<scsp_device &>(*device).set_main_irq_callback(DEVCB_##_devcb);
+ downcast<scsp_device &>(*device).set_main_irq_callback(DEVCB_##_devcb);
#define MCFG_SCSP_EXTS_CB(_devcb) \
- devcb = &downcast<scsp_device &>(*device).set_exts_callback(DEVCB_##_devcb);
+ downcast<scsp_device &>(*device).set_exts_callback(DEVCB_##_devcb);
class scsp_device : public device_t,
diff --git a/src/devices/sound/sn76496.h b/src/devices/sound/sn76496.h
index b173c059de8..0a129260e4d 100644
--- a/src/devices/sound/sn76496.h
+++ b/src/devices/sound/sn76496.h
@@ -19,7 +19,7 @@ DECLARE_DEVICE_TYPE(SEGAPSG, segapsg_device)
#define MCFG_SN76496_READY_HANDLER(cb) \
- devcb = &downcast<sn76496_base_device &>(*device).set_ready_handler((DEVCB_##cb));
+ downcast<sn76496_base_device &>(*device).set_ready_handler((DEVCB_##cb));
class sn76496_base_device : public device_t, public device_sound_interface
{
diff --git a/src/devices/sound/sp0250.h b/src/devices/sound/sp0250.h
index 43bbe3b6421..95352c32ecc 100644
--- a/src/devices/sound/sp0250.h
+++ b/src/devices/sound/sp0250.h
@@ -50,6 +50,6 @@ private:
DECLARE_DEVICE_TYPE(SP0250, sp0250_device)
#define MCFG_SP0250_DRQ_CALLBACK(_write) \
- devcb = &downcast<sp0250_device &>(*device).set_drq_callback(DEVCB_##_write);
+ downcast<sp0250_device &>(*device).set_drq_callback(DEVCB_##_write);
#endif // MAME_SOUND_SP0250_H
diff --git a/src/devices/sound/sp0256.h b/src/devices/sound/sp0256.h
index aa91d415d54..d4cea893859 100644
--- a/src/devices/sound/sp0256.h
+++ b/src/devices/sound/sp0256.h
@@ -36,10 +36,10 @@
#pragma once
#define MCFG_SP0256_DATA_REQUEST_CB(_devcb) \
- devcb = &downcast<sp0256_device &>(*device).set_data_request_callback(DEVCB_##_devcb);
+ downcast<sp0256_device &>(*device).set_data_request_callback(DEVCB_##_devcb);
#define MCFG_SP0256_STANDBY_CB(_devcb) \
- devcb = &downcast<sp0256_device &>(*device).set_standby_callback(DEVCB_##_devcb);
+ downcast<sp0256_device &>(*device).set_standby_callback(DEVCB_##_devcb);
class sp0256_device : public device_t,
diff --git a/src/devices/sound/spu.h b/src/devices/sound/spu.h
index 874867ff622..07bb06f6b85 100644
--- a/src/devices/sound/spu.h
+++ b/src/devices/sound/spu.h
@@ -10,7 +10,7 @@
//**************************************************************************
#define MCFG_SPU_IRQ_HANDLER(_devcb) \
- devcb = &downcast<spu_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<spu_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_SPU_ADD(_tag, _clock) \
MCFG_DEVICE_MODIFY( "maincpu" ) \
diff --git a/src/devices/sound/st0016.h b/src/devices/sound/st0016.h
index 264a0536322..54da6678020 100644
--- a/src/devices/sound/st0016.h
+++ b/src/devices/sound/st0016.h
@@ -11,7 +11,7 @@
//**************************************************************************
#define MCFG_ST0016_SOUNDRAM_READ_CB(_devcb) \
- devcb = &downcast<st0016_device &>(*device).set_soundram_callback(DEVCB_##_devcb);
+ downcast<st0016_device &>(*device).set_soundram_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/sound/t6721a.h b/src/devices/sound/t6721a.h
index 81157e4c47f..49e77498118 100644
--- a/src/devices/sound/t6721a.h
+++ b/src/devices/sound/t6721a.h
@@ -43,16 +43,16 @@
//**************************************************************************
#define MCFG_T6721A_EOS_HANDLER(_eos) \
- devcb = &downcast<t6721a_device *>(device)->set_eos_callback(DEVCB_##_eos);
+ downcast<t6721a_device *>(device)->set_eos_callback(DEVCB_##_eos);
#define MCFG_T6721A_PHI2_HANDLER(_phi2) \
- devcb = &downcast<t6721a_device *>(device)->set_phi2_callback(DEVCB_##_phi2);
+ downcast<t6721a_device *>(device)->set_phi2_callback(DEVCB_##_phi2);
#define MCFG_T6721A_DTRD_HANDLER(_dtrd) \
- devcb = &downcast<t6721a_device *>(device)->set_dtrd_callback(DEVCB_##_dtrd);
+ downcast<t6721a_device *>(device)->set_dtrd_callback(DEVCB_##_dtrd);
#define MCFG_T6721A_APD_HANDLER(_apd) \
- devcb = &downcast<t6721a_device *>(device)->set_apd_callback(DEVCB_##_apd);
+ downcast<t6721a_device *>(device)->set_apd_callback(DEVCB_##_apd);
diff --git a/src/devices/sound/tms5110.h b/src/devices/sound/tms5110.h
index 066590302da..b4a5a48d68d 100644
--- a/src/devices/sound/tms5110.h
+++ b/src/devices/sound/tms5110.h
@@ -14,19 +14,19 @@
/* usually 800000 for 10000 Hz sample rate. */
#define MCFG_TMS5110_M0_CB(_devcb) \
- devcb = &downcast<tms5110_device &>(*device).set_m0_callback(DEVCB_##_devcb);
+ downcast<tms5110_device &>(*device).set_m0_callback(DEVCB_##_devcb);
#define MCFG_TMS5110_M1_CB(_devcb) \
- devcb = &downcast<tms5110_device &>(*device).set_m1_callback(DEVCB_##_devcb);
+ downcast<tms5110_device &>(*device).set_m1_callback(DEVCB_##_devcb);
#define MCFG_TMS5110_ADDR_CB(_devcb) \
- devcb = &downcast<tms5110_device &>(*device).set_addr_callback(DEVCB_##_devcb);
+ downcast<tms5110_device &>(*device).set_addr_callback(DEVCB_##_devcb);
#define MCFG_TMS5110_DATA_CB(_devcb) \
- devcb = &downcast<tms5110_device &>(*device).set_data_callback(DEVCB_##_devcb);
+ downcast<tms5110_device &>(*device).set_data_callback(DEVCB_##_devcb);
#define MCFG_TMS5110_ROMCLK_CB(_devcb) \
- devcb = &downcast<tms5110_device &>(*device).set_romclk_callback(DEVCB_##_devcb);
+ downcast<tms5110_device &>(*device).set_romclk_callback(DEVCB_##_devcb);
class tms5110_device : public device_t, public device_sound_interface
@@ -365,9 +365,9 @@ DECLARE_DEVICE_TYPE(TMSPROM, tmsprom_device)
downcast<tmsprom_device &>(*device).set_stop_bit(_bit);
#define MCFG_TMSPROM_PDC_CB(_devcb) \
- devcb = &downcast<tmsprom_device &>(*device).set_pdc_callback(DEVCB_##_devcb);
+ downcast<tmsprom_device &>(*device).set_pdc_callback(DEVCB_##_devcb);
#define MCFG_TMSPROM_CTL_CB(_devcb) \
- devcb = &downcast<tmsprom_device &>(*device).set_ctl_callback(DEVCB_##_devcb);
+ downcast<tmsprom_device &>(*device).set_ctl_callback(DEVCB_##_devcb);
#endif // MAME_SOUND_TMS5110_H
diff --git a/src/devices/sound/tms5220.h b/src/devices/sound/tms5220.h
index f06777c3dae..cdbf48f2cad 100644
--- a/src/devices/sound/tms5220.h
+++ b/src/devices/sound/tms5220.h
@@ -16,11 +16,11 @@
/* IRQ callback function, active low, i.e. state=0 */
#define MCFG_TMS52XX_IRQ_HANDLER(_devcb) \
- devcb = &downcast<tms5220_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<tms5220_device &>(*device).set_irq_handler(DEVCB_##_devcb);
/* Ready callback function, active low, i.e. state=0 */
#define MCFG_TMS52XX_READYQ_HANDLER(_devcb) \
- devcb = &downcast<tms5220_device &>(*device).set_readyq_handler(DEVCB_##_devcb);
+ downcast<tms5220_device &>(*device).set_readyq_handler(DEVCB_##_devcb);
/* old VSM handler, remove me! */
#define MCFG_TMS52XX_SPEECHROM(_tag) \
@@ -28,19 +28,19 @@
/* new VSM handler */
#define MCFG_TMS52XX_M0_CB(_devcb) \
- devcb = &downcast<tms5220_device &>(*device).set_m0_callback(DEVCB_##_devcb);
+ downcast<tms5220_device &>(*device).set_m0_callback(DEVCB_##_devcb);
#define MCFG_TMS52XX_M1_CB(_devcb) \
- devcb = &downcast<tms5220_device &>(*device).set_m1_callback(DEVCB_##_devcb);
+ downcast<tms5220_device &>(*device).set_m1_callback(DEVCB_##_devcb);
#define MCFG_TMS52XX_ADDR_CB(_devcb) \
- devcb = &downcast<tms5220_device &>(*device).set_addr_callback(DEVCB_##_devcb);
+ downcast<tms5220_device &>(*device).set_addr_callback(DEVCB_##_devcb);
#define MCFG_TMS52XX_DATA_CB(_devcb) \
- devcb = &downcast<tms5220_device &>(*device).set_data_callback(DEVCB_##_devcb);
+ downcast<tms5220_device &>(*device).set_data_callback(DEVCB_##_devcb);
#define MCFG_TMS52XX_ROMCLK_CB(_devcb) \
- devcb = &downcast<tms5220_device &>(device).set_romclk_callback(DEVCB_##_devcb);
+ downcast<tms5220_device &>(device).set_romclk_callback(DEVCB_##_devcb);
class tms5220_device : public device_t, public device_sound_interface
{
diff --git a/src/devices/sound/upd1771.h b/src/devices/sound/upd1771.h
index 704ea7aecb0..aa570528ed5 100644
--- a/src/devices/sound/upd1771.h
+++ b/src/devices/sound/upd1771.h
@@ -11,7 +11,7 @@
#define MCFG_UPD1771_ACK_HANDLER(_devcb) \
- devcb = &downcast<upd1771c_device &>(*device).set_ack_handler(DEVCB_##_devcb);
+ downcast<upd1771c_device &>(*device).set_ack_handler(DEVCB_##_devcb);
/***************************************************************************
diff --git a/src/devices/sound/upd7759.h b/src/devices/sound/upd7759.h
index 6c41e4b0f43..ab128998f8e 100644
--- a/src/devices/sound/upd7759.h
+++ b/src/devices/sound/upd7759.h
@@ -142,6 +142,6 @@ DECLARE_DEVICE_TYPE(UPD7759, upd7759_device)
DECLARE_DEVICE_TYPE(UPD7756, upd7756_device)
#define MCFG_UPD7759_DRQ_CALLBACK(_write) \
- devcb = &downcast<upd7759_device &>(*device).set_drq_callback(DEVCB_##_write);
+ downcast<upd7759_device &>(*device).set_drq_callback(DEVCB_##_write);
#endif // MAME_SOUND_UPD7759_H
diff --git a/src/devices/sound/upd934g.h b/src/devices/sound/upd934g.h
index 02224f2739d..1d94c317957 100644
--- a/src/devices/sound/upd934g.h
+++ b/src/devices/sound/upd934g.h
@@ -19,7 +19,7 @@
//**************************************************************************
#define MCFG_UPD934G_DATA_CB(_devcb) \
- devcb = &downcast<upd934g_device &>(*device).set_data_callback(DEVCB_##_devcb);
+ downcast<upd934g_device &>(*device).set_data_callback(DEVCB_##_devcb);
//**************************************************************************
diff --git a/src/devices/sound/votrax.h b/src/devices/sound/votrax.h
index 2779b42d5fe..bc6b32f5fb5 100644
--- a/src/devices/sound/votrax.h
+++ b/src/devices/sound/votrax.h
@@ -14,7 +14,7 @@
#define MCFG_VOTRAX_SC01_REQUEST_CB(_devcb) \
- devcb = &downcast<votrax_sc01_device *>(device)->set_ar_callback(DEVCB_##_devcb);
+ downcast<votrax_sc01_device *>(device)->set_ar_callback(DEVCB_##_devcb);
class votrax_sc01_device : public device_t,
public device_sound_interface
diff --git a/src/devices/sound/ym2151.h b/src/devices/sound/ym2151.h
index 0aba974025f..a25a424017b 100644
--- a/src/devices/sound/ym2151.h
+++ b/src/devices/sound/ym2151.h
@@ -41,9 +41,9 @@
//**************************************************************************
#define MCFG_YM2151_IRQ_HANDLER(_devcb) \
- devcb = &downcast<ym2151_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<ym2151_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_YM2151_PORT_WRITE_HANDLER(_devcb) \
- devcb = &downcast<ym2151_device &>(*device).set_port_write_handler(DEVCB_##_devcb);
+ downcast<ym2151_device &>(*device).set_port_write_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -63,6 +63,8 @@ public:
// configuration helpers
template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irqhandler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_port_write_handler(Object &&cb) { return m_portwritehandler.set_callback(std::forward<Object>(cb)); }
+ auto irq_handler() { return m_irqhandler.bind(); }
+ auto port_write_handler() { return m_portwritehandler.bind(); }
// read/write
DECLARE_READ8_MEMBER(read);
diff --git a/src/devices/sound/ymf271.h b/src/devices/sound/ymf271.h
index c032c764d53..075650b8586 100644
--- a/src/devices/sound/ymf271.h
+++ b/src/devices/sound/ymf271.h
@@ -7,7 +7,7 @@
#define MCFG_YMF271_IRQ_HANDLER(_devcb) \
- devcb = &downcast<ymf271_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<ymf271_device &>(*device).set_irq_handler(DEVCB_##_devcb);
class ymf271_device : public device_t, public device_sound_interface, public device_rom_interface
{
diff --git a/src/devices/sound/ymf278b.h b/src/devices/sound/ymf278b.h
index d19815fddbd..39456acfbe1 100644
--- a/src/devices/sound/ymf278b.h
+++ b/src/devices/sound/ymf278b.h
@@ -9,7 +9,7 @@
#define YMF278B_STD_CLOCK (33868800) /* standard clock for OPL4 */
#define MCFG_YMF278B_IRQ_HANDLER(_devcb) \
- devcb = &downcast<ymf278b_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<ymf278b_device &>(*device).set_irq_handler(DEVCB_##_devcb);
class ymf278b_device : public device_t, public device_sound_interface, public device_rom_interface
{
diff --git a/src/devices/sound/ymz280b.h b/src/devices/sound/ymz280b.h
index 40b65e94c3c..df52c60206b 100644
--- a/src/devices/sound/ymz280b.h
+++ b/src/devices/sound/ymz280b.h
@@ -16,7 +16,7 @@
#define YMZ280B_MAKE_WAVS 0
#define MCFG_YMZ280B_IRQ_HANDLER(_devcb) \
- devcb = &downcast<ymz280b_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+ downcast<ymz280b_device &>(*device).set_irq_handler(DEVCB_##_devcb);
class ymz280b_device : public device_t, public device_sound_interface, public device_rom_interface
{
@@ -25,6 +25,7 @@ public:
// configuration helpers
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(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/sound/zsg2.h b/src/devices/sound/zsg2.h
index 572e551fa4b..0cd4479dca1 100644
--- a/src/devices/sound/zsg2.h
+++ b/src/devices/sound/zsg2.h
@@ -20,7 +20,7 @@
MCFG_DEVICE_REPLACE(_tag, ZSG2, _clock)
#define MCFG_ZSG2_EXT_READ_HANDLER(_devcb) \
- devcb = &downcast<zsg2_device &>(*device).set_ext_read_handler(DEVCB_##_devcb);
+ downcast<zsg2_device &>(*device).set_ext_read_handler(DEVCB_##_devcb);
// ======================> zsg2_device