summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video
diff options
context:
space:
mode:
authorGravatarGravatar wilbertpol <wilbertpol@users.noreply.github.com>2018-02-25 14:18:39 +0100
committerGravatarGravatar Olivier Galibert <galibert@pobox.com>2018-02-25 14:18:39 +0100
commit9cc815af31f4d8a406349d35b0871328a1471e08 (patch)
tree6ade99610cf8234826cf6cd2c80ea8d4a1646439 /src/devices/video
parentf07b93b0532d379eb542ca507b103e71196e9147 (diff)
de-staticify initializations for src/devices/video (#3270)
Diffstat (limited to 'src/devices/video')
-rw-r--r--src/devices/video/315_5124.h32
-rw-r--r--src/devices/video/315_5313.cpp25
-rw-r--r--src/devices/video/315_5313.h42
-rw-r--r--src/devices/video/cdp1861.h12
-rw-r--r--src/devices/video/cdp1862.h20
-rw-r--r--src/devices/video/cesblit.h9
-rw-r--r--src/devices/video/crt9007.h50
-rw-r--r--src/devices/video/crt9021.h4
-rw-r--r--src/devices/video/crt9212.h16
-rw-r--r--src/devices/video/crtc_ega.h38
-rw-r--r--src/devices/video/dl1416.h7
-rw-r--r--src/devices/video/ef9345.cpp10
-rw-r--r--src/devices/video/ef9345.h6
-rw-r--r--src/devices/video/ef9364.cpp22
-rw-r--r--src/devices/video/ef9364.h17
-rw-r--r--src/devices/video/ef9365.cpp84
-rw-r--r--src/devices/video/ef9365.h18
-rw-r--r--src/devices/video/ef9369.h4
-rw-r--r--src/devices/video/epic12.h9
-rw-r--r--src/devices/video/fixfreq.h42
-rw-r--r--src/devices/video/gb_lcd.h10
-rw-r--r--src/devices/video/gba_lcd.h39
-rw-r--r--src/devices/video/hd44102.cpp13
-rw-r--r--src/devices/video/hd44102.h4
-rw-r--r--src/devices/video/hd44352.h4
-rw-r--r--src/devices/video/hd44780.h8
-rw-r--r--src/devices/video/hd61830.h4
-rw-r--r--src/devices/video/hd63484.h12
-rw-r--r--src/devices/video/hlcd0515.h10
-rw-r--r--src/devices/video/hlcd0538.h10
-rw-r--r--src/devices/video/huc6202.h48
-rw-r--r--src/devices/video/huc6260.h16
-rw-r--r--src/devices/video/huc6261.h12
-rw-r--r--src/devices/video/huc6270.h8
-rw-r--r--src/devices/video/huc6272.h8
-rw-r--r--src/devices/video/i8244.h10
-rw-r--r--src/devices/video/i82730.cpp10
-rw-r--r--src/devices/video/i82730.h13
-rw-r--r--src/devices/video/i8275.h24
-rw-r--r--src/devices/video/imagetek_i4100.cpp27
-rw-r--r--src/devices/video/imagetek_i4100.h16
-rw-r--r--src/devices/video/mb_vcu.cpp10
-rw-r--r--src/devices/video/mb_vcu.h10
-rw-r--r--src/devices/video/mc6845.h61
-rw-r--r--src/devices/video/mc6847.h24
-rw-r--r--src/devices/video/mos6566.h20
-rw-r--r--src/devices/video/nt7534.h4
-rw-r--r--src/devices/video/pcd8544.h4
-rw-r--r--src/devices/video/ppu2c0x.cpp6
-rw-r--r--src/devices/video/ppu2c0x.h20
-rw-r--r--src/devices/video/ppu2c0x_vt.h16
-rw-r--r--src/devices/video/psx.h12
-rw-r--r--src/devices/video/ramdac.cpp10
-rw-r--r--src/devices/video/ramdac.h14
-rw-r--r--src/devices/video/saa5050.h8
-rw-r--r--src/devices/video/scn2674.h16
-rw-r--r--src/devices/video/sed1520.h6
-rw-r--r--src/devices/video/snes_ppu.h4
-rw-r--r--src/devices/video/sprite.h5
-rw-r--r--src/devices/video/t6a04.h9
-rw-r--r--src/devices/video/tlc34076.cpp10
-rw-r--r--src/devices/video/tlc34076.h6
-rw-r--r--src/devices/video/tms34061.h12
-rw-r--r--src/devices/video/tms9927.h31
-rw-r--r--src/devices/video/tms9928a.h12
-rw-r--r--src/devices/video/upd3301.h24
-rw-r--r--src/devices/video/upd7220.h24
-rw-r--r--src/devices/video/upd7227.cpp13
-rw-r--r--src/devices/video/upd7227.h4
-rw-r--r--src/devices/video/v9938.cpp5
-rw-r--r--src/devices/video/v9938.h6
-rw-r--r--src/devices/video/vic4567.h40
-rw-r--r--src/devices/video/voodoo.h28
-rw-r--r--src/devices/video/voodoo_pci.cpp6
-rw-r--r--src/devices/video/zeus2.h8
75 files changed, 527 insertions, 734 deletions
diff --git a/src/devices/video/315_5124.h b/src/devices/video/315_5124.h
index 671d4ebeb92..9169457b3f9 100644
--- a/src/devices/video/315_5124.h
+++ b/src/devices/video/315_5124.h
@@ -52,11 +52,11 @@ public:
// construction/destruction
sega315_5124_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_signal_type(device_t &device, bool is_pal) { downcast<sega315_5124_device &>(device).m_is_pal = is_pal; }
+ void set_signal_type(bool is_pal) { m_is_pal = is_pal; }
- template <class Object> static devcb_base &set_int_callback(device_t &device, Object &&cb) { return downcast<sega315_5124_device &>(device).m_int_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_csync_callback(device_t &device, Object &&cb) { return downcast<sega315_5124_device &>(device).m_csync_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_pause_callback(device_t &device, Object &&cb) { return downcast<sega315_5124_device &>(device).m_pause_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_callback(Object &&cb) { return m_int_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_csync_callback(Object &&cb) { return m_csync_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_pause_callback(Object &&cb) { return m_pause_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( vram_read );
DECLARE_WRITE8_MEMBER( vram_write );
@@ -216,46 +216,46 @@ private:
#define MCFG_SEGA315_5124_SET_SCREEN MCFG_VIDEO_SET_SCREEN
#define MCFG_SEGA315_5124_IS_PAL(_bool) \
- sega315_5124_device::set_signal_type(*device, _bool);
+ downcast<sega315_5124_device &>(*device).set_signal_type(_bool);
#define MCFG_SEGA315_5124_INT_CB(_devcb) \
- devcb = &sega315_5124_device::set_int_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sega315_5124_device &>(*device).set_int_callback(DEVCB_##_devcb);
#define MCFG_SEGA315_5124_CSYNC_CB(_devcb) \
- devcb = &sega315_5124_device::set_csync_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sega315_5124_device &>(*device).set_csync_callback(DEVCB_##_devcb);
#define MCFG_SEGA315_5124_PAUSE_CB(_devcb) \
- devcb = &sega315_5124_device::set_pause_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sega315_5124_device &>(*device).set_pause_callback(DEVCB_##_devcb);
#define MCFG_SEGA315_5246_SET_SCREEN MCFG_VIDEO_SET_SCREEN
#define MCFG_SEGA315_5246_IS_PAL(_bool) \
- sega315_5246_device::set_signal_type(*device, _bool);
+ downcast<sega315_5246_device &>(*device).set_signal_type(_bool);
#define MCFG_SEGA315_5246_INT_CB(_devcb) \
- devcb = &sega315_5246_device::set_int_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sega315_5246_device &>(*device).set_int_callback(DEVCB_##_devcb);
#define MCFG_SEGA315_5246_CSYNC_CB(_devcb) \
- devcb = &sega315_5246_device::set_csync_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sega315_5246_device &>(*device).set_csync_callback(DEVCB_##_devcb);
#define MCFG_SEGA315_5246_PAUSE_CB(_devcb) \
- devcb = &sega315_5246_device::set_pause_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sega315_5246_device &>(*device).set_pause_callback(DEVCB_##_devcb);
#define MCFG_SEGA315_5378_SET_SCREEN MCFG_VIDEO_SET_SCREEN
#define MCFG_SEGA315_5378_IS_PAL(_bool) \
- sega315_5378_device::set_signal_type(*device, _bool);
+ downcast<sega315_5378_device &>(*device).set_signal_type(_bool);
#define MCFG_SEGA315_5378_INT_CB(_devcb) \
- devcb = &sega315_5378_device::set_int_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sega315_5378_device &>(*device).set_int_callback(DEVCB_##_devcb);
#define MCFG_SEGA315_5378_CSYNC_CB(_devcb) \
- devcb = &sega315_5378_device::set_csync_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sega315_5378_device &>(*device).set_csync_callback(DEVCB_##_devcb);
#define MCFG_SEGA315_5378_PAUSE_CB(_devcb) \
- devcb = &sega315_5378_device::set_pause_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sega315_5378_device &>(*device).set_pause_callback(DEVCB_##_devcb);
#endif // MAME_VIDEO_315_5124_H
diff --git a/src/devices/video/315_5313.cpp b/src/devices/video/315_5313.cpp
index f5b6b7c689f..8c131cd8524 100644
--- a/src/devices/video/315_5313.cpp
+++ b/src/devices/video/315_5313.cpp
@@ -169,16 +169,6 @@ sega315_5313_device::sega315_5313_device(const machine_config &mconfig, const ch
}
//-------------------------------------------------
-// static_set_palette_tag: Set the tag of the
-// palette device
-//-------------------------------------------------
-
-void sega315_5313_device::static_set_palette_tag(device_t &device, const char *tag)
-{
- downcast<sega315_5313_device &>(device).m_palette.set_tag(tag);
-}
-
-//-------------------------------------------------
// device_add_mconfig
// add machine configuration
//-------------------------------------------------
@@ -200,21 +190,6 @@ TIMER_CALLBACK_MEMBER(sega315_5313_device::irq4_on_timer_callback)
m_lv4irqline_callback(true);
}
-void sega315_5313_device::set_alt_timing(device_t &device, int use_alt_timing)
-{
- sega315_5313_device &dev = downcast<sega315_5313_device &>(device);
- dev.m_use_alt_timing = use_alt_timing;
-}
-
-void sega315_5313_device::set_palwrite_base(device_t &device, int palwrite_base)
-{
- sega315_5313_device &dev = downcast<sega315_5313_device &>(device);
- dev.m_palwrite_base = palwrite_base;
-}
-
-
-
-
void sega315_5313_device::device_start()
{
m_sndirqline_callback.resolve_safe();
diff --git a/src/devices/video/315_5313.h b/src/devices/video/315_5313.h
index be71b90dd6b..539fa39e6d6 100644
--- a/src/devices/video/315_5313.h
+++ b/src/devices/video/315_5313.h
@@ -12,42 +12,42 @@
#define MCFG_SEGA315_5313_IS_PAL(_bool) \
- sega315_5313_device::set_signal_type(*device, _bool);
+ downcast<sega315_5313_device &>(*device).set_signal_type(_bool);
#define MCFG_SEGA315_5313_INT_CB(_devcb) \
- devcb = &sega315_5313_device::set_int_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sega315_5313_device &>(*device).set_int_callback(DEVCB_##_devcb);
#define MCFG_SEGA315_5313_PAUSE_CB(_devcb) \
- devcb = &sega315_5313_device::set_pause_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sega315_5313_device &>(*device).set_pause_callback(DEVCB_##_devcb);
#define MCFG_SEGA315_5313_SND_IRQ_CALLBACK(_write) \
- devcb = &sega315_5313_device::set_sndirqline_callback(*device, DEVCB_##_write);
+ devcb = &downcast<sega315_5313_device &>(*device).set_sndirqline_callback(DEVCB_##_write);
#define MCFG_SEGA315_5313_LV6_IRQ_CALLBACK(_write) \
- devcb = &sega315_5313_device::set_lv6irqline_callback(*device, DEVCB_##_write);
+ devcb = &downcast<sega315_5313_device &>(*device).set_lv6irqline_callback(DEVCB_##_write);
#define MCFG_SEGA315_5313_LV4_IRQ_CALLBACK(_write) \
- devcb = &sega315_5313_device::set_lv4irqline_callback(*device, DEVCB_##_write);
+ devcb = &downcast<sega315_5313_device &>(*device).set_lv4irqline_callback(DEVCB_##_write);
#define MCFG_SEGA315_5313_ALT_TIMING(_data) \
- sega315_5313_device::set_alt_timing(*device, _data);
+ downcast<sega315_5313_device &>(*device).set_alt_timing(_data);
#define MCFG_SEGA315_5313_PAL_WRITE_BASE(_data) \
- sega315_5313_device::set_palwrite_base(*device, _data);
+ downcast<sega315_5313_device &>(*device).set_palwrite_base(_data);
#define MCFG_SEGA315_5313_PALETTE(_palette_tag) \
- sega315_5313_device::static_set_palette_tag(*device, "^" _palette_tag);
+ downcast<sega315_5313_device &>(*device).set_palette_tag("^" _palette_tag);
// Temporary solution while 32x VDP mixing and scanline interrupting is moved outside MD VDP
#define MCFG_SEGA315_5313_32X_SCANLINE_CB(_class, _method) \
- sega315_5313_device::set_md_32x_scanline(*device, sega315_5313_device::md_32x_scanline_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<sega315_5313_device &>(*device).set_md_32x_scanline(sega315_5313_device::md_32x_scanline_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_SEGA315_5313_32X_INTERRUPT_CB(_class, _method) \
- sega315_5313_device::set_md_32x_interrupt(*device, sega315_5313_device::md_32x_interrupt_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<sega315_5313_device &>(*device).set_md_32x_interrupt(sega315_5313_device::md_32x_interrupt_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_SEGA315_5313_32X_SCANLINE_HELPER_CB(_class, _method) \
- sega315_5313_device::set_md_32x_scanline_helper(*device, sega315_5313_device::md_32x_scanline_helper_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<sega315_5313_device &>(*device).set_md_32x_scanline_helper(sega315_5313_device::md_32x_scanline_helper_delegate(&_class::_method, #_class "::" #_method, this));
class sega315_5313_device : public sega315_5124_device
@@ -59,16 +59,16 @@ public:
sega315_5313_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_sndirqline_callback(device_t &device, Object &&cb) { return downcast<sega315_5313_device &>(device).m_sndirqline_callback.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_lv6irqline_callback(device_t &device, Object &&cb) { return downcast<sega315_5313_device &>(device).m_lv6irqline_callback.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_lv4irqline_callback(device_t &device, Object &&cb) { return downcast<sega315_5313_device &>(device).m_lv4irqline_callback.set_callback(std::forward<Object>(cb)); }
- static void set_alt_timing(device_t &device, int use_alt_timing);
- static void set_palwrite_base(device_t &device, int palwrite_base);
- static void static_set_palette_tag(device_t &device, const char *tag);
+ template <class Object> devcb_base &set_sndirqline_callback(Object &&cb) { return m_sndirqline_callback.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_lv6irqline_callback(Object &&cb) { return m_lv6irqline_callback.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_lv4irqline_callback(Object &&cb) { return m_lv4irqline_callback.set_callback(std::forward<Object>(cb)); }
+ void set_alt_timing(int use_alt_timing) { m_use_alt_timing = use_alt_timing; }
+ void set_palwrite_base(int palwrite_base) { m_palwrite_base = palwrite_base; }
+ void set_palette_tag(const char *tag) { m_palette.set_tag(tag); }
- static void set_md_32x_scanline(device_t &device, md_32x_scanline_delegate &&cb) { downcast<sega315_5313_device &>(device).m_32x_scanline_func = std::move(cb); }
- static void set_md_32x_interrupt(device_t &device, md_32x_interrupt_delegate &&cb) { downcast<sega315_5313_device &>(device).m_32x_interrupt_func = std::move(cb); }
- static void set_md_32x_scanline_helper(device_t &device, md_32x_scanline_helper_delegate &&cb) { downcast<sega315_5313_device &>(device).m_32x_scanline_helper_func = std::move(cb); }
+ template <typename Object> void set_md_32x_scanline(Object &&cb) { m_32x_scanline_func = std::forward<Object>(cb); }
+ template <typename Object> void set_md_32x_interrupt(Object &&cb) { m_32x_interrupt_func = std::forward<Object>(cb); }
+ template <typename Object> void set_md_32x_scanline_helper(Object &&cb) { m_32x_scanline_helper_func = std::forward<Object>(cb); }
int m_use_alt_timing; // use MAME scanline timer instead, render only one scanline to a single line buffer, to be rendered by a partial update call.. experimental
diff --git a/src/devices/video/cdp1861.h b/src/devices/video/cdp1861.h
index 41a9609b651..765be92de8b 100644
--- a/src/devices/video/cdp1861.h
+++ b/src/devices/video/cdp1861.h
@@ -34,13 +34,13 @@
//**************************************************************************
#define MCFG_CDP1861_IRQ_CALLBACK(_write) \
- devcb = &cdp1861_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<cdp1861_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_CDP1861_DMA_OUT_CALLBACK(_write) \
- devcb = &cdp1861_device::set_dma_out_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<cdp1861_device &>(*device).set_dma_out_wr_callback(DEVCB_##_write);
#define MCFG_CDP1861_EFX_CALLBACK(_write) \
- devcb = &cdp1861_device::set_efx_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<cdp1861_device &>(*device).set_efx_wr_callback(DEVCB_##_write);
#define MCFG_CDP1861_SCREEN_ADD(_cdptag, _tag, _clock) \
@@ -88,9 +88,9 @@ public:
// construction/destruction
cdp1861_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<cdp1861_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma_out_wr_callback(device_t &device, Object &&cb) { return downcast<cdp1861_device &>(device).m_write_dma_out.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_efx_wr_callback(device_t &device, Object &&cb) { return downcast<cdp1861_device &>(device).m_write_efx.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma_out_wr_callback(Object &&cb) { return m_write_dma_out.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_efx_wr_callback(Object &&cb) { return m_write_efx.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE8_MEMBER( dma_w );
DECLARE_WRITE_LINE_MEMBER( disp_on_w );
diff --git a/src/devices/video/cdp1862.h b/src/devices/video/cdp1862.h
index 8fa171bf61b..66dce2a4f12 100644
--- a/src/devices/video/cdp1862.h
+++ b/src/devices/video/cdp1862.h
@@ -42,19 +42,19 @@
//**************************************************************************
#define MCFG_CDP1861_RD_CALLBACK(_read) \
- devcb = &cdp1862_device::set_rd_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<cdp1862_device &>(*device).set_rd_rd_callback(DEVCB_##_read);
#define MCFG_CDP1861_BD_CALLBACK(_read) \
- devcb = &cdp1862_device::set_bd_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<cdp1862_device &>(*device).set_bd_rd_callback(DEVCB_##_read);
#define MCFG_CDP1861_GD_CALLBACK(_read) \
- devcb = &cdp1862_device::set_gd_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<cdp1862_device &>(*device).set_gd_rd_callback(DEVCB_##_read);
#define MCFG_CDP1862_LUMINANCE(_r, _b, _g, _bkg) \
- cdp1862_device::static_set_luminance(*device, _r, _b, _g, _bkg);
+ downcast<cdp1862_device &>(*device).set_luminance(_r, _b, _g, _bkg);
#define MCFG_CDP1862_CHROMINANCE(_r, _b, _g, _bkg) \
- cdp1862_device::static_set_chrominance(*device, _r, _b, _g, _bkg);
+ downcast<cdp1862_device &>(*device).set_chrominance(_r, _b, _g, _bkg);
@@ -71,12 +71,12 @@ public:
// construction/destruction
cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_rd_rd_callback(device_t &device, Object &&cb) { return downcast<cdp1862_device &>(device).m_read_rd.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_bd_rd_callback(device_t &device, Object &&cb) { return downcast<cdp1862_device &>(device).m_read_bd.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_gd_rd_callback(device_t &device, Object &&cb) { return downcast<cdp1862_device &>(device).m_read_gd.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rd_rd_callback(Object &&cb) { return m_read_rd.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_bd_rd_callback(Object &&cb) { return m_read_bd.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_gd_rd_callback(Object &&cb) { return m_read_gd.set_callback(std::forward<Object>(cb)); }
- static void static_set_luminance(device_t &device, double r, double b, double g, double bkg) { downcast<cdp1862_device &>(device).m_lum_r = r; downcast<cdp1862_device &>(device).m_lum_b = b; downcast<cdp1862_device &>(device).m_lum_g = g; downcast<cdp1862_device &>(device).m_lum_bkg = bkg; }
- static void static_set_chrominance(device_t &device, double r, double b, double g, double bkg) { downcast<cdp1862_device &>(device).m_chr_r = r; downcast<cdp1862_device &>(device).m_chr_b = b; downcast<cdp1862_device &>(device).m_chr_g = g; downcast<cdp1862_device &>(device).m_chr_bkg = bkg; }
+ void set_luminance(double r, double b, double g, double bkg) { m_lum_r = r; m_lum_b = b; m_lum_g = g; m_lum_bkg = bkg; }
+ void set_chrominance(double r, double b, double g, double bkg) { m_chr_r = r; m_chr_b = b; m_chr_g = g; m_chr_bkg = bkg; }
DECLARE_WRITE8_MEMBER( dma_w );
DECLARE_WRITE_LINE_MEMBER( bkg_w );
diff --git a/src/devices/video/cesblit.h b/src/devices/video/cesblit.h
index 33632f5abd8..e5bc962c314 100644
--- a/src/devices/video/cesblit.h
+++ b/src/devices/video/cesblit.h
@@ -22,10 +22,10 @@
#define MCFG_CESBLIT_MAP MCFG_DEVICE_PROGRAM_MAP
#define MCFG_CESBLIT_COMPUTE_ADDR(_compute_addr) \
- cesblit_device::static_set_compute_addr(*device, _compute_addr);
+ downcast<cesblit_device &>(*device).set_compute_addr(_compute_addr);
#define MCFG_CESBLIT_IRQ_CB(_devcb) \
- devcb = &cesblit_device::static_set_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cesblit_device &>(*device).set_irq_callback(DEVCB_##_devcb);
/***************************************************************************
TYPE DEFINITIONS
@@ -43,10 +43,9 @@ public:
// construction/destruction
cesblit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration
+ // configuration
void set_compute_addr(compute_addr_t compute_addr) { m_compute_addr = compute_addr; }
- static void static_set_compute_addr(device_t &device, compute_addr_t compute_addr) { downcast<cesblit_device &>(device).set_compute_addr(compute_addr); }
- template <class Object> static devcb_base &static_set_irq_callback(device_t &device, Object &&cb) { return downcast<cesblit_device &>(device).m_blit_irq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_callback(Object &&cb) { return m_blit_irq_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE16_MEMBER(color_w);
DECLARE_WRITE16_MEMBER(addr_hi_w);
diff --git a/src/devices/video/crt9007.h b/src/devices/video/crt9007.h
index 6c59ae696c7..2dad55d0329 100644
--- a/src/devices/video/crt9007.h
+++ b/src/devices/video/crt9007.h
@@ -42,40 +42,40 @@
//**************************************************************************
#define MCFG_CRT9007_CHARACTER_WIDTH(_value) \
- crt9007_device::static_set_character_width(*device, _value);
+ downcast<crt9007_device &>(*device).config_set_character_width(_value);
#define MCFG_CRT9007_INT_CALLBACK(_write) \
- devcb = &crt9007_device::set_int_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9007_device &>(*device).set_int_wr_callback(DEVCB_##_write);
#define MCFG_CRT9007_DMAR_CALLBACK(_write) \
- devcb = &crt9007_device::set_dmar_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9007_device &>(*device).set_dmar_wr_callback(DEVCB_##_write);
#define MCFG_CRT9007_VS_CALLBACK(_write) \
- devcb = &crt9007_device::set_vs_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9007_device &>(*device).set_vs_wr_callback(DEVCB_##_write);
#define MCFG_CRT9007_HS_CALLBACK(_write) \
- devcb = &crt9007_device::set_hs_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9007_device &>(*device).set_hs_wr_callback(DEVCB_##_write);
#define MCFG_CRT9007_VLT_CALLBACK(_write) \
- devcb = &crt9007_device::set_vlt_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9007_device &>(*device).set_vlt_wr_callback(DEVCB_##_write);
#define MCFG_CRT9007_CURS_CALLBACK(_write) \
- devcb = &crt9007_device::set_curs_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9007_device &>(*device).set_curs_wr_callback(DEVCB_##_write);
#define MCFG_CRT9007_DRB_CALLBACK(_write) \
- devcb = &crt9007_device::set_drb_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9007_device &>(*device).set_drb_wr_callback(DEVCB_##_write);
#define MCFG_CRT9007_WBEN_CALLBACK(_write) \
- devcb = &crt9007_device::set_wben_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9007_device &>(*device).set_wben_wr_callback(DEVCB_##_write);
#define MCFG_CRT9007_CBLANK_CALLBACK(_write) \
- devcb = &crt9007_device::set_cblank_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9007_device &>(*device).set_cblank_wr_callback(DEVCB_##_write);
#define MCFG_CRT9007_SLG_CALLBACK(_write) \
- devcb = &crt9007_device::set_slg_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9007_device &>(*device).set_slg_wr_callback(DEVCB_##_write);
#define MCFG_CRT9007_SLD_CALLBACK(_write) \
- devcb = &crt9007_device::set_sld_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9007_device &>(*device).set_sld_wr_callback(DEVCB_##_write);
@@ -93,19 +93,19 @@ public:
// construction/destruction
crt9007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_character_width(device_t &device, int value) { downcast<crt9007_device &>(device).m_hpixels_per_column = value; }
-
- template <class Object> static devcb_base &set_int_wr_callback(device_t &device, Object &&cb) { return downcast<crt9007_device &>(device).m_write_int.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dmar_wr_callback(device_t &device, Object &&cb) { return downcast<crt9007_device &>(device).m_write_dmar.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vs_wr_callback(device_t &device, Object &&cb) { return downcast<crt9007_device &>(device).m_write_vs.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_hs_wr_callback(device_t &device, Object &&cb) { return downcast<crt9007_device &>(device).m_write_hs.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vlt_wr_callback(device_t &device, Object &&cb) { return downcast<crt9007_device &>(device).m_write_vlt.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_curs_wr_callback(device_t &device, Object &&cb) { return downcast<crt9007_device &>(device).m_write_curs.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_drb_wr_callback(device_t &device, Object &&cb) { return downcast<crt9007_device &>(device).m_write_drb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_wben_wr_callback(device_t &device, Object &&cb) { return downcast<crt9007_device &>(device).m_write_wben.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_cblank_wr_callback(device_t &device, Object &&cb) { return downcast<crt9007_device &>(device).m_write_cblank.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_slg_wr_callback(device_t &device, Object &&cb) { return downcast<crt9007_device &>(device).m_write_slg.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_sld_wr_callback(device_t &device, Object &&cb) { return downcast<crt9007_device &>(device).m_write_sld.set_callback(std::forward<Object>(cb)); }
+ void config_set_character_width(int value) { m_hpixels_per_column = value; }
+
+ 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_dmar_wr_callback(Object &&cb) { return m_write_dmar.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vs_wr_callback(Object &&cb) { return m_write_vs.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_hs_wr_callback(Object &&cb) { return m_write_hs.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vlt_wr_callback(Object &&cb) { return m_write_vlt.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_curs_wr_callback(Object &&cb) { return m_write_curs.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_drb_wr_callback(Object &&cb) { return m_write_drb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_wben_wr_callback(Object &&cb) { return m_write_wben.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cblank_wr_callback(Object &&cb) { return m_write_cblank.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_slg_wr_callback(Object &&cb) { return m_write_slg.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sld_wr_callback(Object &&cb) { return m_write_sld.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/video/crt9021.h b/src/devices/video/crt9021.h
index e1e6600c9fe..2a7e513fdf2 100644
--- a/src/devices/video/crt9021.h
+++ b/src/devices/video/crt9021.h
@@ -39,7 +39,7 @@
#define MCFG_CRT9021_DRAW_CHARACTER_CALLBACK_OWNER(_class, _method) \
- crt9021_device::static_set_display_callback(*device, crt9021_device::draw_character_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<crt9021_device &>(*device).set_display_callback(crt9021_device::draw_character_delegate(&_class::_method, #_class "::" #_method, this));
//**************************************************************************
@@ -57,7 +57,7 @@ public:
// construction/destruction
crt9021_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_display_callback(device_t &device, draw_character_delegate &&cb) { downcast<crt9021_device &>(device).m_display_cb = std::move(cb); }
+ template <typename Object> void set_display_callback(Object &&cb) { m_display_cb = std::forward<Object>(cb); }
void write(uint8_t data) { m_data = data; }
DECLARE_WRITE8_MEMBER( write ) { write(data); }
diff --git a/src/devices/video/crt9212.h b/src/devices/video/crt9212.h
index 99023a0fe76..e1ce23391ae 100644
--- a/src/devices/video/crt9212.h
+++ b/src/devices/video/crt9212.h
@@ -36,16 +36,16 @@
//**************************************************************************
#define MCFG_CRT9212_WEN2_VCC() \
- crt9212_device::static_set_wen2(*device, 1);
+ downcast<crt9212_device &>(*device).set_wen2(1);
#define MCFG_CRT9212_DOUT_CALLBACK(_write) \
- devcb = &crt9212_device::set_dout_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9212_device &>(*device).set_dout_wr_callback(DEVCB_##_write);
#define MCFG_CRT9212_ROF_CALLBACK(_write) \
- devcb = &crt9212_device::set_rof_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9212_device &>(*device).set_rof_wr_callback(DEVCB_##_write);
#define MCFG_CRT9212_WOF_CALLBACK(_write) \
- devcb = &crt9212_device::set_wof_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<crt9212_device &>(*device).set_wof_wr_callback(DEVCB_##_write);
@@ -61,11 +61,11 @@ public:
// construction/destruction
crt9212_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_wen2(device_t &device, int state) { downcast<crt9212_device &>(device).m_wen2 = state; }
+ void set_wen2(int state) { m_wen2 = state; }
- template <class Object> static devcb_base &set_dout_wr_callback(device_t &device, Object &&cb) { return downcast<crt9212_device &>(device).m_write_dout.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_rof_wr_callback(device_t &device, Object &&cb) { return downcast<crt9212_device &>(device).m_write_rof.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_wof_wr_callback(device_t &device, Object &&cb) { return downcast<crt9212_device &>(device).m_write_wof.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dout_wr_callback(Object &&cb) { return m_write_dout.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rof_wr_callback(Object &&cb) { return m_write_rof.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_wof_wr_callback(Object &&cb) { return m_write_wof.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE8_MEMBER( write ) { m_data = data; }
DECLARE_WRITE_LINE_MEMBER( clrcnt_w );
diff --git a/src/devices/video/crtc_ega.h b/src/devices/video/crtc_ega.h
index 7d442d8dd7f..c3eb7dcc319 100644
--- a/src/devices/video/crtc_ega.h
+++ b/src/devices/video/crtc_ega.h
@@ -21,28 +21,28 @@
#define MCFG_CRTC_EGA_SET_SCREEN MCFG_VIDEO_SET_SCREEN
#define MCFG_CRTC_EGA_BEGIN_UPDATE_CB(_class, _method) \
- crtc_ega_device::set_begin_update_callback(*device, crtc_ega_device::begin_update_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<crtc_ega_device &>(*device).set_begin_update_callback(crtc_ega_device::begin_update_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_CRTC_EGA_ROW_UPDATE_CB(_class, _method) \
- crtc_ega_device::set_row_update_callback(*device, crtc_ega_device::row_update_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<crtc_ega_device &>(*device).set_row_update_callback(crtc_ega_device::row_update_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_CRTC_EGA_END_UPDATE_CB(_class, _method) \
- crtc_ega_device::set_end_update_callback(*device, crtc_ega_device::end_update_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<crtc_ega_device &>(*device).set_end_update_callback(crtc_ega_device::end_update_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_CRTC_EGA_HPIXELS_PER_COLUMN(_pix) \
- crtc_ega_device::set_hpixels_per_column(*device, _pix);
+ downcast<crtc_ega_device &>(*device).config_set_hpixels_per_column(_pix);
#define MCFG_CRTC_EGA_RES_OUT_DE_CB(_devcb) \
- devcb = &crtc_ega_device::set_res_out_de_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<crtc_ega_device &>(*device).set_res_out_de_callback(DEVCB_##_devcb);
#define MCFG_CRTC_EGA_RES_OUT_HSYNC_CB(_devcb) \
- devcb = &crtc_ega_device::set_res_out_hsync_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<crtc_ega_device &>(*device).set_res_out_hsync_callback(DEVCB_##_devcb);
#define MCFG_CRTC_EGA_RES_OUT_VSYNC_CB(_devcb) \
- devcb = &crtc_ega_device::set_res_out_vsync_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<crtc_ega_device &>(*device).set_res_out_vsync_callback(DEVCB_##_devcb);
#define MCFG_CRTC_EGA_RES_OUT_VBLANK_CB(_devcb) \
- devcb = &crtc_ega_device::set_res_out_vblank_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<crtc_ega_device &>(*device).set_res_out_vblank_callback(DEVCB_##_devcb);
class crtc_ega_device : public device_t,
@@ -57,19 +57,15 @@ public:
crtc_ega_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_res_out_de_callback(device_t &device, Object &&cb)
- { return downcast<crtc_ega_device &>(device).m_res_out_de_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_res_out_hsync_callback(device_t &device, Object &&cb)
- { return downcast<crtc_ega_device &>(device).m_res_out_hsync_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_res_out_vsync_callback(device_t &device, Object &&cb)
- { return downcast<crtc_ega_device &>(device).m_res_out_vsync_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_res_out_vblank_callback(device_t &device, Object &&cb)
- { return downcast<crtc_ega_device &>(device).m_res_out_vblank_cb.set_callback(std::forward<Object>(cb)); }
-
- static void set_begin_update_callback(device_t &device, begin_update_delegate &&cb) { downcast<crtc_ega_device &>(device).m_begin_update_cb = std::move(cb); }
- static void set_row_update_callback(device_t &device, row_update_delegate &&cb) { downcast<crtc_ega_device &>(device).m_row_update_cb = std::move(cb); }
- static void set_end_update_callback(device_t &device, end_update_delegate &&cb) { downcast<crtc_ega_device &>(device).m_end_update_cb = std::move(cb); }
- static void set_hpixels_per_column(device_t &device, int hpixels_per_column) { downcast<crtc_ega_device &>(device).m_hpixels_per_column = hpixels_per_column; }
+ template <class Object> devcb_base &set_res_out_de_callback(Object &&cb) { return m_res_out_de_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_res_out_hsync_callback(Object &&cb) { return m_res_out_hsync_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_res_out_vsync_callback(Object &&cb) { return m_res_out_vsync_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_res_out_vblank_callback(Object &&cb) { return m_res_out_vblank_cb.set_callback(std::forward<Object>(cb)); }
+
+ template <typename Object> void set_begin_update_callback(Object &&cb) { m_begin_update_cb = std::forward<Object>(cb); }
+ template <typename Object> void set_row_update_callback(Object &&cb) { m_row_update_cb = std::forward<Object>(cb); }
+ template <typename Object> void set_end_update_callback(Object &&cb) { m_end_update_cb = std::forward<Object>(cb); }
+ void config_set_hpixels_per_column(int hpixels_per_column) { m_hpixels_per_column = hpixels_per_column; }
/* select one of the registers for reading or writing */
DECLARE_WRITE8_MEMBER( address_w );
diff --git a/src/devices/video/dl1416.h b/src/devices/video/dl1416.h
index dbc67b97787..e064f177f58 100644
--- a/src/devices/video/dl1416.h
+++ b/src/devices/video/dl1416.h
@@ -31,10 +31,10 @@ extern device_type const DL1416T;
***************************************************************************/
#define MCFG_DL1414_UPDATE_HANDLER(_devcb) \
- devcb = &dl1414_device::set_update_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<dl1414_device &>(*device).set_update_handler(DEVCB_##_devcb);
#define MCFG_DL1416_UPDATE_HANDLER(_devcb) \
- devcb = &dl1416_device::set_update_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<dl1414_device &>(*device).set_update_handler(DEVCB_##_devcb);
/***************************************************************************
@@ -44,8 +44,7 @@ extern device_type const DL1416T;
class dl1414_device : public device_t
{
public:
- template <typename Object> static devcb_base &set_update_handler(device_t &device, Object &&cb)
- { return downcast<dl1414_device &>(device).m_update_cb.set_callback(std::forward<Object>(cb)); }
+ template <typename Object> devcb_base &set_update_handler(Object &&cb) { return m_update_cb.set_callback(std::forward<Object>(cb)); }
// signal-level interface
DECLARE_WRITE_LINE_MEMBER(wr_w); // write strobe (rising edge)
diff --git a/src/devices/video/ef9345.cpp b/src/devices/video/ef9345.cpp
index 5d99fe7d7de..b10c1bbfedb 100644
--- a/src/devices/video/ef9345.cpp
+++ b/src/devices/video/ef9345.cpp
@@ -125,16 +125,6 @@ ts9347_device::ts9347_device(const machine_config &mconfig, const char *tag, dev
}
//-------------------------------------------------
-// static_set_palette_tag: Set the tag of the
-// palette device
-//-------------------------------------------------
-
-void ef9345_device::static_set_palette_tag(device_t &device, const char *tag)
-{
- downcast<ef9345_device &>(device).m_palette.set_tag(tag);
-}
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/video/ef9345.h b/src/devices/video/ef9345.h
index 3094cd1174e..f93229c6efa 100644
--- a/src/devices/video/ef9345.h
+++ b/src/devices/video/ef9345.h
@@ -15,7 +15,7 @@
#define MCFG_EF9345_PALETTE(_palette_tag) \
- ef9345_device::static_set_palette_tag(*device, "^" _palette_tag);
+ downcast<ef9345_device &>(*device).set_palette_tag("^" _palette_tag);
//**************************************************************************
// TYPE DEFINITIONS
@@ -31,8 +31,8 @@ public:
// construction/destruction
ef9345_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration
- static void static_set_palette_tag(device_t &device, const char *tag);
+ // configuration
+ void set_palette_tag(const char *tag) { m_palette.set_tag(tag); }
// device interface
DECLARE_READ8_MEMBER( data_r );
diff --git a/src/devices/video/ef9364.cpp b/src/devices/video/ef9364.cpp
index 729e8146ab3..9d212a5aa70 100644
--- a/src/devices/video/ef9364.cpp
+++ b/src/devices/video/ef9364.cpp
@@ -73,28 +73,6 @@ ef9364_device::ef9364_device(const machine_config &mconfig, const char *tag, dev
}
//-------------------------------------------------
-// static_set_palette_tag: Set the tag of the
-// palette device
-//-------------------------------------------------
-
-void ef9364_device::static_set_palette_tag(device_t &device, const char *tag)
-{
- downcast<ef9364_device &>(device).m_palette.set_tag(tag);
-}
-
-//-------------------------------------------------
-// static_set_nb_of_pages: Set the number of hardware pages
-//-------------------------------------------------
-
-void ef9364_device::static_set_nb_of_pages(device_t &device, int nb_of_pages )
-{
- if( nb_of_pages > 0 && nb_of_pages <= 8 )
- {
- downcast<ef9364_device &>(device).nb_of_pages = nb_of_pages;
- }
-}
-
-//-------------------------------------------------
// set_color_entry: Set the color value
// into the palette
//-------------------------------------------------
diff --git a/src/devices/video/ef9364.h b/src/devices/video/ef9364.h
index a7298ec398b..cc1faafaac3 100644
--- a/src/devices/video/ef9364.h
+++ b/src/devices/video/ef9364.h
@@ -14,13 +14,13 @@
#pragma once
#define MCFG_EF9364_PALETTE(_palette_tag) \
- ef9364_device::static_set_palette_tag(*device, "^" _palette_tag);
+ downcast<ef9364_device &>(*device).set_palette_tag("^" _palette_tag);
#define MCFG_EF9364_PAGES_CNT(_pages_number) \
- ef9364_device::static_set_nb_of_pages(*device,_pages_number);
+ downcast<ef9364_device &>(*device).set_nb_of_pages(_pages_number);
#define MCFG_EF9364_IRQ_HANDLER(_devcb) \
- devcb = &ef9364_device::set_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<ef9364_device &>(*device).set_irq_handler(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -42,9 +42,14 @@ public:
// construction/destruction
ef9364_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration
- static void static_set_palette_tag(device_t &device, const char *tag);
- static void static_set_nb_of_pages(device_t &device, int nb_bitplanes );
+ // configuration
+ void set_palette_tag(const char *tag) { m_palette.set_tag(tag); }
+ void set_nb_of_pages(int nb_bitplanes) {
+ if (nb_bitplanes > 0 && nb_bitplanes <= 8)
+ {
+ nb_of_pages = nb_bitplanes;
+ }
+ }
// device interface
void update_scanline(uint16_t scanline);
diff --git a/src/devices/video/ef9365.cpp b/src/devices/video/ef9365.cpp
index 15539950443..de1e14d0870 100644
--- a/src/devices/video/ef9365.cpp
+++ b/src/devices/video/ef9365.cpp
@@ -208,78 +208,68 @@ ef9365_device::ef9365_device(const machine_config &mconfig, const char *tag, dev
}
//-------------------------------------------------
-// static_set_palette_tag: Set the tag of the
-// palette device
+// set_nb_of_bitplanes: Set the number of bitplanes
//-------------------------------------------------
-void ef9365_device::static_set_palette_tag(device_t &device, const char *tag)
-{
- downcast<ef9365_device &>(device).m_palette.set_tag(tag);
-}
-
-//-------------------------------------------------
-// static_set_nb_of_bitplanes: Set the number of bitplanes
-//-------------------------------------------------
-
-void ef9365_device::static_set_nb_bitplanes(device_t &device, int nb_bitplanes )
+void ef9365_device::set_nb_bitplanes(int nb_bitplanes)
{
if( nb_bitplanes > 0 && nb_bitplanes <= 8 )
{
- downcast<ef9365_device &>(device).nb_of_bitplanes = nb_bitplanes;
- downcast<ef9365_device &>(device).nb_of_colors = pow(2,nb_bitplanes);
+ nb_of_bitplanes = nb_bitplanes;
+ nb_of_colors = pow(2, nb_bitplanes);
}
}
//-------------------------------------------------
-// static_set_display_mode: Set the display mode
+// set_display_mode: Set the display mode
//-------------------------------------------------
-void ef9365_device::static_set_display_mode(device_t &device, int display_mode )
+void ef9365_device::set_display_mode(int display_mode)
{
switch(display_mode)
{
case DISPLAY_MODE_256x256:
- downcast<ef9365_device &>(device).bitplane_xres = 256;
- downcast<ef9365_device &>(device).bitplane_yres = 256;
- downcast<ef9365_device &>(device).vsync_scanline_pos = 250;
- downcast<ef9365_device &>(device).overflow_mask_x = 0xFF00;
- downcast<ef9365_device &>(device).overflow_mask_y = 0xFF00;
+ bitplane_xres = 256;
+ bitplane_yres = 256;
+ vsync_scanline_pos = 250;
+ overflow_mask_x = 0xFF00;
+ overflow_mask_y = 0xFF00;
break;
case DISPLAY_MODE_512x512:
- downcast<ef9365_device &>(device).bitplane_xres = 512;
- downcast<ef9365_device &>(device).bitplane_yres = 512;
- downcast<ef9365_device &>(device).vsync_scanline_pos = 506;
- downcast<ef9365_device &>(device).overflow_mask_x = 0xFE00;
- downcast<ef9365_device &>(device).overflow_mask_y = 0xFE00;
+ bitplane_xres = 512;
+ bitplane_yres = 512;
+ vsync_scanline_pos = 506;
+ overflow_mask_x = 0xFE00;
+ overflow_mask_y = 0xFE00;
break;
case DISPLAY_MODE_512x256:
- downcast<ef9365_device &>(device).bitplane_xres = 512;
- downcast<ef9365_device &>(device).bitplane_yres = 256;
- downcast<ef9365_device &>(device).vsync_scanline_pos = 250;
- downcast<ef9365_device &>(device).overflow_mask_x = 0xFE00;
- downcast<ef9365_device &>(device).overflow_mask_y = 0xFF00;
+ bitplane_xres = 512;
+ bitplane_yres = 256;
+ vsync_scanline_pos = 250;
+ overflow_mask_x = 0xFE00;
+ overflow_mask_y = 0xFF00;
break;
case DISPLAY_MODE_128x128:
- downcast<ef9365_device &>(device).bitplane_xres = 128;
- downcast<ef9365_device &>(device).bitplane_yres = 128;
- downcast<ef9365_device &>(device).vsync_scanline_pos = 124;
- downcast<ef9365_device &>(device).overflow_mask_x = 0xFF80;
- downcast<ef9365_device &>(device).overflow_mask_y = 0xFF80;
+ bitplane_xres = 128;
+ bitplane_yres = 128;
+ vsync_scanline_pos = 124;
+ overflow_mask_x = 0xFF80;
+ overflow_mask_y = 0xFF80;
break;
case DISPLAY_MODE_64x64:
- downcast<ef9365_device &>(device).bitplane_xres = 64;
- downcast<ef9365_device &>(device).bitplane_yres = 64;
- downcast<ef9365_device &>(device).vsync_scanline_pos = 62;
- downcast<ef9365_device &>(device).overflow_mask_x = 0xFFC0;
- downcast<ef9365_device &>(device).overflow_mask_y = 0xFFC0;
+ bitplane_xres = 64;
+ bitplane_yres = 64;
+ vsync_scanline_pos = 62;
+ overflow_mask_x = 0xFFC0;
+ overflow_mask_y = 0xFFC0;
break;
default:
- downcast<ef9365_device &>(device).logerror("Invalid EF9365 Display mode: %02x\n", display_mode);
- downcast<ef9365_device &>(device).bitplane_xres = 256;
- downcast<ef9365_device &>(device).bitplane_yres = 256;
- downcast<ef9365_device &>(device).vsync_scanline_pos = 250;
- downcast<ef9365_device &>(device).overflow_mask_x = 0xFF00;
- downcast<ef9365_device &>(device).overflow_mask_y = 0xFF00;
+ logerror("Invalid EF9365 Display mode: %02x\n", display_mode);
+ bitplane_xres = 256;
+ bitplane_yres = 256;
+ vsync_scanline_pos = 250;
+ overflow_mask_x = 0xFF00;
+ overflow_mask_y = 0xFF00;
break;
}
}
diff --git a/src/devices/video/ef9365.h b/src/devices/video/ef9365.h
index 7d028c70ae6..5f0bbadd8b1 100644
--- a/src/devices/video/ef9365.h
+++ b/src/devices/video/ef9365.h
@@ -14,16 +14,16 @@
#pragma once
#define MCFG_EF936X_PALETTE(palette_tag) \
- ef9365_device::static_set_palette_tag(*device, ("^" palette_tag));
+ downcast<ef9365_device &>(*device).set_palette_tag(("^" palette_tag));
#define MCFG_EF936X_BITPLANES_CNT(bitplanes_number) \
- ef9365_device::static_set_nb_bitplanes(*device, (bitplanes_number));
+ downcast<ef9365_device &>(*device).set_nb_bitplanes((bitplanes_number));
#define MCFG_EF936X_DISPLAYMODE(display_mode) \
- ef9365_device::static_set_display_mode(*device, (ef9365_device::display_mode));
+ downcast<ef9365_device &>(*device).set_display_mode((ef9365_device::display_mode));
#define MCFG_EF936X_IRQ_HANDLER(cb) \
- devcb = &ef9365_device::set_irq_handler(*device, (DEVCB_##cb));
+ devcb = &downcast<ef9365_device &>(*device).set_irq_handler((DEVCB_##cb));
//**************************************************************************
// TYPE DEFINITIONS
@@ -48,11 +48,11 @@ public:
// construction/destruction
ef9365_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration
- static void static_set_palette_tag(device_t &device, const char *tag);
- static void static_set_nb_bitplanes(device_t &device, int nb_bitplanes );
- static void static_set_display_mode(device_t &device, int display_mode );
- template<class _Object> static devcb_base &set_irq_handler(device_t &device, _Object object) { return downcast<ef9365_device &>(device).m_irq_handler.set_callback(object); }
+ // configuration
+ void set_palette_tag(const char *tag) { m_palette.set_tag(tag); }
+ void set_nb_bitplanes(int nb_bitplanes );
+ void set_display_mode(int display_mode );
+ template<class Object> devcb_base &set_irq_handler(Object object) { return m_irq_handler.set_callback(std::forward<Object>(object)); }
// device interface
DECLARE_READ8_MEMBER( data_r );
diff --git a/src/devices/video/ef9369.h b/src/devices/video/ef9369.h
index ee7317f7975..5a74e0179e0 100644
--- a/src/devices/video/ef9369.h
+++ b/src/devices/video/ef9369.h
@@ -39,7 +39,7 @@
MCFG_DEVICE_ADD(_tag, EF9369, 0) \
#define MCFG_EF9369_COLOR_UPDATE_CB(_class, _method) \
- ef9369_device::set_color_update_callback(*device, ef9369_device::color_update_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<ef9369_device &>(*device).set_color_update_callback(ef9369_device::color_update_delegate(&_class::_method, #_class "::" #_method, this));
//**************************************************************************
@@ -59,7 +59,7 @@ public:
ef9369_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
- static void set_color_update_callback(device_t &device, color_update_delegate &&cb) { downcast<ef9369_device &>(device).m_color_update_cb = std::move(cb); }
+ template <typename Object> void set_color_update_callback(Object &&cb) { m_color_update_cb = std::forward<Object>(cb); }
DECLARE_READ8_MEMBER(data_r);
DECLARE_WRITE8_MEMBER(data_w);
diff --git a/src/devices/video/epic12.h b/src/devices/video/epic12.h
index ce2bb88c5d3..a8fe41b069f 100644
--- a/src/devices/video/epic12.h
+++ b/src/devices/video/epic12.h
@@ -10,7 +10,7 @@
MCFG_DEVICE_ADD(_tag, EPIC12, 0)
#define MCFG_EPIC12_SET_MAINRAMSIZE( _rgn ) \
- epic12_device::set_mainramsize(*device, _rgn);
+ downcast<epic12_device &>(*device).set_mainramsize(_rgn);
class epic12_device : public device_t, public device_video_interface
@@ -25,11 +25,10 @@ public:
inline uint16_t READ_NEXT_WORD(offs_t *addr);
- static void set_mainramsize(device_t &device, int ramsize)
+ void set_mainramsize(int ramsize)
{
- epic12_device &dev = downcast<epic12_device &>(device);
- dev.m_main_ramsize = ramsize;
- dev.m_main_rammask = ramsize-1;
+ m_main_ramsize = ramsize;
+ m_main_rammask = ramsize-1;
}
static void *blit_request_callback(void *param, int threadid);
diff --git a/src/devices/video/fixfreq.h b/src/devices/video/fixfreq.h
index e475c2f8b4f..10c52217e82 100644
--- a/src/devices/video/fixfreq.h
+++ b/src/devices/video/fixfreq.h
@@ -29,22 +29,22 @@
MCFG_VIDEO_SET_SCREEN(_screen_tag)
#define MCFG_FIXFREQ_MONITOR_CLOCK(_clock) \
- fixedfreq_device::set_minitor_clock(*device, _clock);
+ downcast<fixedfreq_device &>(*device).set_minitor_clock(_clock);
#define MCFG_FIXFREQ_HORZ_PARAMS(_visible, _frontporch, _sync, _backporch) \
- fixedfreq_device::set_horz_params(*device, _visible, _frontporch, _sync, _backporch);
+ downcast<fixedfreq_device &>(*device).set_horz_params(_visible, _frontporch, _sync, _backporch);
#define MCFG_FIXFREQ_VERT_PARAMS(_visible, _frontporch, _sync, _backporch) \
- fixedfreq_device::set_vert_params(*device, _visible, _frontporch, _sync, _backporch);
+ downcast<fixedfreq_device &>(*device).set_vert_params(_visible, _frontporch, _sync, _backporch);
#define MCFG_FIXFREQ_FIELDCOUNT(_count) \
- fixedfreq_device::set_fieldcount(*device, _count);
+ downcast<fixedfreq_device &>(*device).set_fieldcount(_count);
#define MCFG_FIXFREQ_SYNC_THRESHOLD(_threshold) \
- fixedfreq_device::set_threshold(*device, _threshold);
+ downcast<fixedfreq_device &>(*device).set_threshold(_threshold);
#define MCFG_FIXFREQ_GAIN(_gain) \
- fixedfreq_device::set_gain(*device, _gain);
+ downcast<fixedfreq_device &>(*device).set_gain(_gain);
// pre-defined configurations
@@ -74,25 +74,23 @@ public:
fixedfreq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration helpers
- static void set_minitor_clock(device_t &device, uint32_t clock) { downcast<fixedfreq_device &>(device).m_monitor_clock = clock; }
- static void set_fieldcount(device_t &device, int count) { downcast<fixedfreq_device &>(device).m_fieldcount = count; }
- static void set_threshold(device_t &device, double threshold) { downcast<fixedfreq_device &>(device).m_sync_threshold = threshold; }
- static void set_gain(device_t &device, double gain) { downcast<fixedfreq_device &>(device).m_gain = gain; }
- static void set_horz_params(device_t &device, int visible, int frontporch, int sync, int backporch)
+ void set_minitor_clock(uint32_t clock) { m_monitor_clock = clock; }
+ void set_fieldcount(int count) { m_fieldcount = count; }
+ void set_threshold(double threshold) { m_sync_threshold = threshold; }
+ void set_gain(double gain) { m_gain = gain; }
+ void set_horz_params(int visible, int frontporch, int sync, int backporch)
{
- fixedfreq_device &dev = downcast<fixedfreq_device &>(device);
- dev.m_hvisible = visible;
- dev.m_hfrontporch = frontporch;
- dev.m_hsync = sync;
- dev.m_hbackporch = backporch;
+ m_hvisible = visible;
+ m_hfrontporch = frontporch;
+ m_hsync = sync;
+ m_hbackporch = backporch;
}
- static void set_vert_params(device_t &device, int visible, int frontporch, int sync, int backporch)
+ void set_vert_params(int visible, int frontporch, int sync, int backporch)
{
- fixedfreq_device &dev = downcast<fixedfreq_device &>(device);
- dev.m_vvisible = visible;
- dev.m_vfrontporch = frontporch;
- dev.m_vsync = sync;
- dev.m_vbackporch = backporch;
+ m_vvisible = visible;
+ m_vfrontporch = frontporch;
+ m_vsync = sync;
+ m_vbackporch = backporch;
}
virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
diff --git a/src/devices/video/gb_lcd.h b/src/devices/video/gb_lcd.h
index 4c71badd9ed..616b2f3e20c 100644
--- a/src/devices/video/gb_lcd.h
+++ b/src/devices/video/gb_lcd.h
@@ -21,7 +21,7 @@ class dmg_ppu_device : public device_t,
public:
dmg_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_lr35902_tag(device_t &device, const char *tag) { downcast<dmg_ppu_device &>(device).m_lr35902.set_tag(tag); }
+ void set_lr35902_tag(const char *tag) { m_lr35902.set_tag(tag); }
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -295,19 +295,19 @@ DECLARE_DEVICE_TYPE(CGB_PPU, cgb_ppu_device)
#define MCFG_DMG_PPU_ADD(_tag, _cpu_tag ) \
MCFG_DEVICE_ADD( _tag, DMG_PPU, 0 ) \
- dmg_ppu_device::static_set_lr35902_tag(*device, "^" _cpu_tag);
+ downcast<dmg_ppu_device &>(*device).set_lr35902_tag("^" _cpu_tag);
#define MCFG_MGB_PPU_ADD(_tag, _cpu_tag ) \
MCFG_DEVICE_ADD( _tag, MGB_PPU, 0 ) \
- dmg_ppu_device::static_set_lr35902_tag(*device, "^" _cpu_tag);
+ downcast<dmg_ppu_device &>(*device).set_lr35902_tag("^" _cpu_tag);
#define MCFG_SGB_PPU_ADD(_tag, _cpu_tag ) \
MCFG_DEVICE_ADD( _tag, SGB_PPU, 0 ) \
- dmg_ppu_device::static_set_lr35902_tag(*device, "^" _cpu_tag);
+ downcast<dmg_ppu_device &>(*device).set_lr35902_tag("^" _cpu_tag);
#define MCFG_CGB_PPU_ADD(_tag, _cpu_tag ) \
MCFG_DEVICE_ADD( _tag, CGB_PPU, 0 ) \
- dmg_ppu_device::static_set_lr35902_tag(*device, "^" _cpu_tag);
+ downcast<dmg_ppu_device &>(*device).set_lr35902_tag("^" _cpu_tag);
#endif // MAME_VIDEO_GB_LCD_H
diff --git a/src/devices/video/gba_lcd.h b/src/devices/video/gba_lcd.h
index c1ae5c925ce..a8cc9cd3d73 100644
--- a/src/devices/video/gba_lcd.h
+++ b/src/devices/video/gba_lcd.h
@@ -33,19 +33,19 @@ DECLARE_DEVICE_TYPE(GBA_LCD, gba_lcd_device)
MCFG_DEVICE_ADD(_tag, GBA_LCD, 0)
#define MCFG_GBA_LCD_INT_HBLANK(_devcb) \
- devcb = &gba_lcd_device::set_int_hblank_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<gba_lcd_device &>(*device).set_int_hblank_callback(DEVCB_##_devcb);
#define MCFG_GBA_LCD_INT_VBLANK(_devcb) \
- devcb = &gba_lcd_device::set_int_vblank_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<gba_lcd_device &>(*device).set_int_vblank_callback(DEVCB_##_devcb);
#define MCFG_GBA_LCD_INT_VCOUNT(_devcb) \
- devcb = &gba_lcd_device::set_int_vcount_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<gba_lcd_device &>(*device).set_int_vcount_callback(DEVCB_##_devcb);
#define MCFG_GBA_LCD_DMA_HBLANK(_devcb) \
- devcb = &gba_lcd_device::set_dma_hblank_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<gba_lcd_device &>(*device).set_dma_hblank_callback(DEVCB_##_devcb);
#define MCFG_GBA_LCD_DMA_VBLANK(_devcb) \
- devcb = &gba_lcd_device::set_dma_vblank_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<gba_lcd_device &>(*device).set_dma_vblank_callback(DEVCB_##_devcb);
//**************************************************************************
@@ -99,30 +99,11 @@ public:
TIMER_CALLBACK_MEMBER(perform_hbl);
TIMER_CALLBACK_MEMBER(perform_scan);
- template <class Object> static devcb_base &set_int_hblank_callback(device_t &device, Object &&cb)
- {
- return downcast<gba_lcd_device &>(device).m_int_hblank_cb.set_callback(std::forward<Object>(cb));
- }
-
- template <class Object> static devcb_base &set_int_vblank_callback(device_t &device, Object &&cb)
- {
- return downcast<gba_lcd_device &>(device).m_int_vblank_cb.set_callback(std::forward<Object>(cb));
- }
-
- template <class Object> static devcb_base &set_int_vcount_callback(device_t &device, Object &&cb)
- {
- return downcast<gba_lcd_device &>(device).m_int_vcount_cb.set_callback(std::forward<Object>(cb));
- }
-
- template <class Object> static devcb_base &set_dma_hblank_callback(device_t &device, Object &&cb)
- {
- return downcast<gba_lcd_device &>(device).m_dma_hblank_cb.set_callback(std::forward<Object>(cb));
- }
-
- template <class Object> static devcb_base &set_dma_vblank_callback(device_t &device, Object &&cb)
- {
- return downcast<gba_lcd_device &>(device).m_dma_vblank_cb.set_callback(std::forward<Object>(cb));
- }
+ template <class Object> devcb_base &set_int_hblank_callback(Object &&cb) { return m_int_hblank_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_vblank_callback(Object &&cb) { return m_int_vblank_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_vcount_callback(Object &&cb) { return m_int_vcount_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma_hblank_callback(Object &&cb) { return m_dma_hblank_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma_vblank_callback(Object &&cb) { return m_dma_vblank_cb.set_callback(std::forward<Object>(cb)); }
protected:
// device-level overrides
diff --git a/src/devices/video/hd44102.cpp b/src/devices/video/hd44102.cpp
index 43a413920e8..71e8a0fba13 100644
--- a/src/devices/video/hd44102.cpp
+++ b/src/devices/video/hd44102.cpp
@@ -79,19 +79,6 @@ hd44102_device::hd44102_device(const machine_config &mconfig, const char *tag, d
//-------------------------------------------------
-// static_set_offsets - configuration helper
-//-------------------------------------------------
-
-void hd44102_device::static_set_offsets(device_t &device, int sx, int sy)
-{
- hd44102_device &hd44102 = downcast<hd44102_device &>(device);
-
- hd44102.m_sx = sx;
- hd44102.m_sy = sy;
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/video/hd44102.h b/src/devices/video/hd44102.h
index c9746d417ec..a484ce77478 100644
--- a/src/devices/video/hd44102.h
+++ b/src/devices/video/hd44102.h
@@ -21,7 +21,7 @@
#define MCFG_HD44102_ADD(_tag, _screen_tag, _sx, _sy) \
MCFG_DEVICE_ADD(_tag, HD44102, 0) \
MCFG_VIDEO_SET_SCREEN(_screen_tag) \
- hd44102_device::static_set_offsets(*device, _sx, _sy);
+ downcast<hd44102_device &>(*device).set_offsets(_sx, _sy);
@@ -39,7 +39,7 @@ public:
hd44102_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration helpers
- static void static_set_offsets(device_t &device, int sx, int sy);
+ void set_offsets(int sx, int sy) { m_sx = sx; m_sy = sy; }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/video/hd44352.h b/src/devices/video/hd44352.h
index a7dff37b904..ce12d9bc1cb 100644
--- a/src/devices/video/hd44352.h
+++ b/src/devices/video/hd44352.h
@@ -13,7 +13,7 @@
#define MCFG_HD44352_ON_CB(_devcb) \
- devcb = &hd44352_device::set_on_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hd44352_device &>(*device).set_on_callback(DEVCB_##_devcb);
//**************************************************************************
@@ -28,7 +28,7 @@ public:
// construction/destruction
hd44352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_on_callback(device_t &device, Object &&cb) { return downcast<hd44352_device &>(device).m_on_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_on_callback(Object &&cb) { return m_on_cb.set_callback(std::forward<Object>(cb)); }
// device interface
uint8_t data_read();
diff --git a/src/devices/video/hd44780.h b/src/devices/video/hd44780.h
index c2508704627..001c9bf3c13 100644
--- a/src/devices/video/hd44780.h
+++ b/src/devices/video/hd44780.h
@@ -19,10 +19,10 @@
MCFG_DEVICE_ADD( _tag, KS0066_F05, 0 )
#define MCFG_HD44780_LCD_SIZE(_lines, _chars) \
- hd44780_device::static_set_lcd_size(*device, _lines, _chars);
+ downcast<hd44780_device &>(*device).set_lcd_size(_lines, _chars);
#define MCFG_HD44780_PIXEL_UPDATE_CB(_class, _method) \
- hd44780_device::static_set_pixel_update_cb(*device, hd44780_device::pixel_update_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<hd44780_device &>(*device).set_pixel_update_cb(hd44780_device::pixel_update_delegate(&_class::_method, #_class "::" #_method, this));
//**************************************************************************
// TYPE DEFINITIONS
@@ -42,8 +42,8 @@ public:
hd44780_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration helpers
- static void static_set_lcd_size(device_t &device, int _lines, int _chars) { hd44780_device &dev=downcast<hd44780_device &>(device); dev.m_lines = _lines; dev.m_chars = _chars; }
- static void static_set_pixel_update_cb(device_t &device, pixel_update_delegate &&cb) { downcast<hd44780_device &>(device).m_pixel_update_cb = std::move(cb); }
+ void set_lcd_size(int lines, int chars) { m_lines = lines; m_chars = chars; }
+ template <typename Object> void set_pixel_update_cb(Object &&cb) { m_pixel_update_cb = std::forward<Object>(cb); }
// device interface
virtual DECLARE_WRITE8_MEMBER(write);
diff --git a/src/devices/video/hd61830.h b/src/devices/video/hd61830.h
index 93bcfbf96ac..534c42c8602 100644
--- a/src/devices/video/hd61830.h
+++ b/src/devices/video/hd61830.h
@@ -19,7 +19,7 @@
//**************************************************************************
#define MCFG_HD61830_RD_CALLBACK(_read) \
- devcb = &hd61830_device::set_rd_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<hd61830_device &>(*device).set_rd_rd_callback(DEVCB_##_read);
@@ -37,7 +37,7 @@ public:
// construction/destruction
hd61830_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_rd_rd_callback(device_t &device, Object &&cb) { return downcast<hd61830_device &>(device).m_read_rd.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rd_rd_callback(Object &&cb) { return m_read_rd.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( status_r );
DECLARE_WRITE8_MEMBER( control_w );
diff --git a/src/devices/video/hd63484.h b/src/devices/video/hd63484.h
index 7188f4ae1f8..885761d211b 100644
--- a/src/devices/video/hd63484.h
+++ b/src/devices/video/hd63484.h
@@ -26,15 +26,15 @@
MCFG_DEVICE_ADDRESS_MAP(0, _map)
#define MCFG_HD63484_DISPLAY_CALLBACK_OWNER(_class, _method) \
- hd63484_device::static_set_display_callback(*device, hd63484_device::display_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<hd63484_device &>(*device).set_display_callback(hd63484_device::display_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_HD63484_AUTO_CONFIGURE_SCREEN(_val) \
- hd63484_device::static_set_auto_configure_screen(*device, _val);
+ downcast<hd63484_device &>(*device).set_auto_configure_screen(_val);
#define HD63484_DISPLAY_PIXELS_MEMBER(_name) void _name(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, int x, uint16_t data)
#define MCFG_HD63484_EXTERNAL_SKEW(_val) \
- hd63484_device::static_set_external_skew(*device, _val);
+ downcast<hd63484_device &>(*device).set_external_skew(_val);
// ======================> hd63484_device
@@ -49,9 +49,9 @@ public:
// construction/destruction
hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_display_callback(device_t &device, display_delegate &&cb) { downcast<hd63484_device &>(device).m_display_cb = std::move(cb); }
- static void static_set_auto_configure_screen(device_t &device, bool auto_configure_screen) { downcast<hd63484_device &>(device).m_auto_configure_screen = auto_configure_screen; }
- static void static_set_external_skew(device_t &device, int skew) { downcast<hd63484_device &>(device).m_external_skew = skew; }
+ template <typename Object> void set_display_callback(Object &&cb) { m_display_cb = std::forward<Object>(cb); }
+ void set_auto_configure_screen(bool auto_configure_screen) { m_auto_configure_screen = auto_configure_screen; }
+ void set_external_skew(int skew) { m_external_skew = skew; }
DECLARE_WRITE16_MEMBER( address16_w );
DECLARE_WRITE16_MEMBER( data16_w );
diff --git a/src/devices/video/hlcd0515.h b/src/devices/video/hlcd0515.h
index 5081a97a857..0f4e1444a93 100644
--- a/src/devices/video/hlcd0515.h
+++ b/src/devices/video/hlcd0515.h
@@ -43,11 +43,11 @@
// COL/ROW pins (offset for ROW)
#define MCFG_HLCD0515_WRITE_COLS_CB(_devcb) \
- devcb = &hlcd0515_device::set_write_cols_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hlcd0515_device &>(*device).set_write_cols_callback(DEVCB_##_devcb);
// DATA OUT pin, don't use on HLCD0569
#define MCFG_HLCD0515_WRITE_DATA_CB(_devcb) \
- devcb = &hlcd0515_device::set_write_data_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hlcd0515_device &>(*device).set_write_data_callback(DEVCB_##_devcb);
class hlcd0515_device : public device_t
@@ -55,9 +55,9 @@ class hlcd0515_device : public device_t
public:
hlcd0515_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- // static configuration helpers
- template <typename Object> static devcb_base &set_write_cols_callback(device_t &device, Object &&cb) { return downcast<hlcd0515_device &>(device).m_write_cols.set_callback(std::forward<Object>(cb)); }
- template <typename Object> static devcb_base &set_write_data_callback(device_t &device, Object &&cb) { return downcast<hlcd0515_device &>(device).m_write_data.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ template <typename Object> devcb_base &set_write_cols_callback(Object &&cb) { return m_write_cols.set_callback(std::forward<Object>(cb)); }
+ template <typename Object> devcb_base &set_write_data_callback(Object &&cb) { return m_write_data.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER(write_clock);
DECLARE_WRITE_LINE_MEMBER(write_cs);
diff --git a/src/devices/video/hlcd0538.h b/src/devices/video/hlcd0538.h
index 8bdbb4a83f1..e84a5387e22 100644
--- a/src/devices/video/hlcd0538.h
+++ b/src/devices/video/hlcd0538.h
@@ -42,11 +42,11 @@
// C/R pins (0538: d0-d7 for rows)
#define MCFG_HLCD0538_WRITE_COLS_CB(_devcb) \
- devcb = &hlcd0538_device::set_write_cols_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hlcd0538_device &>(*device).set_write_cols_callback(DEVCB_##_devcb);
// INTERRUPT pin
#define MCFG_HLCD0538_INTERRUPT_CB(_devcb) \
- devcb = &hlcd0538_device::set_write_interrupt_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hlcd0538_device &>(*device).set_write_interrupt_callback(DEVCB_##_devcb);
class hlcd0538_device : public device_t
@@ -54,9 +54,9 @@ class hlcd0538_device : public device_t
public:
hlcd0538_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- // static configuration helpers
- template <typename Object> static devcb_base &set_write_cols_callback(device_t &device, Object &&cb) { return downcast<hlcd0538_device &>(device).m_write_cols.set_callback(std::forward<Object>(cb)); }
- template <typename Object> static devcb_base &set_write_interrupt_callback(device_t &device, Object &&cb) { return downcast<hlcd0538_device &>(device).m_write_interrupt.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ template <typename Object> devcb_base &set_write_cols_callback(Object &&cb) { return m_write_cols.set_callback(std::forward<Object>(cb)); }
+ template <typename Object> devcb_base &set_write_interrupt_callback(Object &&cb) { return m_write_interrupt.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER(write_clk);
DECLARE_WRITE_LINE_MEMBER(write_lcd);
diff --git a/src/devices/video/huc6202.h b/src/devices/video/huc6202.h
index 3a3c90076e3..cc086350647 100644
--- a/src/devices/video/huc6202.h
+++ b/src/devices/video/huc6202.h
@@ -13,40 +13,40 @@
#define MCFG_HUC6202_NEXT_PIXEL_0_CB(_devcb) \
- devcb = &huc6202_device::set_next_pixel_0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_next_pixel_0_callback(DEVCB_##_devcb);
#define MCFG_HUC6202_TIME_TIL_NEXT_EVENT_0_CB(_devcb) \
- devcb = &huc6202_device::set_time_til_next_event_0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_time_til_next_event_0_callback(DEVCB_##_devcb);
#define MCFG_HUC6202_VSYNC_CHANGED_0_CB(_devcb) \
- devcb = &huc6202_device::set_vsync_changed_0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_vsync_changed_0_callback(DEVCB_##_devcb);
#define MCFG_HUC6202_HSYNC_CHANGED_0_CB(_devcb) \
- devcb = &huc6202_device::set_hsync_changed_0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_hsync_changed_0_callback(DEVCB_##_devcb);
#define MCFG_HUC6202_READ_0_CB(_devcb) \
- devcb = &huc6202_device::set_read_0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_read_0_callback(DEVCB_##_devcb);
#define MCFG_HUC6202_WRITE_0_CB(_devcb) \
- devcb = &huc6202_device::set_write_0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_write_0_callback(DEVCB_##_devcb);
#define MCFG_HUC6202_NEXT_PIXEL_1_CB(_devcb) \
- devcb = &huc6202_device::set_next_pixel_1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_next_pixel_1_callback(DEVCB_##_devcb);
#define MCFG_HUC6202_TIME_TIL_NEXT_EVENT_1_CB(_devcb) \
- devcb = &huc6202_device::set_time_til_next_event_1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_time_til_next_event_1_callback(DEVCB_##_devcb);
#define MCFG_HUC6202_VSYNC_CHANGED_1_CB(_devcb) \
- devcb = &huc6202_device::set_vsync_changed_1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_vsync_changed_1_callback(DEVCB_##_devcb);
#define MCFG_HUC6202_HSYNC_CHANGED_1_CB(_devcb) \
- devcb = &huc6202_device::set_hsync_changed_1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_hsync_changed_1_callback(DEVCB_##_devcb);
#define MCFG_HUC6202_READ_1_CB(_devcb) \
- devcb = &huc6202_device::set_read_1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_read_1_callback(DEVCB_##_devcb);
#define MCFG_HUC6202_WRITE_1_CB(_devcb) \
- devcb = &huc6202_device::set_write_1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6202_device &>(*device).set_write_1_callback(DEVCB_##_devcb);
class huc6202_device : public device_t
@@ -55,18 +55,18 @@ public:
// construction/destruction
huc6202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_next_pixel_0_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_next_pixel_0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_time_til_next_event_0_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_time_til_next_event_0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vsync_changed_0_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_vsync_changed_0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_hsync_changed_0_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_hsync_changed_0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_0_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_read_0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_0_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_write_0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_next_pixel_1_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_next_pixel_1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_time_til_next_event_1_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_time_til_next_event_1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vsync_changed_1_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_vsync_changed_1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_hsync_changed_1_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_hsync_changed_1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_1_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_read_1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_1_callback(device_t &device, Object &&cb) { return downcast<huc6202_device &>(device).m_write_1_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_next_pixel_0_callback(Object &&cb) { return m_next_pixel_0_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_time_til_next_event_0_callback(Object &&cb) { return m_time_til_next_event_0_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vsync_changed_0_callback(Object &&cb) { return m_vsync_changed_0_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_hsync_changed_0_callback(Object &&cb) { return m_hsync_changed_0_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_0_callback(Object &&cb) { return m_read_0_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_0_callback(Object &&cb) { return m_write_0_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_next_pixel_1_callback(Object &&cb) { return m_next_pixel_1_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_time_til_next_event_1_callback(Object &&cb) { return m_time_til_next_event_1_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vsync_changed_1_callback(Object &&cb) { return m_vsync_changed_1_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_hsync_changed_1_callback(Object &&cb) { return m_hsync_changed_1_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_1_callback(Object &&cb) { return m_read_1_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_1_callback(Object &&cb) { return m_write_1_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/video/huc6260.h b/src/devices/video/huc6260.h
index d148fdf9f82..defda4e6841 100644
--- a/src/devices/video/huc6260.h
+++ b/src/devices/video/huc6260.h
@@ -13,16 +13,16 @@
#define MCFG_HUC6260_NEXT_PIXEL_DATA_CB(_devcb) \
- devcb = &huc6260_device::set_next_pixel_data_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6260_device &>(*device).set_next_pixel_data_callback(DEVCB_##_devcb);
#define MCFG_HUC6260_TIME_TIL_NEXT_EVENT_CB(_devcb) \
- devcb = &huc6260_device::set_time_til_next_event_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6260_device &>(*device).set_time_til_next_event_callback(DEVCB_##_devcb);
#define MCFG_HUC6260_VSYNC_CHANGED_CB(_devcb) \
- devcb = &huc6260_device::set_vsync_changed_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6260_device &>(*device).set_vsync_changed_callback(DEVCB_##_devcb);
#define MCFG_HUC6260_HSYNC_CHANGED_CB(_devcb) \
- devcb = &huc6260_device::set_hsync_changed_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6260_device &>(*device).set_hsync_changed_callback(DEVCB_##_devcb);
class huc6260_device : public device_t,
@@ -39,10 +39,10 @@ public:
// construction/destruction
huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_next_pixel_data_callback(device_t &device, Object &&cb) { return downcast<huc6260_device &>(device).m_next_pixel_data_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_time_til_next_event_callback(device_t &device, Object &&cb) { return downcast<huc6260_device &>(device).m_time_til_next_event_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vsync_changed_callback(device_t &device, Object &&cb) { return downcast<huc6260_device &>(device).m_vsync_changed_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_hsync_changed_callback(device_t &device, Object &&cb) { return downcast<huc6260_device &>(device).m_hsync_changed_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_next_pixel_data_callback(Object &&cb) { return m_next_pixel_data_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_time_til_next_event_callback(Object &&cb) { return m_time_til_next_event_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vsync_changed_callback(Object &&cb) { return m_vsync_changed_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_hsync_changed_callback(Object &&cb) { return m_hsync_changed_cb.set_callback(std::forward<Object>(cb)); }
void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_READ8_MEMBER( read );
diff --git a/src/devices/video/huc6261.h b/src/devices/video/huc6261.h
index 195c1e05127..99ad5e422d6 100644
--- a/src/devices/video/huc6261.h
+++ b/src/devices/video/huc6261.h
@@ -16,13 +16,13 @@
#define MCFG_HUC6261_VDC1(_tag) \
- huc6261_device::set_vdc1_tag(*device, _tag);
+ downcast<huc6261_device &>(*device).set_vdc1_tag(_tag);
#define MCFG_HUC6261_VDC2(_tag) \
- huc6261_device::set_vdc2_tag(*device, _tag);
+ downcast<huc6261_device &>(*device).set_vdc2_tag(_tag);
#define MCFG_HUC6261_KING(_tag) \
- huc6261_device::set_king_tag(*device, _tag);
+ downcast<huc6261_device &>(*device).set_king_tag(_tag);
class huc6261_device : public device_t,
@@ -36,9 +36,9 @@ public:
// construction/destruction
huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_vdc1_tag(device_t &device, const char *tag) { downcast<huc6261_device &>(device).m_huc6270_a_tag = tag; }
- static void set_vdc2_tag(device_t &device, const char *tag) { downcast<huc6261_device &>(device).m_huc6270_b_tag = tag; }
- static void set_king_tag(device_t &device, const char *tag) { downcast<huc6261_device &>(device).m_huc6272_tag = tag; }
+ void set_vdc1_tag(const char *tag) { m_huc6270_a_tag = tag; }
+ void set_vdc2_tag(const char *tag) { m_huc6270_b_tag = tag; }
+ void set_king_tag(const char *tag) { m_huc6272_tag = tag; }
void video_update(bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_READ16_MEMBER( read );
diff --git a/src/devices/video/huc6270.h b/src/devices/video/huc6270.h
index 5dfc16aa804..5d933129bba 100644
--- a/src/devices/video/huc6270.h
+++ b/src/devices/video/huc6270.h
@@ -13,10 +13,10 @@
#define MCFG_HUC6270_VRAM_SIZE(_size) \
- huc6270_device::set_vram_size(*device, _size);
+ downcast<huc6270_device &>(*device).set_vram_size(_size);
#define MCFG_HUC6270_IRQ_CHANGED_CB(_devcb) \
- devcb = &huc6270_device::set_irq_changed_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<huc6270_device &>(*device).set_irq_changed_callback(DEVCB_##_devcb);
class huc6270_device : public device_t
{
@@ -24,8 +24,8 @@ public:
// construction/destruction
huc6270_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_vram_size(device_t &device, uint32_t vram_size) { downcast<huc6270_device &>(device).m_vram_size = vram_size; }
- template <class Object> static devcb_base &set_irq_changed_callback(device_t &device, Object &&cb) { return downcast<huc6270_device &>(device).m_irq_changed_cb.set_callback(std::forward<Object>(cb)); }
+ void set_vram_size(uint32_t vram_size) { m_vram_size = vram_size; }
+ template <class Object> devcb_base &set_irq_changed_callback(Object &&cb) { return m_irq_changed_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/video/huc6272.h b/src/devices/video/huc6272.h
index d0da9f1e953..1793ec11821 100644
--- a/src/devices/video/huc6272.h
+++ b/src/devices/video/huc6272.h
@@ -24,10 +24,10 @@
MCFG_DEVICE_ADD((tag), HUC6272, (freq))
#define MCFG_HUC6272_IRQ_CHANGED_CB(cb) \
- devcb = &huc6272_device::set_irq_changed_callback(*device, (DEVCB_##cb));
+ devcb = &downcast<huc6272_device &>(*device).set_irq_changed_callback((DEVCB_##cb));
#define MCFG_HUC6272_RAINBOW(tag) \
- huc6272_device::set_rainbow_tag(*device, (tag));
+ downcast<huc6272_device &>(*device).set_rainbow_tag((tag));
//**************************************************************************
@@ -43,8 +43,8 @@ public:
// construction/destruction
huc6272_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_irq_changed_callback(device_t &device, Object &&cb) { return downcast<huc6272_device &>(device).m_irq_changed_cb.set_callback(std::forward<Object>(cb)); }
- static void set_rainbow_tag(device_t &device, const char *tag) { downcast<huc6272_device &>(device).m_huc6271_tag = tag; }
+ template <class Object> devcb_base &set_irq_changed_callback(Object &&cb) { return m_irq_changed_cb.set_callback(std::forward<Object>(cb)); }
+ void set_rainbow_tag(const char *tag) { m_huc6271_tag = tag; }
// I/O operations
DECLARE_WRITE32_MEMBER( write );
diff --git a/src/devices/video/i8244.h b/src/devices/video/i8244.h
index 543712883e3..44260b7ecf3 100644
--- a/src/devices/video/i8244.h
+++ b/src/devices/video/i8244.h
@@ -25,9 +25,9 @@
MCFG_I8244_IRQ_CB(_irq_cb) \
MCFG_I8244_POSTPROCESS_CB(_postprocess_cb)
#define MCFG_I8244_IRQ_CB(_devcb) \
- devcb = &i8244_device::set_irq_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<i8244_device &>(*device).set_irq_cb(DEVCB_##_devcb);
#define MCFG_I8244_POSTPROCESS_CB(_devcb) \
- devcb = &i8244_device::set_postprocess_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<i8244_device &>(*device).set_postprocess_cb(DEVCB_##_devcb);
#define MCFG_I8245_ADD(_tag, _clock, _screen_tag, _irq_cb, _postprocess_cb) \
MCFG_DEVICE_ADD(_tag, I8245, _clock) \
MCFG_VIDEO_SET_SCREEN(_screen_tag) \
@@ -49,9 +49,9 @@ public:
// construction/destruction
i8244_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- template <class Object> static devcb_base &set_irq_cb(device_t &device, Object &&cb) { return downcast<i8244_device &>(device).m_irq_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_postprocess_cb(device_t &device, Object &&cb) { return downcast<i8244_device &>(device).m_postprocess_func.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ template <class Object> devcb_base &set_irq_cb(Object &&cb) { return m_irq_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_postprocess_cb(Object &&cb) { return m_postprocess_func.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
diff --git a/src/devices/video/i82730.cpp b/src/devices/video/i82730.cpp
index c43e02555a7..48f95b29220 100644
--- a/src/devices/video/i82730.cpp
+++ b/src/devices/video/i82730.cpp
@@ -73,16 +73,6 @@ i82730_device::i82730_device(const machine_config &mconfig, const char *tag, dev
}
//-------------------------------------------------
-// set_cpu_tag - set cpu we are attached to
-//-------------------------------------------------
-
-void i82730_device::set_cpu_tag(device_t &device, device_t *owner, const char *tag)
-{
- i82730_device &dev = dynamic_cast<i82730_device &>(device);
- dev.m_cpu_tag = tag;
-}
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/video/i82730.h b/src/devices/video/i82730.h
index 38319d9b3c4..033bd6dc79f 100644
--- a/src/devices/video/i82730.h
+++ b/src/devices/video/i82730.h
@@ -21,13 +21,13 @@
#define MCFG_I82730_ADD(_tag, _cpu_tag, _clock) \
MCFG_DEVICE_ADD(_tag, I82730, _clock) \
- i82730_device::set_cpu_tag(*device, this, _cpu_tag);
+ downcast<i82730_device &>(*device).set_cpu_tag(_cpu_tag);
#define MCFG_I82730_SINT_HANDLER(_devcb) \
- devcb = &i82730_device::set_sint_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<i82730_device &>(*device).set_sint_handler(DEVCB_##_devcb);
#define MCFG_I82730_UPDATE_ROW_CB(_class, _method) \
- i82730_device::set_update_row_callback(*device, i82730_device::update_row_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<i82730_device &>(*device).set_update_row_callback(i82730_device::update_row_delegate(&_class::_method, #_class "::" #_method, this));
//**************************************************************************
@@ -49,12 +49,11 @@ public:
i82730_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// callbacks
- template <class Object> static devcb_base &set_sint_handler(device_t &device, Object &&cb)
- { return downcast<i82730_device &>(device).m_sint_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sint_handler(Object &&cb) { return m_sint_handler.set_callback(std::forward<Object>(cb)); }
// inline configuration
- static void set_cpu_tag(device_t &device, device_t *owner, const char *tag);
- static void set_update_row_callback(device_t &device, update_row_delegate &&cb) { downcast<i82730_device &>(device).m_update_row_cb = std::move(cb); }
+ void set_cpu_tag(const char *tag) { m_cpu_tag = tag; }
+ template <typename Object> void set_update_row_callback(Object &&cb) { m_update_row_cb = std::forward<Object>(cb); }
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
diff --git a/src/devices/video/i8275.h b/src/devices/video/i8275.h
index d1b30fdfeb8..bf4dc21206f 100644
--- a/src/devices/video/i8275.h
+++ b/src/devices/video/i8275.h
@@ -45,22 +45,22 @@
#define MCFG_I8275_CHARACTER_WIDTH(_value) \
- i8275_device::static_set_character_width(*device, _value);
+ downcast<i8275_device &>(*device).set_character_width(_value);
#define MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(_class, _method) \
- i8275_device::static_set_display_callback(*device, i8275_device::draw_character_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<i8275_device &>(*device).set_display_callback(i8275_device::draw_character_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_I8275_DRQ_CALLBACK(_write) \
- devcb = &i8275_device::set_drq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<i8275_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
#define MCFG_I8275_IRQ_CALLBACK(_write) \
- devcb = &i8275_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<i8275_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_I8275_HRTC_CALLBACK(_write) \
- devcb = &i8275_device::set_hrtc_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<i8275_device &>(*device).set_hrtc_wr_callback(DEVCB_##_write);
#define MCFG_I8275_VRTC_CALLBACK(_write) \
- devcb = &i8275_device::set_vrtc_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<i8275_device &>(*device).set_vrtc_wr_callback(DEVCB_##_write);
@@ -80,13 +80,13 @@ public:
// construction/destruction
i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_character_width(device_t &device, int value) { downcast<i8275_device &>(device).m_hpixels_per_column = value; }
- static void static_set_display_callback(device_t &device, draw_character_delegate &&cb) { downcast<i8275_device &>(device).m_display_cb = std::move(cb); }
+ void set_character_width(int value) { m_hpixels_per_column = value; }
+ template <typename Object> void set_display_callback(Object &&cb) { m_display_cb = std::forward<Object>(cb); }
- template <class Object> static devcb_base &set_drq_wr_callback(device_t &device, Object &&cb) { return downcast<i8275_device &>(device).m_write_drq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<i8275_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_hrtc_wr_callback(device_t &device, Object &&cb) { return downcast<i8275_device &>(device).m_write_hrtc.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vrtc_wr_callback(device_t &device, Object &&cb) { return downcast<i8275_device &>(device).m_write_vrtc.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_drq_wr_callback(Object &&cb) { return m_write_drq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_hrtc_wr_callback(Object &&cb) { return m_write_hrtc.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vrtc_wr_callback(Object &&cb) { return m_write_vrtc.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/video/imagetek_i4100.cpp b/src/devices/video/imagetek_i4100.cpp
index 567d316fa78..18695df1d82 100644
--- a/src/devices/video/imagetek_i4100.cpp
+++ b/src/devices/video/imagetek_i4100.cpp
@@ -253,33 +253,6 @@ MACHINE_CONFIG_END
//-------------------------------------------------
-// static_set_gfxdecode_tag: Set the tag of the
-// gfx decoder
-//-------------------------------------------------
-
-void imagetek_i4100_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
-{
- downcast<imagetek_i4100_device &>(device).m_gfxdecode.set_tag(tag);
-}
-
-
-void imagetek_i4100_device::static_set_tmap_xoffsets(device_t &device, int x1, int x2, int x3)
-{
- downcast<imagetek_i4100_device &>(device).m_tilemap_scrolldx[0] = x1;
- downcast<imagetek_i4100_device &>(device).m_tilemap_scrolldx[1] = x2;
- downcast<imagetek_i4100_device &>(device).m_tilemap_scrolldx[2] = x3;
-}
-
-
-void imagetek_i4100_device::static_set_tmap_yoffsets(device_t &device, int y1, int y2, int y3)
-{
- downcast<imagetek_i4100_device &>(device).m_tilemap_scrolldy[0] = y1;
- downcast<imagetek_i4100_device &>(device).m_tilemap_scrolldy[1] = y2;
- downcast<imagetek_i4100_device &>(device).m_tilemap_scrolldy[2] = y3;
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/video/imagetek_i4100.h b/src/devices/video/imagetek_i4100.h
index 7abfb1d66b7..e09efb8ebb1 100644
--- a/src/devices/video/imagetek_i4100.h
+++ b/src/devices/video/imagetek_i4100.h
@@ -19,16 +19,16 @@
//**************************************************************************
#define MCFG_I4100_GFXDECODE(gfxtag) \
- imagetek_i4100_device::static_set_gfxdecode_tag(*device, ("^" gfxtag));
+ downcast<imagetek_i4100_device &>(*device).set_gfxdecode_tag(("^" gfxtag));
#define MCFG_I4100_BLITTER_END_CALLBACK(_devcb) \
- devcb = &imagetek_i4100_device::static_set_blitter_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<imagetek_i4100_device &>(*device).set_blitter_irq_callback(DEVCB_##_devcb);
#define MCFG_I4100_TILEMAP_XOFFSETS(_a, _b, _c) \
- imagetek_i4100_device::static_set_tmap_xoffsets(*device, _a, _b, _c);
+ downcast<imagetek_i4100_device &>(*device).set_tmap_xoffsets(_a, _b, _c);
#define MCFG_I4100_TILEMAP_YOFFSETS(_a, _b, _c) \
- imagetek_i4100_device::static_set_tmap_yoffsets(*device, _a, _b, _c);
+ downcast<imagetek_i4100_device &>(*device).set_tmap_yoffsets(_a, _b, _c);
//**************************************************************************
@@ -46,11 +46,11 @@ public:
void map(address_map &map);
- static void static_set_gfxdecode_tag(device_t &device, const char *tag);
- static void static_set_tmap_xoffsets(device_t &device, int x1, int x2, int x3);
- static void static_set_tmap_yoffsets(device_t &device, int y1, int y2, int y3);
+ void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); }
+ void set_tmap_xoffsets(int x1, int x2, int x3) { m_tilemap_scrolldx[0] = x1; m_tilemap_scrolldx[1] = x2; m_tilemap_scrolldx[2] = x3; }
+ void set_tmap_yoffsets(int y1, int y2, int y3) { m_tilemap_scrolldy[0] = y1; m_tilemap_scrolldy[1] = y2; m_tilemap_scrolldy[2] = y3; }
- template <class Object> static devcb_base &static_set_blitter_irq_callback(device_t &device, Object &&cb) { return downcast<imagetek_i4100_device &>(device).m_blit_irq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_blitter_irq_callback(Object &&cb) { return m_blit_irq_cb.set_callback(std::forward<Object>(cb)); }
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
diff --git a/src/devices/video/mb_vcu.cpp b/src/devices/video/mb_vcu.cpp
index edbef283be4..2593bb30b2b 100644
--- a/src/devices/video/mb_vcu.cpp
+++ b/src/devices/video/mb_vcu.cpp
@@ -35,16 +35,6 @@ TODO:
// device type definition
DEFINE_DEVICE_TYPE(MB_VCU, mb_vcu_device, "mb_vcu", "Mazer Blazer custom VCU")
-//-------------------------------------------------
-// static_set_palette_tag: Set the tag of the
-// palette device
-//-------------------------------------------------
-
-void mb_vcu_device::static_set_palette_tag(device_t &device, const char *tag)
-{
- downcast<mb_vcu_device &>(device).m_palette.set_tag(tag);
-}
-
ADDRESS_MAP_START(mb_vcu_device::mb_vcu_vram)
AM_RANGE(0x00000,0x7ffff) AM_RAM // enough for a 256x256x4 x 2 pages of framebuffer with 4 layers (TODO: doubled for simplicity)
diff --git a/src/devices/video/mb_vcu.h b/src/devices/video/mb_vcu.h
index 86ebcc883bf..c6e1d7b30f9 100644
--- a/src/devices/video/mb_vcu.h
+++ b/src/devices/video/mb_vcu.h
@@ -20,9 +20,9 @@ public:
// construction/destruction
mb_vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration
- static void static_set_palette_tag(device_t &device, const char *tag);
- static void set_cpu_tag(device_t &device, const char *tag) { downcast<mb_vcu_device &>(device).m_cpu.set_tag(tag); }
+ // configuration
+ void set_palette_tag(const char *tag) { m_palette.set_tag(tag); }
+ void set_cpu_tag(const char *tag) { m_cpu.set_tag(tag); }
// I/O operations
DECLARE_WRITE8_MEMBER( write_vregs );
@@ -90,9 +90,9 @@ DECLARE_DEVICE_TYPE(MB_VCU, mb_vcu_device)
//**************************************************************************
#define MCFG_MB_VCU_CPU(_tag) \
- mb_vcu_device::set_cpu_tag(*device, "^" _tag);
+ downcast<mb_vcu_device &>(*device).set_cpu_tag("^" _tag);
#define MCFG_MB_VCU_PALETTE(_palette_tag) \
- mb_vcu_device::static_set_palette_tag(*device, "^" _palette_tag);
+ downcast<mb_vcu_device &>(*device).set_palette_tag("^" _palette_tag);
#endif // MAME_VIDEO_MB_VCU_H
diff --git a/src/devices/video/mc6845.h b/src/devices/video/mc6845.h
index 6fb43b8eb7a..fbcb9ad4f13 100644
--- a/src/devices/video/mc6845.h
+++ b/src/devices/video/mc6845.h
@@ -28,40 +28,40 @@
#define MCFG_MC6845_SHOW_BORDER_AREA(_show) \
- mc6845_device::set_show_border_area(*device, _show);
+ downcast<mc6845_device &>(*device).set_show_border_area(_show);
#define MCFG_MC6845_VISAREA_ADJUST(_minx, _maxx, _miny, _maxy) \
- mc6845_device::set_visarea_adjust(*device, _minx, _maxx, _miny, _maxy);
+ downcast<mc6845_device &>(*device).set_visarea_adjust(_minx, _maxx, _miny, _maxy);
#define MCFG_MC6845_CHAR_WIDTH(_pixels) \
- mc6845_device::set_char_width(*device, _pixels);
+ downcast<mc6845_device &>(*device).set_char_width(_pixels);
#define MCFG_MC6845_RECONFIGURE_CB(_class, _method) \
- mc6845_device::set_reconfigure_callback(*device, mc6845_device::reconfigure_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<mc6845_device &>(*device).set_reconfigure_callback(mc6845_device::reconfigure_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_MC6845_BEGIN_UPDATE_CB(_class, _method) \
- mc6845_device::set_begin_update_callback(*device, mc6845_device::begin_update_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<mc6845_device &>(*device).set_begin_update_callback(mc6845_device::begin_update_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_MC6845_UPDATE_ROW_CB(_class, _method) \
- mc6845_device::set_update_row_callback(*device, mc6845_device::update_row_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<mc6845_device &>(*device).set_update_row_callback(mc6845_device::update_row_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_MC6845_END_UPDATE_CB(_class, _method) \
- mc6845_device::set_end_update_callback(*device, mc6845_device::end_update_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<mc6845_device &>(*device).set_end_update_callback(mc6845_device::end_update_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_MC6845_ADDR_CHANGED_CB(_class, _method) \
- mc6845_device::set_on_update_addr_change_callback(*device, mc6845_device::on_update_addr_changed_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<mc6845_device &>(*device).set_on_update_addr_change_callback(mc6845_device::on_update_addr_changed_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_MC6845_OUT_DE_CB(_write) \
- devcb = &mc6845_device::set_out_de_callback(*device, DEVCB_##_write);
+ devcb = &downcast<mc6845_device &>(*device).set_out_de_callback(DEVCB_##_write);
#define MCFG_MC6845_OUT_CUR_CB(_write) \
- devcb = &mc6845_device::set_out_cur_callback(*device, DEVCB_##_write);
+ devcb = &downcast<mc6845_device &>(*device).set_out_cur_callback(DEVCB_##_write);
#define MCFG_MC6845_OUT_HSYNC_CB(_write) \
- devcb = &mc6845_device::set_out_hsync_callback(*device, DEVCB_##_write);
+ devcb = &downcast<mc6845_device &>(*device).set_out_hsync_callback(DEVCB_##_write);
#define MCFG_MC6845_OUT_VSYNC_CB(_write) \
- devcb = &mc6845_device::set_out_vsync_callback(*device, DEVCB_##_write);
+ devcb = &downcast<mc6845_device &>(*device).set_out_vsync_callback(DEVCB_##_write);
/* callback definitions */
@@ -91,27 +91,26 @@ public:
// construction/destruction
mc6845_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_show_border_area(device_t &device, bool show) { downcast<mc6845_device &>(device).m_show_border_area = show; }
- static void set_visarea_adjust(device_t &device, int min_x, int max_x, int min_y, int max_y)
+ void set_show_border_area(bool show) { m_show_border_area = show; }
+ void set_visarea_adjust(int min_x, int max_x, int min_y, int max_y)
{
- mc6845_device &dev = downcast<mc6845_device &>(device);
- dev.m_visarea_adjust_min_x = min_x;
- dev.m_visarea_adjust_max_x = max_x;
- dev.m_visarea_adjust_min_y = min_y;
- dev.m_visarea_adjust_max_y = max_y;
+ m_visarea_adjust_min_x = min_x;
+ m_visarea_adjust_max_x = max_x;
+ m_visarea_adjust_min_y = min_y;
+ m_visarea_adjust_max_y = max_y;
}
- static void set_char_width(device_t &device, int pixels) { downcast<mc6845_device &>(device).m_hpixels_per_column = pixels; }
-
- static void set_reconfigure_callback(device_t &device, reconfigure_delegate &&cb) { downcast<mc6845_device &>(device).m_reconfigure_cb = std::move(cb); }
- static void set_begin_update_callback(device_t &device, begin_update_delegate &&cb) { downcast<mc6845_device &>(device).m_begin_update_cb = std::move(cb); }
- static void set_update_row_callback(device_t &device, update_row_delegate &&cb) { downcast<mc6845_device &>(device).m_update_row_cb = std::move(cb); }
- static void set_end_update_callback(device_t &device, end_update_delegate &&cb) { downcast<mc6845_device &>(device).m_end_update_cb = std::move(cb); }
- static void set_on_update_addr_change_callback(device_t &device, on_update_addr_changed_delegate &&cb) { downcast<mc6845_device &>(device).m_on_update_addr_changed_cb = std::move(cb); }
-
- template <class Object> static devcb_base &set_out_de_callback(device_t &device, Object &&cb) { return downcast<mc6845_device &>(device).m_out_de_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_cur_callback(device_t &device, Object &&cb) { return downcast<mc6845_device &>(device).m_out_cur_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_hsync_callback(device_t &device, Object &&cb) { return downcast<mc6845_device &>(device).m_out_hsync_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_vsync_callback(device_t &device, Object &&cb) { return downcast<mc6845_device &>(device).m_out_vsync_cb.set_callback(std::forward<Object>(cb)); }
+ void set_char_width(int pixels) { m_hpixels_per_column = pixels; }
+
+ template <typename Object> void set_reconfigure_callback(Object &&cb) { m_reconfigure_cb = std::forward<Object>(cb); }
+ template <typename Object> void set_begin_update_callback(Object &&cb) { m_begin_update_cb = std::forward<Object>(cb); }
+ template <typename Object> void set_update_row_callback(Object &&cb) { m_update_row_cb = std::forward<Object>(cb); }
+ template <typename Object> void set_end_update_callback(Object &&cb) { m_end_update_cb = std::forward<Object>(cb); }
+ template <typename Object> void set_on_update_addr_change_callback(Object &&cb) { m_on_update_addr_changed_cb = std::forward<Object>(cb); }
+
+ template <class Object> devcb_base &set_out_de_callback(Object &&cb) { return m_out_de_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_cur_callback(Object &&cb) { return m_out_cur_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_hsync_callback(Object &&cb) { return m_out_hsync_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_vsync_callback(Object &&cb) { return m_out_vsync_cb.set_callback(std::forward<Object>(cb)); }
/* select one of the registers for reading or writing */
DECLARE_WRITE8_MEMBER( address_w );
diff --git a/src/devices/video/mc6847.h b/src/devices/video/mc6847.h
index 1d1c086012f..9bb56d9dc2a 100644
--- a/src/devices/video/mc6847.h
+++ b/src/devices/video/mc6847.h
@@ -36,22 +36,22 @@
MCFG_SCREEN_VBLANK_TIME(0)
#define MCFG_MC6847_HSYNC_CALLBACK(_write) \
- devcb = &mc6847_friend_device::set_hsync_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<mc6847_friend_device &>(*device).set_hsync_wr_callback(DEVCB_##_write);
#define MCFG_MC6847_FSYNC_CALLBACK(_write) \
- devcb = &mc6847_friend_device::set_fsync_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<mc6847_friend_device &>(*device).set_fsync_wr_callback(DEVCB_##_write);
#define MCFG_MC6847_CHARROM_CALLBACK(_class, _method) \
- mc6847_friend_device::set_get_char_rom(*device, mc6847_friend_device::get_char_rom_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<mc6847_friend_device &>(*device).set_get_char_rom(mc6847_friend_device::get_char_rom_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_MC6847_INPUT_CALLBACK(_read) \
- devcb = &mc6847_base_device::set_input_callback(*device, DEVCB_##_read);
+ devcb = &downcast<mc6847_base_device &>(*device).set_input_callback(DEVCB_##_read);
#define MCFG_MC6847_FIXED_MODE(_mode) \
- mc6847_base_device::set_get_fixed_mode(*device, _mode);
+ downcast<mc6847_base_device &>(*device).set_get_fixed_mode(_mode);
#define MCFG_MC6847_BW(_bw) \
- mc6847_base_device::set_black_and_white(*device, _bw);
+ downcast<mc6847_base_device &>(*device).set_black_and_white(_bw);
#define MC6847_GET_CHARROM_MEMBER(_name) uint8_t _name(uint8_t ch, int line)
@@ -86,10 +86,10 @@ public:
bool hs_r() const { return m_horizontal_sync; }
bool fs_r() const { return m_field_sync; }
- template <class Object> static devcb_base &set_hsync_wr_callback(device_t &device, Object &&cb) { return downcast<mc6847_friend_device &>(device).m_write_hsync.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_fsync_wr_callback(device_t &device, Object &&cb) { return downcast<mc6847_friend_device &>(device).m_write_fsync.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_hsync_wr_callback(Object &&cb) { return m_write_hsync.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_fsync_wr_callback(Object &&cb) { return m_write_fsync.set_callback(std::forward<Object>(cb)); }
- static void set_get_char_rom(device_t &device, get_char_rom_delegate &&cb) { downcast<mc6847_friend_device &>(device).m_charrom_cb = std::move(cb); }
+ template <typename Object> void set_get_char_rom(Object &&cb) { m_charrom_cb = std::forward<Object>(cb); }
protected:
mc6847_friend_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock,
@@ -511,10 +511,10 @@ private:
class mc6847_base_device : public mc6847_friend_device
{
public:
- template <class Object> static devcb_base &set_input_callback(device_t &device, Object &&cb) { return downcast<mc6847_base_device &>(device).m_input_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_input_callback(Object &&cb) { return m_input_cb.set_callback(std::forward<Object>(cb)); }
- static void set_get_fixed_mode(device_t &device, uint8_t mode) { downcast<mc6847_base_device &>(device).m_fixed_mode = mode; }
- static void set_black_and_white(device_t &device, bool bw) { downcast<mc6847_base_device &>(device).m_black_and_white = bw; }
+ void set_get_fixed_mode(uint8_t mode) { m_fixed_mode = mode; }
+ void set_black_and_white(bool bw) { m_black_and_white = bw; }
/* updates the screen -- this will call begin_update(),
followed by update_row() repeatedly and after all row
diff --git a/src/devices/video/mos6566.h b/src/devices/video/mos6566.h
index 2b0e6fd0d62..94ab067a425 100644
--- a/src/devices/video/mos6566.h
+++ b/src/devices/video/mos6566.h
@@ -90,19 +90,19 @@
//***************************************************************************
#define MCFG_MOS6566_CPU(_tag) \
- mos6566_device::static_set_cpu_tag(*device, "^" _tag);
+ downcast<mos6566_device &>(*device).set_cpu_tag("^" _tag);
#define MCFG_MOS6566_IRQ_CALLBACK(_write) \
- devcb = &mos6566_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<mos6566_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_MOS6566_BA_CALLBACK(_write) \
- devcb = &mos6566_device::set_ba_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<mos6566_device &>(*device).set_ba_wr_callback(DEVCB_##_write);
#define MCFG_MOS6566_AEC_CALLBACK(_write) \
- devcb = &mos6566_device::set_aec_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<mos6566_device &>(*device).set_aec_wr_callback(DEVCB_##_write);
#define MCFG_MOS8564_K_CALLBACK(_write) \
- devcb = &mos6566_device::set_k_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<mos6566_device &>(*device).set_k_wr_callback(DEVCB_##_write);
@@ -212,11 +212,11 @@ public:
// construction/destruction
mos6566_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_cpu_tag(device_t &device, const char *tag) { downcast<mos6566_device &>(device).m_cpu.set_tag(tag); }
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<mos6566_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ba_wr_callback(device_t &device, Object &&cb) { return downcast<mos6566_device &>(device).m_write_ba.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_aec_wr_callback(device_t &device, Object &&cb) { return downcast<mos6566_device &>(device).m_write_aec.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_k_wr_callback(device_t &device, Object &&cb) { return downcast<mos6566_device &>(device).m_write_k.set_callback(std::forward<Object>(cb)); }
+ void set_cpu_tag(const char *tag) { m_cpu.set_tag(tag); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ba_wr_callback(Object &&cb) { return m_write_ba.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_aec_wr_callback(Object &&cb) { return m_write_aec.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_k_wr_callback(Object &&cb) { return m_write_k.set_callback(std::forward<Object>(cb)); }
virtual space_config_vector memory_space_config() const override;
diff --git a/src/devices/video/nt7534.h b/src/devices/video/nt7534.h
index f281be2c15e..210ca50552c 100644
--- a/src/devices/video/nt7534.h
+++ b/src/devices/video/nt7534.h
@@ -16,7 +16,7 @@
MCFG_DEVICE_ADD( _tag, NT7534, 0 )
#define MCFG_NT7534_PIXEL_UPDATE_CB(_class, _method) \
- nt7534_device::static_set_pixel_update_cb(*device, nt7534_device::pixel_update_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<nt7534_device &>(*device).set_pixel_update_cb(nt7534_device::pixel_update_delegate(&_class::_method, #_class "::" #_method, this));
//**************************************************************************
// TYPE DEFINITIONS
@@ -35,7 +35,7 @@ public:
// construction/destruction
nt7534_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_pixel_update_cb(device_t &device, pixel_update_delegate &&cb) { downcast<nt7534_device &>(device).m_pixel_update_cb = std::move(cb); }
+ template <typename Object> void set_pixel_update_cb(Object &&cb) { m_pixel_update_cb = std::forward<Object>(cb); }
// device interface
virtual DECLARE_WRITE8_MEMBER(write);
diff --git a/src/devices/video/pcd8544.h b/src/devices/video/pcd8544.h
index 850e9996df1..fee6fad00d8 100644
--- a/src/devices/video/pcd8544.h
+++ b/src/devices/video/pcd8544.h
@@ -22,7 +22,7 @@
MCFG_DEVICE_ADD( _tag, PCD8544, 0 )
#define MCFG_PCD8544_SCREEN_UPDATE_CALLBACK(_class, _method) \
- pcd8544_device::static_set_screen_update_cb(*device, pcd8544_device::screen_update_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<pcd8544_device &>(*device).set_screen_update_cb(pcd8544_device::screen_update_delegate(&_class::_method, #_class "::" #_method, this));
// ======================> pcd8544_device
@@ -34,7 +34,7 @@ public:
// construction/destruction
pcd8544_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_screen_update_cb(device_t &device, screen_update_delegate &&cb) { downcast<pcd8544_device &>(device).m_screen_update_cb = std::move(cb); }
+ template <typename Object> void set_screen_update_cb(Object &&cb) { m_screen_update_cb = std::forward<Object>(cb); }
// device interface
DECLARE_WRITE_LINE_MEMBER(sdin_w);
diff --git a/src/devices/video/ppu2c0x.cpp b/src/devices/video/ppu2c0x.cpp
index 21313029b65..09b25358eba 100644
--- a/src/devices/video/ppu2c0x.cpp
+++ b/src/devices/video/ppu2c0x.cpp
@@ -106,12 +106,6 @@ device_memory_interface::space_config_vector ppu2c0x_device::memory_space_config
}
-// static
-void ppu2c0x_device::set_nmi_delegate(device_t &device, nmi_delegate &&cb)
-{
- ppu2c0x_device &dev = downcast<ppu2c0x_device &>(device);
- dev.m_nmi_callback_proc = std::move(cb);
-}
//-------------------------------------------------
// ppu2c0x_device - constructor
//-------------------------------------------------
diff --git a/src/devices/video/ppu2c0x.h b/src/devices/video/ppu2c0x.h
index 7d425c5ef34..95c929ccdab 100644
--- a/src/devices/video/ppu2c0x.h
+++ b/src/devices/video/ppu2c0x.h
@@ -59,16 +59,16 @@
#define MCFG_PPU2C0X_SET_SCREEN MCFG_VIDEO_SET_SCREEN
#define MCFG_PPU2C0X_CPU(_tag) \
- ppu2c0x_device::set_cpu_tag(*device, "^" _tag);
+ downcast<ppu2c0x_device &>(*device).set_cpu_tag("^" _tag);
#define MCFG_PPU2C0X_COLORBASE(_color) \
- ppu2c0x_device::set_color_base(*device, _color);
+ downcast<ppu2c0x_device &>(*device).set_color_base(_color);
#define MCFG_PPU2C0X_SET_NMI(_class, _method) \
- ppu2c0x_device::set_nmi_delegate(*device, ppu2c0x_device::nmi_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
+ downcast<ppu2c0x_device &>(*device).set_nmi_delegate(ppu2c0x_device::nmi_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
#define MCFG_PPU2C0X_IGNORE_SPRITE_WRITE_LIMIT \
- ppu2c0x_device::use_sprite_write_limitation_disable(*device);
+ downcast<ppu2c0x_device &>(*device).use_sprite_write_limitation_disable();
///*************************************************************************
// TYPE DEFINITIONS
@@ -107,9 +107,9 @@ public:
virtual DECLARE_READ8_MEMBER( palette_read );
virtual DECLARE_WRITE8_MEMBER( palette_write );
- static void set_cpu_tag(device_t &device, const char *tag) { downcast<ppu2c0x_device &>(device).m_cpu.set_tag(tag); }
- static void set_color_base(device_t &device, int colorbase) { downcast<ppu2c0x_device &>(device).m_color_base = colorbase; }
- static void set_nmi_delegate(device_t &device, nmi_delegate &&cb);
+ void set_cpu_tag(const char *tag) { m_cpu.set_tag(tag); }
+ void set_color_base(int colorbase) { m_color_base = colorbase; }
+ template <typename Object> void set_nmi_delegate(Object &&cb) { m_nmi_callback_proc = std::forward<Object>(cb); }
/* routines */
virtual void init_palette(palette_device &palette, int first_entry);
@@ -153,11 +153,7 @@ public:
// void update_screen(bitmap_t &bitmap, const rectangle &cliprect);
// some bootleg / clone hardware appears to ignore this
- static void use_sprite_write_limitation_disable(device_t &device)
- {
- ppu2c0x_device &dev = downcast<ppu2c0x_device &>(device);
- dev.m_use_sprite_write_limitation = false;
- }
+ void use_sprite_write_limitation_disable() { m_use_sprite_write_limitation = false; }
uint16_t get_vram_dest();
void set_vram_dest(uint16_t dest);
diff --git a/src/devices/video/ppu2c0x_vt.h b/src/devices/video/ppu2c0x_vt.h
index 480ab6cd210..b7a8c68be86 100644
--- a/src/devices/video/ppu2c0x_vt.h
+++ b/src/devices/video/ppu2c0x_vt.h
@@ -20,18 +20,18 @@
MCFG_PPU2C0X_ADD(_tag, PPU_VT03)
#define MCFG_PPU_VT03_READ_BG_CB(_devcb) \
- devcb = &ppu_vt03_device::set_read_bg_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<ppu_vt03_device &>(*device).set_read_bg_callback(DEVCB_##_devcb);
#define MCFG_PPU_VT03_READ_SP_CB(_devcb) \
- devcb = &ppu_vt03_device::set_read_sp_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<ppu_vt03_device &>(*device).set_read_sp_callback(DEVCB_##_devcb);
#define MCFG_PPU_VT03_MODIFY MCFG_DEVICE_MODIFY
#define MCFG_PPU_VT03_SET_PAL_MODE(pmode) \
- ppu_vt03_device::set_palette_mode(*device, pmode);
+ downcast<ppu_vt03_device &>(*device).set_palette_mode(pmode);
#define MCFG_PPU_VT03_SET_DESCRAMBLE(dsc) \
- ppu_vt03_device::set_201x_descramble(*device, dsc);
+ downcast<ppu_vt03_device &>(*device).set_201x_descramble(dsc);
enum vtxx_pal_mode {
@@ -45,11 +45,11 @@ class ppu_vt03_device : public ppu2c0x_device {
public:
ppu_vt03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_read_bg_callback(device_t &device, Object &&cb) { return downcast<ppu_vt03_device &>(device).m_read_bg.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_sp_callback(device_t &device, Object &&cb) { return downcast<ppu_vt03_device &>(device).m_read_sp.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_bg_callback(Object &&cb) { return m_read_bg.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_sp_callback(Object &&cb) { return m_read_sp.set_callback(std::forward<Object>(cb)); }
- static void set_palette_mode(device_t &device, vtxx_pal_mode pmode) { downcast<ppu_vt03_device &>(device).m_pal_mode = pmode; }
- static void set_201x_descramble(device_t &device, const uint8_t descramble[6]) { for (int i = 0; i < 6; i++) downcast<ppu_vt03_device &>(device).m_2012_2017_descramble[i] = descramble[i]; }
+ void set_palette_mode(vtxx_pal_mode pmode) { m_pal_mode = pmode; }
+ void set_201x_descramble(const uint8_t descramble[6]) { for (int i = 0; i < 6; i++) m_2012_2017_descramble[i] = descramble[i]; }
virtual DECLARE_READ8_MEMBER(read) override;
virtual DECLARE_WRITE8_MEMBER(write) override;
diff --git a/src/devices/video/psx.h b/src/devices/video/psx.h
index 56514813c0e..99eb6575ee4 100644
--- a/src/devices/video/psx.h
+++ b/src/devices/video/psx.h
@@ -16,14 +16,14 @@
#define MCFG_PSX_GPU_VBLANK_HANDLER(_devcb) \
- devcb = &psxgpu_device::set_vblank_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<psxgpu_device &>(*device).set_vblank_handler(DEVCB_##_devcb);
#define MCFG_PSXGPU_ADD( cputag, tag, type, _vramSize, clock ) \
MCFG_DEVICE_MODIFY( cputag ) \
MCFG_PSX_GPU_READ_HANDLER(DEVREAD32(tag, psxgpu_device, read)) \
MCFG_PSX_GPU_WRITE_HANDLER(DEVWRITE32(tag, psxgpu_device, write)) \
MCFG_DEVICE_ADD( tag, type, clock ) \
- psxgpu_device::set_vram_size(*device, _vramSize); \
+ downcast<psxgpu_device &>(*device).set_vram_size(_vramSize); \
MCFG_PSX_GPU_VBLANK_HANDLER(DEVWRITELINE(cputag ":irq", psxirq_device, intin0)) \
MCFG_PSX_DMA_CHANNEL_READ( cputag, 2, psxdma_device::write_delegate(&psxgpu_device::dma_read, (psxgpu_device *) device ) ) \
MCFG_PSX_DMA_CHANNEL_WRITE( cputag, 2, psxdma_device::read_delegate(&psxgpu_device::dma_write, (psxgpu_device *) device ) )
@@ -33,7 +33,7 @@
MCFG_PSX_GPU_READ_HANDLER(DEVREAD32(tag, psxgpu_device, read)) \
MCFG_PSX_GPU_WRITE_HANDLER(DEVWRITE32(tag, psxgpu_device, write)) \
MCFG_DEVICE_REPLACE( tag, type, clock ) \
- psxgpu_device::set_vram_size(*device, _vramSize); \
+ downcast<psxgpu_device &>(*device).set_vram_size(_vramSize); \
MCFG_PSX_GPU_VBLANK_HANDLER(DEVWRITELINE(cputag ":irq", psxirq_device, intin0)) \
MCFG_PSX_DMA_CHANNEL_READ( cputag, 2, psxdma_device::write_delegate(&psxgpu_device::dma_read, (psxgpu_device *) device ) ) \
MCFG_PSX_DMA_CHANNEL_WRITE( cputag, 2, psxdma_device::read_delegate(&psxgpu_device::dma_write, (psxgpu_device *) device ) )
@@ -51,9 +51,9 @@ DECLARE_DEVICE_TYPE(CXD8654Q, cxd8654q_device)
class psxgpu_device : public device_t
{
public:
- // static configuration helpers
- template <class Object> static devcb_base &set_vblank_handler(device_t &device, Object &&cb) { return downcast<psxgpu_device &>(device).m_vblank_handler.set_callback(std::forward<Object>(cb)); }
- static void set_vram_size(device_t &device, int size) { downcast<psxgpu_device &>(device).vramSize = size; }
+ // configuration helpers
+ template <class Object> devcb_base &set_vblank_handler(Object &&cb) { return m_vblank_handler.set_callback(std::forward<Object>(cb)); }
+ void set_vram_size(int size) { vramSize = size; }
DECLARE_WRITE32_MEMBER( write );
DECLARE_READ32_MEMBER( read );
diff --git a/src/devices/video/ramdac.cpp b/src/devices/video/ramdac.cpp
index 4cb0ef2f383..20cb68e50d7 100644
--- a/src/devices/video/ramdac.cpp
+++ b/src/devices/video/ramdac.cpp
@@ -51,16 +51,6 @@ ramdac_device::ramdac_device(const machine_config &mconfig, const char *tag, dev
}
//-------------------------------------------------
-// static_set_palette_tag: Set the tag of the
-// palette device
-//-------------------------------------------------
-
-void ramdac_device::static_set_palette_tag(device_t &device, const char *tag)
-{
- downcast<ramdac_device &>(device).m_palette.set_tag(tag);
-}
-
-//-------------------------------------------------
// memory_space_config - return a description of
// any address spaces owned by this device
//-------------------------------------------------
diff --git a/src/devices/video/ramdac.h b/src/devices/video/ramdac.h
index 6b8c4c8346b..55471af0431 100644
--- a/src/devices/video/ramdac.h
+++ b/src/devices/video/ramdac.h
@@ -20,13 +20,13 @@
#define MCFG_RAMDAC_ADD(_tag, _map, _palette_tag) \
MCFG_DEVICE_ADD(_tag, RAMDAC, 0) \
MCFG_DEVICE_ADDRESS_MAP(0, _map) \
- ramdac_device::static_set_palette_tag(*device, "^" _palette_tag);
+ downcast<ramdac_device &>(*device).set_palette_tag("^" _palette_tag);
#define MCFG_RAMDAC_COLOR_BASE(_color_base) \
- ramdac_device::static_set_color_base(*device, _color_base);
+ downcast<ramdac_device &>(*device).set_color_base(_color_base);
#define MCFG_RAMDAC_SPLIT_READ(_split) \
- ramdac_device::set_split_read(*device, _split);
+ downcast<ramdac_device &>(*device).set_split_read(_split);
//**************************************************************************
@@ -42,10 +42,10 @@ public:
// construction/destruction
ramdac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration
- static void static_set_palette_tag(device_t &device, const char *tag);
- static void static_set_color_base(device_t &device, uint32_t color_base) { downcast<ramdac_device &>(device).m_color_base = color_base; }
- static void set_split_read(device_t &device, int split) { downcast<ramdac_device &>(device).m_split_read_reg = split; }
+ // configuration
+ void set_palette_tag(const char *tag) { m_palette.set_tag(tag); }
+ void set_color_base(uint32_t color_base) { m_color_base = color_base; }
+ void set_split_read(int split) { m_split_read_reg = split; }
// I/O operations
DECLARE_READ8_MEMBER( index_r );
diff --git a/src/devices/video/saa5050.h b/src/devices/video/saa5050.h
index 4d943cefd0b..a99183e5f04 100644
--- a/src/devices/video/saa5050.h
+++ b/src/devices/video/saa5050.h
@@ -36,11 +36,11 @@
//**************************************************************************
#define MCFG_SAA5050_D_CALLBACK(_read) \
- devcb = &saa5050_device::set_d_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<saa5050_device &>(*device).set_d_rd_callback(DEVCB_##_read);
#define MCFG_SAA5050_SCREEN_SIZE(_cols, _rows, _size) \
- saa5050_device::static_set_screen_size(*device, _cols, _rows, _size);
+ downcast<saa5050_device &>(*device).set_screen_size(_cols, _rows, _size);
@@ -56,9 +56,9 @@ public:
// construction/destruction
saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_screen_size(device_t &device, int cols, int rows, int size) { downcast<saa5050_device &>(device).m_cols = cols; downcast<saa5050_device &>(device).m_rows = rows; downcast<saa5050_device &>(device).m_size = size; }
+ void set_screen_size(int cols, int rows, int size) { m_cols = cols; m_rows = rows; m_size = size; }
- template <class Object> static devcb_base &set_d_rd_callback(device_t &device, Object &&cb) { return downcast<saa5050_device &>(device).m_read_d.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_d_rd_callback(Object &&cb) { return m_read_d.set_callback(std::forward<Object>(cb)); }
// optional information overrides
virtual const tiny_rom_entry *device_rom_region() const override;
diff --git a/src/devices/video/scn2674.h b/src/devices/video/scn2674.h
index 4e93b1bae82..b2b7f6dfa55 100644
--- a/src/devices/video/scn2674.h
+++ b/src/devices/video/scn2674.h
@@ -7,16 +7,16 @@
#define MCFG_SCN2674_INTR_CALLBACK(_intr) \
- devcb = &scn2674_device::set_intr_callback(*device, DEVCB_##_intr);
+ devcb = &downcast<scn2674_device &>(*device).set_intr_callback(DEVCB_##_intr);
#define MCFG_SCN2674_TEXT_CHARACTER_WIDTH(_value) \
- scn2674_device::static_set_character_width(*device, _value);
+ downcast<scn2674_device &>(*device).set_character_width(_value);
#define MCFG_SCN2674_GFX_CHARACTER_WIDTH(_value) \
- scn2674_device::static_set_gfx_character_width(*device, _value);
+ downcast<scn2674_device &>(*device).set_gfx_character_width(_value);
#define MCFG_SCN2674_DRAW_CHARACTER_CALLBACK_OWNER(_class, _method) \
- scn2674_device::static_set_display_callback(*device, scn2674_device::draw_character_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<scn2674_device &>(*device).set_display_callback(scn2674_device::draw_character_delegate(&_class::_method, #_class "::" #_method, this));
#define SCN2674_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int x, int y, uint8_t linecount, uint8_t charcode, uint16_t address, uint8_t cursor, uint8_t dw, uint8_t lg, uint8_t ul, uint8_t blink)
@@ -30,10 +30,10 @@ public:
typedef device_delegate<void (bitmap_rgb32 &bitmap, int x, int y, uint8_t linecount, uint8_t charcode, uint16_t address, uint8_t cursor, uint8_t dw, uint8_t lg, uint8_t ul, uint8_t blink)> draw_character_delegate;
// static configuration
- template <class Object> static devcb_base &set_intr_callback(device_t &device, Object &&cb) { return downcast<scn2674_device &>(device).m_intr_cb.set_callback(std::forward<Object>(cb)); }
- static void static_set_character_width(device_t &device, int value) { downcast<scn2674_device &>(device).m_text_hpixels_per_column = value; }
- static void static_set_gfx_character_width(device_t &device, int value) { downcast<scn2674_device &>(device).m_gfx_hpixels_per_column = value; }
- static void static_set_display_callback(device_t &device, draw_character_delegate &&cb) { downcast<scn2674_device &>(device).m_display_cb = std::move(cb); }
+ template <class Object> devcb_base &set_intr_callback(Object &&cb) { return m_intr_cb.set_callback(std::forward<Object>(cb)); }
+ void set_character_width(int value) { m_text_hpixels_per_column = value; }
+ void set_gfx_character_width(int value) { m_gfx_hpixels_per_column = value; }
+ template <typename Object> void set_display_callback(Object &&cb) { m_display_cb = std::forward<Object>(cb); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/video/sed1520.h b/src/devices/video/sed1520.h
index 2bd554055f0..8b1529f8790 100644
--- a/src/devices/video/sed1520.h
+++ b/src/devices/video/sed1520.h
@@ -14,7 +14,7 @@
#define MCFG_SED1520_ADD( _tag, _cb ) \
MCFG_DEVICE_ADD( _tag, SED1520, 0 ) \
- sed1520_device::static_set_screen_update_cb(*device, _cb);
+ downcast<sed1520_device &>(*device).set_screen_update_cb(_cb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -33,8 +33,8 @@ public:
// construction/destruction
sed1520_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- static void static_set_screen_update_cb(device_t &device, screen_update_func _cb) { downcast<sed1520_device &>(device).m_screen_update_func = _cb; }
+ // sconfiguration helpers
+ template <typename Object> void set_screen_update_cb(Object &&cb) { m_screen_update_func = std::forward<Object>(cb); }
// device interface
virtual DECLARE_WRITE8_MEMBER(write);
diff --git a/src/devices/video/snes_ppu.h b/src/devices/video/snes_ppu.h
index a3be6fed5da..0fddff1a44f 100644
--- a/src/devices/video/snes_ppu.h
+++ b/src/devices/video/snes_ppu.h
@@ -44,7 +44,7 @@ public:
snes_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration helpers
- template <class Object> static devcb_base &static_set_open_bus_callback(device_t &device, Object &&cb) { return downcast<snes_ppu_device &>(device).m_openbus_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_open_bus_callback(Object &&cb) { return m_openbus_cb.set_callback(std::forward<Object>(cb)); }
void refresh_scanline(bitmap_rgb32 &bitmap, uint16_t curline);
@@ -319,6 +319,6 @@ DECLARE_DEVICE_TYPE(SNES_PPU, snes_ppu_device)
***************************************************************************/
#define MCFG_SNES_PPU_OPENBUS_CB(_read) \
- devcb = &snes_ppu_device::static_set_open_bus_callback(*device, DEVCB_##_read);
+ devcb = &downcast<snes_ppu_device &>(*device).set_open_bus_callback(DEVCB_##_read);
#endif // MAME_VIDEO_SNES_PPU_H
diff --git a/src/devices/video/sprite.h b/src/devices/video/sprite.h
index 9919d83ec00..93cd38190a6 100644
--- a/src/devices/video/sprite.h
+++ b/src/devices/video/sprite.h
@@ -104,11 +104,6 @@ public:
uint32_t spriteram_elements() const { return m_spriteram_bytes / sizeof(_SpriteRAMType); }
_SpriteRAMType *buffer() { return &m_buffer[0]; }
- // static configuration
- static void static_set_xorigin(device_t &device, int origin) { downcast<sprite_device &>(device).m_xorigin = origin; }
- static void static_set_yorigin(device_t &device, int origin) { downcast<sprite_device &>(device).m_yorigin = origin; }
- static void static_set_origin(device_t &device, int xorigin, int yorigin) { static_set_xorigin(device, xorigin); static_set_yorigin(device, yorigin); }
-
// configuration
void set_spriteram(_SpriteRAMType *base, uint32_t bytes) { m_spriteram = base; m_spriteram_bytes = bytes; m_buffer.resize(m_spriteram_bytes / sizeof(_SpriteRAMType)); }
void set_origin(int32_t xorigin = 0, int32_t yorigin = 0) { m_xorigin = xorigin; m_yorigin = yorigin; }
diff --git a/src/devices/video/t6a04.h b/src/devices/video/t6a04.h
index bee192f8ac6..0232ffc71a6 100644
--- a/src/devices/video/t6a04.h
+++ b/src/devices/video/t6a04.h
@@ -23,11 +23,10 @@ public:
// construction/destruction
t6a04_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_size(device_t &device, int w, int h)
+ void set_size(int w, int h)
{
- t6a04_device &dev = downcast<t6a04_device &>(device);
- dev.m_width = w;
- dev.m_height = h;
+ m_width = w;
+ m_height = h;
}
// device interface
@@ -67,6 +66,6 @@ private:
DECLARE_DEVICE_TYPE(T6A04, t6a04_device)
#define MCFG_T6A04_SIZE(_width, _height) \
- t6a04_device::set_size(*device, _width, _height);
+ downcast<t6a04_device &>(*device).set_size(_width, _height);
#endif // MAME_VIDEO_T6A04_H
diff --git a/src/devices/video/tlc34076.cpp b/src/devices/video/tlc34076.cpp
index 2b8cb788aca..f1d01bd87d5 100644
--- a/src/devices/video/tlc34076.cpp
+++ b/src/devices/video/tlc34076.cpp
@@ -49,16 +49,6 @@ tlc34076_device::tlc34076_device(const machine_config &mconfig, const char *tag,
//-------------------------------------------------
-// static_set_bits - set DAC resolution
-//-------------------------------------------------
-void tlc34076_device::static_set_bits(device_t &device, tlc34076_bits bits)
-{
- tlc34076_device &tlc = downcast<tlc34076_device &>(device);
- tlc.m_dacbits = bits;
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void tlc34076_device::device_start()
diff --git a/src/devices/video/tlc34076.h b/src/devices/video/tlc34076.h
index 6a1b54d2adf..6f15a4143fc 100644
--- a/src/devices/video/tlc34076.h
+++ b/src/devices/video/tlc34076.h
@@ -31,8 +31,8 @@ public:
// construction/destruction
tlc34076_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- static void static_set_bits(device_t &device, tlc34076_bits bits);
+ // configuration helpers
+ void set_bits(tlc34076_bits bits) { m_dacbits = bits; }
// public interface
const rgb_t *get_pens();
@@ -62,7 +62,7 @@ private:
#define MCFG_TLC34076_ADD(tag, bits) \
MCFG_DEVICE_ADD((tag), TLC34076, 0) \
- tlc34076_device::static_set_bits(*device, (tlc34076_device::bits));
+ downcast<tlc34076_device &>(*device).set_bits((tlc34076_device::bits));
DECLARE_DEVICE_TYPE(TLC34076, tlc34076_device)
diff --git a/src/devices/video/tms34061.h b/src/devices/video/tms34061.h
index ab5aaa652fd..c00c8547965 100644
--- a/src/devices/video/tms34061.h
+++ b/src/devices/video/tms34061.h
@@ -16,13 +16,13 @@
#define MCFG_TMS34061_ROWSHIFT(_shift) \
- tms34061_device::set_rowshift(*device, _shift);
+ downcast<tms34061_device &>(*device).set_rowshift(_shift);
#define MCFG_TMS34061_VRAM_SIZE(_size) \
- tms34061_device::set_vram_size(*device, _size);
+ downcast<tms34061_device &>(*device).set_vram_size(_size);
#define MCFG_TMS34061_INTERRUPT_CB(_devcb) \
- devcb = &tms34061_device::set_interrupt_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tms34061_device &>(*device).set_interrupt_callback(DEVCB_##_devcb);
@@ -44,9 +44,9 @@ public:
// construction/destruction
tms34061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_rowshift(device_t &device, uint8_t rowshift) { downcast<tms34061_device &>(device).m_rowshift = rowshift; }
- static void set_vram_size(device_t &device, uint32_t vramsize) { downcast<tms34061_device &>(device).m_vramsize = vramsize; }
- template <class Object> static devcb_base &set_interrupt_callback(device_t &device, Object &&cb) { return downcast<tms34061_device &>(device).m_interrupt_cb.set_callback(std::forward<Object>(cb)); }
+ void set_rowshift(uint8_t rowshift) { m_rowshift = rowshift; }
+ void set_vram_size(uint32_t vramsize) { m_vramsize = vramsize; }
+ template <class Object> devcb_base &set_interrupt_callback(Object &&cb) { return m_interrupt_cb.set_callback(std::forward<Object>(cb)); }
/* reads/writes to the 34061 */
uint8_t read(address_space &space, int col, int row, int func);
diff --git a/src/devices/video/tms9927.h b/src/devices/video/tms9927.h
index c1b6ec7bce8..90da2ff414a 100644
--- a/src/devices/video/tms9927.h
+++ b/src/devices/video/tms9927.h
@@ -11,36 +11,35 @@
#define MCFG_TMS9927_VSYN_CALLBACK(_write) \
- devcb = &tms9927_device::set_vsyn_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<tms9927_device &>(*device).set_vsyn_wr_callback(DEVCB_##_write);
#define MCFG_TMS9927_HSYN_CALLBACK(_write) \
- devcb = &tms9927_device::set_hsyn_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<tms9927_device &>(*device).set_hsyn_wr_callback(DEVCB_##_write);
#define MCFG_TMS9927_CHAR_WIDTH(_pixels) \
- tms9927_device::set_char_width(*device, _pixels);
+ downcast<tms9927_device &>(*device).set_char_width(_pixels);
#define MCFG_TMS9927_REGION(_tag) \
- tms9927_device::set_region_tag(*device, "^" _tag);
+ downcast<tms9927_device &>(*device).set_region_tag("^" _tag);
#define MCFG_TMS9927_OVERSCAN(_left, _right, _top, _bottom) \
- tms9927_device::set_overscan(*device, _left, _right, _top, _bottom);
+ downcast<tms9927_device &>(*device).set_overscan(_left, _right, _top, _bottom);
class tms9927_device : public device_t, public device_video_interface
{
public:
tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_vsyn_wr_callback(device_t &device, Object &&cb) { return downcast<tms9927_device &>(device).m_write_vsyn.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_hsyn_wr_callback(device_t &device, Object &&cb) { return downcast<tms9927_device &>(device).m_write_hsyn.set_callback(std::forward<Object>(cb)); }
-
- static void set_char_width(device_t &device, int pixels) { downcast<tms9927_device &>(device).m_hpixels_per_column = pixels; }
- static void set_region_tag(device_t &device, const char *tag) { downcast<tms9927_device &>(device).m_selfload.set_tag(tag); }
- static void set_overscan(device_t &device, int left, int right, int top, int bottom) {
- tms9927_device &dev = downcast<tms9927_device &>(device);
- dev.m_overscan_left = left;
- dev.m_overscan_right = right;
- dev.m_overscan_top = top;
- dev.m_overscan_bottom = bottom;
+ template <class Object> devcb_base &set_vsyn_wr_callback(Object &&cb) { return m_write_vsyn.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_hsyn_wr_callback(Object &&cb) { return m_write_hsyn.set_callback(std::forward<Object>(cb)); }
+
+ void set_char_width(int pixels) { m_hpixels_per_column = pixels; }
+ void set_region_tag(const char *tag) { m_selfload.set_tag(tag); }
+ void set_overscan(int left, int right, int top, int bottom) {
+ m_overscan_left = left;
+ m_overscan_right = right;
+ m_overscan_top = top;
+ m_overscan_bottom = bottom;
}
DECLARE_WRITE8_MEMBER(write);
diff --git a/src/devices/video/tms9928a.h b/src/devices/video/tms9928a.h
index 9d3a54c84a4..607c914727d 100644
--- a/src/devices/video/tms9928a.h
+++ b/src/devices/video/tms9928a.h
@@ -34,15 +34,15 @@
// MCFG_DEVICE_ADD(_tag, _variant, XTAL(10'738'635) / 2 )
#define MCFG_TMS9928A_VRAM_SIZE(_size) \
- tms9928a_device::set_vram_size(*device, _size);
+ downcast<tms9928a_device &>(*device).set_vram_size(_size);
#define MCFG_TMS9928A_OUT_INT_LINE_CB(_devcb) \
- devcb = &tms9928a_device::set_out_int_line_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tms9928a_device &>(*device).set_out_int_line_callback(DEVCB_##_devcb);
#define MCFG_TMS9928A_SET_SCREEN MCFG_VIDEO_SET_SCREEN
#define MCFG_TMS9928A_OUT_GROMCLK_CB(_devcb) \
- devcb = &tms9928a_device::set_out_gromclk_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tms9928a_device &>(*device).set_out_gromclk_callback(DEVCB_##_devcb);
#define MCFG_TMS9928A_SCREEN_ADD_NTSC(_screen_tag) \
@@ -88,9 +88,9 @@ public:
// construction/destruction
tms9928a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_vram_size(device_t &device, int vram_size) { downcast<tms9928a_device &>(device).m_vram_size = vram_size; }
- template <class Object> static devcb_base &set_out_int_line_callback(device_t &device, Object &&cb) { return downcast<tms9928a_device &>(device).m_out_int_line_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_gromclk_callback(device_t &device, Object &&cb) { return downcast<tms9928a_device &>(device).m_out_gromclk_cb.set_callback(std::forward<Object>(cb)); }
+ void set_vram_size(int vram_size) { m_vram_size = vram_size; }
+ template <class Object> devcb_base &set_out_int_line_callback(Object &&cb) { return m_out_int_line_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_gromclk_callback(Object &&cb) { return m_out_gromclk_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/video/upd3301.h b/src/devices/video/upd3301.h
index 281bcf37aab..40deb120e05 100644
--- a/src/devices/video/upd3301.h
+++ b/src/devices/video/upd3301.h
@@ -44,22 +44,22 @@
#define MCFG_UPD3301_CHARACTER_WIDTH(_value) \
- upd3301_device::static_set_character_width(*device, _value);
+ downcast<upd3301_device &>(*device).set_character_width(_value);
#define MCFG_UPD3301_DRAW_CHARACTER_CALLBACK_OWNER(_class, _method) \
- upd3301_device::static_set_display_callback(*device, upd3301_device::draw_character_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<upd3301_device &>(*device).set_display_callback(upd3301_device::draw_character_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_UPD3301_DRQ_CALLBACK(_write) \
- devcb = &upd3301_device::set_drq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<upd3301_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
#define MCFG_UPD3301_INT_CALLBACK(_write) \
- devcb = &upd3301_device::set_int_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<upd3301_device &>(*device).set_int_wr_callback(DEVCB_##_write);
#define MCFG_UPD3301_HRTC_CALLBACK(_write) \
- devcb = &upd3301_device::set_hrtc_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<upd3301_device &>(*device).set_hrtc_wr_callback(DEVCB_##_write);
#define MCFG_UPD3301_VRTC_CALLBACK(_write) \
- devcb = &upd3301_device::set_vrtc_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<upd3301_device &>(*device).set_vrtc_wr_callback(DEVCB_##_write);
@@ -79,13 +79,13 @@ public:
// construction/destruction
upd3301_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_character_width(device_t &device, int value) { downcast<upd3301_device &>(device).m_width = value; }
- static void static_set_display_callback(device_t &device, draw_character_delegate &&cb) { downcast<upd3301_device &>(device).m_display_cb = std::move(cb); }
+ void set_character_width(int value) { m_width = value; }
+ template <typename Object> void set_display_callback(Object &&cb) { m_display_cb = std::forward<Object>(cb); }
- template <class Object> static devcb_base &set_drq_wr_callback(device_t &device, Object &&cb) { return downcast<upd3301_device &>(device).m_write_drq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_int_wr_callback(device_t &device, Object &&cb) { return downcast<upd3301_device &>(device).m_write_int.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_hrtc_wr_callback(device_t &device, Object &&cb) { return downcast<upd3301_device &>(device).m_write_hrtc.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vrtc_wr_callback(device_t &device, Object &&cb) { return downcast<upd3301_device &>(device).m_write_vrtc.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_drq_wr_callback(Object &&cb) { return m_write_drq.set_callback(std::forward<Object>(cb)); }
+ 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_hrtc_wr_callback(Object &&cb) { return m_write_hrtc.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vrtc_wr_callback(Object &&cb) { return m_write_vrtc.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/video/upd7220.h b/src/devices/video/upd7220.h
index a8e4a3f73ab..692aeb09024 100644
--- a/src/devices/video/upd7220.h
+++ b/src/devices/video/upd7220.h
@@ -45,22 +45,22 @@
#define MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(_class, _method) \
- upd7220_device::static_set_display_pixels_callback(*device, upd7220_device::display_pixels_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<upd7220_device &>(*device).set_display_pixels_callback(upd7220_device::display_pixels_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(_class, _method) \
- upd7220_device::static_set_draw_text_callback(*device, upd7220_device::draw_text_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<upd7220_device &>(*device).set_draw_text_callback(upd7220_device::draw_text_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_UPD7220_DRQ_CALLBACK(_write) \
- devcb = &upd7220_device::set_drq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<upd7220_device &>(*device).set_drq_wr_callback(DEVCB_##_write);
#define MCFG_UPD7220_HSYNC_CALLBACK(_write) \
- devcb = &upd7220_device::set_hsync_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<upd7220_device &>(*device).set_hsync_wr_callback(DEVCB_##_write);
#define MCFG_UPD7220_VSYNC_CALLBACK(_write) \
- devcb = &upd7220_device::set_vsync_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<upd7220_device &>(*device).set_vsync_wr_callback(DEVCB_##_write);
#define MCFG_UPD7220_BLANK_CALLBACK(_write) \
- devcb = &upd7220_device::set_blank_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<upd7220_device &>(*device).set_blank_wr_callback(DEVCB_##_write);
@@ -82,13 +82,13 @@ public:
// construction/destruction
upd7220_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_display_pixels_callback(device_t &device, display_pixels_delegate &&cb) { downcast<upd7220_device &>(device).m_display_cb = std::move(cb); }
- static void static_set_draw_text_callback(device_t &device, draw_text_delegate &&cb) { downcast<upd7220_device &>(device).m_draw_text_cb = std::move(cb); }
+ template <typename Object> void set_display_pixels_callback(Object &&cb) { m_display_cb = std::forward<Object>(cb); }
+ template <typename Object> void set_draw_text_callback(Object &&cb) { m_draw_text_cb = std::forward<Object>(cb); }
- template <class Object> static devcb_base &set_drq_wr_callback(device_t &device, Object &&cb) { return downcast<upd7220_device &>(device).m_write_drq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_hsync_wr_callback(device_t &device, Object &&cb) { return downcast<upd7220_device &>(device).m_write_hsync.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vsync_wr_callback(device_t &device, Object &&cb) { return downcast<upd7220_device &>(device).m_write_vsync.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_blank_wr_callback(device_t &device, Object &&cb) { return downcast<upd7220_device &>(device).m_write_blank.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_drq_wr_callback(Object &&cb) { return m_write_drq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_hsync_wr_callback(Object &&cb) { return m_write_hsync.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vsync_wr_callback(Object &&cb) { return m_write_vsync.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_blank_wr_callback(Object &&cb) { return m_write_blank.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/video/upd7227.cpp b/src/devices/video/upd7227.cpp
index 89a12408e05..b9a5b585d3b 100644
--- a/src/devices/video/upd7227.cpp
+++ b/src/devices/video/upd7227.cpp
@@ -50,19 +50,6 @@ upd7227_device::upd7227_device(const machine_config &mconfig, const char *tag, d
//-------------------------------------------------
-// static_set_offsets - configuration helper
-//-------------------------------------------------
-
-void upd7227_device::static_set_offsets(device_t &device, int sx, int sy)
-{
- upd7227_device &upd7227 = downcast<upd7227_device &>(device);
-
- upd7227.m_sx = sx;
- upd7227.m_sy = sy;
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/video/upd7227.h b/src/devices/video/upd7227.h
index c9eb40f8633..a6888e2d849 100644
--- a/src/devices/video/upd7227.h
+++ b/src/devices/video/upd7227.h
@@ -19,7 +19,7 @@
#define MCFG_UPD7227_ADD(_tag, _sx, _sy) \
MCFG_DEVICE_ADD(_tag, UPD7227, 0) \
- upd7227_device::static_set_offsets(*device, _sx, _sy);
+ downcast<upd7227_device &>(*device).set_offsets(_sx, _sy);
@@ -37,7 +37,7 @@ public:
upd7227_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration helpers
- static void static_set_offsets(device_t &device, int sx, int sy);
+ void set_offsets(int sx, int sy) { m_sx = sx; m_sy = sy; }
DECLARE_WRITE_LINE_MEMBER( cs_w );
DECLARE_WRITE_LINE_MEMBER( cd_w );
diff --git a/src/devices/video/v9938.cpp b/src/devices/video/v9938.cpp
index b36d592f32e..dbbd6e6b066 100644
--- a/src/devices/video/v9938.cpp
+++ b/src/devices/video/v9938.cpp
@@ -565,11 +565,6 @@ void v99x8_device::register_w(uint8_t data)
m_cont_reg[17] = (m_cont_reg[17] + 1) & 0x3f;
}
-void v99x8_device::static_set_vram_size(device_t &device, uint32_t vram_size)
-{
- downcast<v99x8_device &>(device).m_vram_size = vram_size;
-}
-
/***************************************************************************
Init/stop/reset/Interrupt functions
diff --git a/src/devices/video/v9938.h b/src/devices/video/v9938.h
index 27d23f7ae46..cbc5e0364a2 100644
--- a/src/devices/video/v9938.h
+++ b/src/devices/video/v9938.h
@@ -21,11 +21,11 @@
#define MCFG_V9938_ADD(_tag, _screen, _vramsize, _clock) \
MCFG_DEVICE_ADD(_tag, V9938, _clock) \
MCFG_VIDEO_SET_SCREEN(_screen) \
- v9938_device::static_set_vram_size(*device, _vramsize);
+ downcast<v99x8_device &>(*device).set_vram_size(_vramsize);
#define MCFG_V9958_ADD(_tag, _screen, _vramsize, _clock) \
MCFG_DEVICE_ADD(_tag, V9958, _clock) \
MCFG_VIDEO_SET_SCREEN(_screen) \
- v9938_device::static_set_vram_size(*device, _vramsize);
+ downcast<v99x8_device &>(*device).set_vram_size(_vramsize);
#define MCFG_V99X8_SCREEN_ADD_NTSC(_screen_tag, _v9938_tag, _clock) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
@@ -91,7 +91,7 @@ public:
void command_w(uint8_t data);
void register_w(uint8_t data);
- static void static_set_vram_size(device_t &device, uint32_t vram_size);
+ void set_vram_size(uint32_t vram_size) { m_vram_size = vram_size; }
/* RESET pin */
void reset_line(int state) { if (state==ASSERT_LINE) device_reset(); }
diff --git a/src/devices/video/vic4567.h b/src/devices/video/vic4567.h
index ae6e0b5ad8a..2b94e93f0cd 100644
--- a/src/devices/video/vic4567.h
+++ b/src/devices/video/vic4567.h
@@ -109,16 +109,16 @@ public:
vic3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_cpu_tag(device_t &device, const char *tag) { downcast<vic3_device &>(device).m_cpu.set_tag(tag); }
- static void set_vic3_type(device_t &device, vic3_type type) { downcast<vic3_device &>(device).m_type = type; }
- template <class Object> static devcb_base &set_dma_read_callback(device_t &device, Object &&cb) { return downcast<vic3_device &>(device).m_dma_read_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma_read_color_callback(device_t &device, Object &&cb) { return downcast<vic3_device &>(device).m_dma_read_color_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_interrupt_callback(device_t &device, Object &&cb) { return downcast<vic3_device &>(device).m_interrupt_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_port_changed_callback(device_t &device, Object &&cb) { return downcast<vic3_device &>(device).m_port_changed_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_lightpen_button_callback(device_t &device, Object &&cb) { return downcast<vic3_device &>(device).m_lightpen_button_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_lightpen_x_callback(device_t &device, Object &&cb) { return downcast<vic3_device &>(device).m_lightpen_x_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_lightpen_y_callback(device_t &device, Object &&cb) { return downcast<vic3_device &>(device).m_lightpen_y_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_c64_mem_r_callback(device_t &device, Object &&cb) { return downcast<vic3_device &>(device).m_c64_mem_r_cb.set_callback(std::forward<Object>(cb)); }
+ void set_cpu_tag(const char *tag) { m_cpu.set_tag(tag); }
+ void set_vic3_type(vic3_type type) { m_type = type; }
+ template <class Object> devcb_base &set_dma_read_callback(Object &&cb) { return m_dma_read_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma_read_color_callback(Object &&cb) { return m_dma_read_color_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_interrupt_callback(Object &&cb) { return m_interrupt_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_port_changed_callback(Object &&cb) { return m_port_changed_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_lightpen_button_callback(Object &&cb) { return m_lightpen_button_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_lightpen_x_callback(Object &&cb) { return m_lightpen_x_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_lightpen_y_callback(Object &&cb) { return m_lightpen_y_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_c64_mem_r_callback(Object &&cb) { return m_c64_mem_r_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE8_MEMBER(port_w);
DECLARE_WRITE8_MEMBER(palette_w);
@@ -237,33 +237,33 @@ DECLARE_DEVICE_TYPE(VIC3, vic3_device)
#define MCFG_VIC3_CPU(tag) \
- vic3_device::static_set_cpu_tag(*device, ("^" tag));
+ downcast<vic3_device &>(*device).set_cpu_tag(("^" tag));
#define MCFG_VIC3_TYPE(type) \
- vic3_device::set_vic3_type(*device, (vic3_device::vic3_type::type));
+ downcast<vic3_device &>(*device).set_vic3_type((vic3_device::vic3_type::type));
#define MCFG_VIC3_DMA_READ_CB(cb) \
- devcb = &vic3_device::set_dma_read_callback(*device, (DEVCB_##cb));
+ devcb = &downcast<vic3_device &>(*device).set_dma_read_callback((DEVCB_##cb));
#define MCFG_VIC3_DMA_READ_COLOR_CB(cb) \
- devcb = &vic3_device::set_dma_read_color_callback(*device, (DEVCB_##cb));
+ devcb = &downcast<vic3_device &>(*device).set_dma_read_color_callback((DEVCB_##cb));
#define MCFG_VIC3_INTERRUPT_CB(cb) \
- devcb = &vic3_device::set_interrupt_callback(*device, (DEVCB_##cb));
+ devcb = &downcast<vic3_device &>(*device).set_interrupt_callback((DEVCB_##cb));
#define MCFG_VIC3_PORT_CHANGED_CB(cb) \
- devcb = &vic3_device::set_port_changed_callback(*device, (DEVCB_##cb));
+ devcb = &downcast<vic3_device &>(*device).set_port_changed_callback((DEVCB_##cb));
#define MCFG_VIC3_LIGHTPEN_BUTTON_CB(cb) \
- devcb = &vic3_device::set_lightpen_button_callback(*device, (DEVCB_##cb));
+ devcb = &downcast<vic3_device &>(*device).set_lightpen_button_callback((DEVCB_##cb));
#define MCFG_VIC3_LIGHTPEN_X_CB(cb) \
- devcb = &vic3_device::set_lightpen_x_callback(*device, (DEVCB_##cb));
+ devcb = &downcast<vic3_device &>(*device).set_lightpen_x_callback((DEVCB_##cb));
#define MCFG_VIC3_LIGHTPEN_Y_CB(cb) \
- devcb = &vic3_device::set_lightpen_y_callback(*device, (DEVCB_##cb));
+ devcb = &downcast<vic3_device &>(*device).set_lightpen_y_callback((DEVCB_##cb));
#define MCFG_VIC3_C64_MEM_R_CB(cb) \
- devcb = &vic3_device::set_c64_mem_r_callback(*device, (DEVCB_##cb));
+ devcb = &downcast<vic3_device &>(*device).set_c64_mem_r_callback((DEVCB_##cb));
#endif // MAME_VIDEO_VIC4567_H
diff --git a/src/devices/video/voodoo.h b/src/devices/video/voodoo.h
index fd3fc7b8a78..6a36fd0b216 100644
--- a/src/devices/video/voodoo.h
+++ b/src/devices/video/voodoo.h
@@ -1435,25 +1435,25 @@ enum
***************************************************************************/
#define MCFG_VOODOO_FBMEM(_value) \
- voodoo_device::static_set_fbmem(*device, _value);
+ downcast<voodoo_device &>(*device).set_fbmem(_value);
#define MCFG_VOODOO_TMUMEM(_value1, _value2) \
- voodoo_device::static_set_tmumem(*device, _value1, _value2);
+ downcast<voodoo_device &>(*device).set_tmumem(_value1, _value2);
#define MCFG_VOODOO_SCREEN_TAG(_tag) \
- voodoo_device::static_set_screen_tag(*device, _tag);
+ downcast<voodoo_device &>(*device).set_screen_tag(_tag);
#define MCFG_VOODOO_CPU_TAG(_tag) \
- voodoo_device::static_set_cpu_tag(*device, _tag);
+ downcast<voodoo_device &>(*device).set_cpu_tag(_tag);
#define MCFG_VOODOO_VBLANK_CB(_devcb) \
- devcb = &voodoo_device::static_set_vblank_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<voodoo_device &>(*device).set_vblank_callback(DEVCB_##_devcb);
#define MCFG_VOODOO_STALL_CB(_devcb) \
- devcb = &voodoo_device::static_set_stall_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<voodoo_device &>(*device).set_stall_callback(DEVCB_##_devcb);
#define MCFG_VOODOO_PCIINT_CB(_devcb) \
- devcb = &voodoo_device::static_set_pciint_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<voodoo_device &>(*device).set_pciint_callback(DEVCB_##_devcb);
/***************************************************************************
FUNCTION PROTOTYPES
@@ -1466,13 +1466,13 @@ class voodoo_device : public device_t
public:
~voodoo_device();
- static void static_set_fbmem(device_t &device, int value) { downcast<voodoo_device &>(device).m_fbmem = value; }
- static void static_set_tmumem(device_t &device, int value1, int value2) { downcast<voodoo_device &>(device).m_tmumem0 = value1; downcast<voodoo_device &>(device).m_tmumem1 = value2; }
- static void static_set_screen_tag(device_t &device, const char *tag) { downcast<voodoo_device &>(device).m_screen = tag; }
- static void static_set_cpu_tag(device_t &device, const char *tag) { downcast<voodoo_device &>(device).m_cputag = tag; }
- template <class Object> static devcb_base &static_set_vblank_callback(device_t &device, Object &&cb) { return downcast<voodoo_device &>(device).m_vblank.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_stall_callback(device_t &device, Object &&cb) { return downcast<voodoo_device &>(device).m_stall.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_pciint_callback(device_t &device, Object &&cb) { return downcast<voodoo_device &>(device).m_pciint.set_callback(std::forward<Object>(cb)); }
+ void set_fbmem(int value) { m_fbmem = value; }
+ void set_tmumem(int value1, int value2) { m_tmumem0 = value1; m_tmumem1 = value2; }
+ void set_screen_tag(const char *tag) { m_screen = tag; }
+ void set_cpu_tag(const char *tag) { m_cputag = tag; }
+ template <class Object> devcb_base &set_vblank_callback(Object &&cb) { return m_vblank.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_stall_callback(Object &&cb) { return m_stall.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_pciint_callback(Object &&cb) { return m_pciint.set_callback(std::forward<Object>(cb)); }
DECLARE_READ32_MEMBER( voodoo_r );
DECLARE_WRITE32_MEMBER( voodoo_w );
diff --git a/src/devices/video/voodoo_pci.cpp b/src/devices/video/voodoo_pci.cpp
index 6ef3a938b1b..6fbe42edb2b 100644
--- a/src/devices/video/voodoo_pci.cpp
+++ b/src/devices/video/voodoo_pci.cpp
@@ -73,9 +73,9 @@ void voodoo_pci_device::set_cpu_tag(const char *_cpu_tag)
void voodoo_pci_device::device_start()
{
- voodoo_device::static_set_cpu_tag(*m_voodoo, m_cpu_tag);
- voodoo_device::static_set_fbmem(*m_voodoo, m_fbmem);
- voodoo_device::static_set_tmumem(*m_voodoo, m_tmumem0, m_tmumem1);
+ m_voodoo->set_cpu_tag(m_cpu_tag);
+ m_voodoo->set_fbmem(m_fbmem);
+ m_voodoo->set_tmumem(m_tmumem0, m_tmumem1);
switch (m_type) {
//void set_ids(uint32_t main_id, uint8_t revision, uint32_t pclass, uint32_t subsystem_id);
case TYPE_VOODOO_1:
diff --git a/src/devices/video/zeus2.h b/src/devices/video/zeus2.h
index 377e1ed93fc..bfd2cb4cdc2 100644
--- a/src/devices/video/zeus2.h
+++ b/src/devices/video/zeus2.h
@@ -102,10 +102,10 @@ typedef zeus2_renderer::extent_t z2_poly_extent;
* Zeus2 Video Device
*************************************/
#define MCFG_ZEUS2_VBLANK_CB(_devcb) \
- devcb = &zeus2_device::set_vblank_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<zeus2_device &>(*device).set_vblank_callback(DEVCB_##_devcb);
#define MCFG_ZEUS2_IRQ_CB(_devcb) \
- devcb = &zeus2_device::set_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<zeus2_device &>(*device).set_irq_callback(DEVCB_##_devcb);
#define MCFG_ZEUS2_FLOAT_MODE(_mode) \
downcast<zeus2_device *>(device)->set_float_mode(_mode);
@@ -121,8 +121,8 @@ public:
TIMER_CALLBACK_MEMBER(display_irq_off);
TIMER_CALLBACK_MEMBER(display_irq);
- template <class Object> static devcb_base &set_vblank_callback(device_t &device, Object &&cb) { return downcast<zeus2_device &>(device).m_vblank.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_irq_callback(device_t &device, Object &&cb) { return downcast<zeus2_device &>(device).m_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vblank_callback(Object &&cb) { return m_vblank.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_callback(Object &&cb) { return m_irq.set_callback(std::forward<Object>(cb)); }
devcb_write_line m_vblank;
devcb_write_line m_irq;