diff options
Diffstat (limited to 'src/mame/video/decodmd2.h')
-rw-r--r-- | src/mame/video/decodmd2.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mame/video/decodmd2.h b/src/mame/video/decodmd2.h index c2fd8701f1b..4209bca823b 100644 --- a/src/mame/video/decodmd2.h +++ b/src/mame/video/decodmd2.h @@ -14,13 +14,17 @@ #include "machine/timer.h" #include "video/mc6845.h" -#define MCFG_DECODMD_TYPE2_ADD(_tag, _region) \ - MCFG_DEVICE_ADD(_tag, DECODMD2, 0) \ - downcast<decodmd_type2_device &>(*device).set_gfxregion(_region); class decodmd_type2_device : public device_t { public: + template <typename T> + decodmd_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&gfxregion_tag) + : decodmd_type2_device(mconfig, tag, owner, clock) + { + set_gfxregion(std::forward<T>(gfxregion_tag)); + } + decodmd_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER(bank_w); @@ -35,7 +39,7 @@ public: DECLARE_READ8_MEMBER(status_r); DECLARE_WRITE8_MEMBER(status_w); - void set_gfxregion(const char *tag) { m_gfxtag = tag; } + template <typename T> void set_gfxregion(T &&tag) { m_rom.set_tag(std::forward<T>(tag)); } void decodmd2_map(address_map &map); protected: @@ -52,7 +56,7 @@ private: required_memory_bank m_rombank2; required_memory_bank m_rambank; required_device<ram_device> m_ram; - memory_region* m_rom; + required_region_ptr<uint8_t> m_rom; uint8_t m_crtc_index; uint8_t m_crtc_reg[0x100]; @@ -61,7 +65,6 @@ private: uint8_t m_ctrl; uint8_t m_busy; uint8_t m_command; - const char* m_gfxtag; TIMER_DEVICE_CALLBACK_MEMBER(dmd_firq); MC6845_UPDATE_ROW(crtc_update_row); |