summaryrefslogtreecommitdiffstats
path: root/src/devices/sound/tms5110.h
diff options
context:
space:
mode:
authorGravatarGravatar Wilbert Pol <wilbertpol@users.noreply.github.com>2018-02-25 17:40:06 +0100
committerGravatarGravatar Wilbert Pol <wilbertpol@users.noreply.github.com>2018-02-25 17:40:06 +0100
commit86f6ad0b5cd44799f8c2cfb9aad2727e32e9a4ce (patch)
treeed6d9dc25fb1f32a1894a98c916f3567b26f21b5 /src/devices/sound/tms5110.h
parentf07b93b0532d379eb542ca507b103e71196e9147 (diff)
de-staticify initializations for src/devices/sound (nw)
Diffstat (limited to 'src/devices/sound/tms5110.h')
-rw-r--r--src/devices/sound/tms5110.h64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/devices/sound/tms5110.h b/src/devices/sound/tms5110.h
index 89daa0637a7..01de692eb8d 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 = &tms5110_device::set_m0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tms5110_device &>(*device).set_m0_callback(DEVCB_##_devcb);
#define MCFG_TMS5110_M1_CB(_devcb) \
- devcb = &tms5110_device::set_m1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tms5110_device &>(*device).set_m1_callback(DEVCB_##_devcb);
#define MCFG_TMS5110_ADDR_CB(_devcb) \
- devcb = &tms5110_device::set_addr_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tms5110_device &>(*device).set_addr_callback(DEVCB_##_devcb);
#define MCFG_TMS5110_DATA_CB(_devcb) \
- devcb = &tms5110_device::set_data_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tms5110_device &>(*device).set_data_callback(DEVCB_##_devcb);
#define MCFG_TMS5110_ROMCLK_CB(_devcb) \
- devcb = &tms5110_device::set_romclk_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tms5110_device &>(*device).set_romclk_callback(DEVCB_##_devcb);
class tms5110_device : public device_t, public device_sound_interface
@@ -51,11 +51,11 @@ public:
tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_m0_callback(device_t &device, Object &&cb) { return downcast<tms5110_device &>(device).m_m0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_m1_callback(device_t &device, Object &&cb) { return downcast<tms5110_device &>(device).m_m1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_addr_callback(device_t &device, Object &&cb) { return downcast<tms5110_device &>(device).m_addr_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data_callback(device_t &device, Object &&cb) { return downcast<tms5110_device &>(device).m_data_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_romclk_callback(device_t &device, Object &&cb) { return downcast<tms5110_device &>(device).m_romclk_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_m0_callback(Object &&cb) { return m_m0_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_m1_callback(Object &&cb) { return m_m1_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_addr_callback(Object &&cb) { return m_addr_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data_callback(Object &&cb) { return m_data_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_romclk_callback(Object &&cb) { return m_romclk_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE8_MEMBER( ctl_w );
DECLARE_READ8_MEMBER( ctl_r );
@@ -277,17 +277,17 @@ class tmsprom_device : public device_t
public:
tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_region(device_t &device, const char *region) { downcast<tmsprom_device &>(device).m_prom.set_tag(region); }
- static void set_rom_size(device_t &device, uint32_t rom_size) { downcast<tmsprom_device &>(device).m_rom_size = rom_size; }
- static void set_pdc_bit(device_t &device, uint8_t pdc_bit) { downcast<tmsprom_device &>(device).m_pdc_bit = pdc_bit; }
- static void set_ctl1_bit(device_t &device, uint8_t ctl1_bit) { downcast<tmsprom_device &>(device).m_ctl1_bit = ctl1_bit; }
- static void set_ctl2_bit(device_t &device, uint8_t ctl2_bit) { downcast<tmsprom_device &>(device).m_ctl2_bit = ctl2_bit; }
- static void set_ctl4_bit(device_t &device, uint8_t ctl4_bit) { downcast<tmsprom_device &>(device).m_ctl4_bit = ctl4_bit; }
- static void set_ctl8_bit(device_t &device, uint8_t ctl8_bit) { downcast<tmsprom_device &>(device).m_ctl8_bit = ctl8_bit; }
- static void set_reset_bit(device_t &device, uint8_t reset_bit) { downcast<tmsprom_device &>(device).m_reset_bit = reset_bit; }
- static void set_stop_bit(device_t &device, uint8_t stop_bit) { downcast<tmsprom_device &>(device).m_stop_bit = stop_bit; }
- template<class _Object> static devcb_base &set_pdc_callback(device_t &device, _Object object) { return downcast<tmsprom_device &>(device).m_pdc_cb.set_callback(object); }
- template<class _Object> static devcb_base &set_ctl_callback(device_t &device, _Object object) { return downcast<tmsprom_device &>(device).m_ctl_cb.set_callback(object); }
+ void set_region(const char *region) { m_prom.set_tag(region); }
+ void set_rom_size(uint32_t rom_size) { m_rom_size = rom_size; }
+ void set_pdc_bit(uint8_t pdc_bit) { m_pdc_bit = pdc_bit; }
+ void set_ctl1_bit(uint8_t ctl1_bit) { m_ctl1_bit = ctl1_bit; }
+ void set_ctl2_bit(uint8_t ctl2_bit) { m_ctl2_bit = ctl2_bit; }
+ void set_ctl4_bit(uint8_t ctl4_bit) { m_ctl4_bit = ctl4_bit; }
+ void set_ctl8_bit(uint8_t ctl8_bit) { m_ctl8_bit = ctl8_bit; }
+ void set_reset_bit(uint8_t reset_bit) { m_reset_bit = reset_bit; }
+ void set_stop_bit(uint8_t stop_bit) { m_stop_bit = stop_bit; }
+ template<class Object> devcb_base &set_pdc_callback(Object object) { return m_pdc_cb.set_callback(std::forward<Object>(object)); }
+ template<class Object> devcb_base &set_ctl_callback(Object object) { return m_ctl_cb.set_callback(std::forward<Object>(object)); }
DECLARE_WRITE_LINE_MEMBER( m0_w );
DECLARE_READ_LINE_MEMBER( data_r );
@@ -338,36 +338,36 @@ private:
DECLARE_DEVICE_TYPE(TMSPROM, tmsprom_device)
#define MCFG_TMSPROM_REGION(_region) \
- tmsprom_device::set_region(*device, "^" _region);
+ downcast<tmsprom_device &>(*device).set_region("^" _region);
#define MCFG_TMSPROM_ROM_SIZE(_size) \
- tmsprom_device::set_rom_size(*device, _size);
+ downcast<tmsprom_device &>(*device).set_rom_size(_size);
#define MCFG_TMSPROM_PDC_BIT(_bit) \
- tmsprom_device::set_pdc_bit(*device, _bit);
+ downcast<tmsprom_device &>(*device).set_pdc_bit(_bit);
#define MCFG_TMSPROM_CTL1_BIT(_bit) \
- tmsprom_device::set_ctl1_bit(*device, _bit);
+ downcast<tmsprom_device &>(*device).set_ctl1_bit(_bit);
#define MCFG_TMSPROM_CTL2_BIT(_bit) \
- tmsprom_device::set_ctl2_bit(*device, _bit);
+ downcast<tmsprom_device &>(*device).set_ctl2_bit(_bit);
#define MCFG_TMSPROM_CTL4_BIT(_bit) \
- tmsprom_device::set_ctl4_bit(*device, _bit);
+ downcast<tmsprom_device &>(*device).set_ctl4_bit(_bit);
#define MCFG_TMSPROM_CTL8_BIT(_bit) \
- tmsprom_device::set_ctl8_bit(*device, _bit);
+ downcast<tmsprom_device &>(*device).set_ctl8_bit(_bit);
#define MCFG_TMSPROM_RESET_BIT(_bit) \
- tmsprom_device::set_reset_bit(*device, _bit);
+ downcast<tmsprom_device &>(*device).set_reset_bit(_bit);
#define MCFG_TMSPROM_STOP_BIT(_bit) \
- tmsprom_device::set_stop_bit(*device, _bit);
+ downcast<tmsprom_device &>(*device).set_stop_bit(_bit);
#define MCFG_TMSPROM_PDC_CB(_devcb) \
- devcb = &tmsprom_device::set_pdc_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tmsprom_device &>(*device).set_pdc_callback(DEVCB_##_devcb);
#define MCFG_TMSPROM_CTL_CB(_devcb) \
- devcb = &tmsprom_device::set_ctl_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tmsprom_device &>(*device).set_ctl_callback(DEVCB_##_devcb);
#endif // MAME_SOUND_TMS5110_H