summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/decodmd3.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/decodmd3.h')
-rw-r--r--src/mame/video/decodmd3.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mame/video/decodmd3.h b/src/mame/video/decodmd3.h
index e077c8a6a90..67f09660d8b 100644
--- a/src/mame/video/decodmd3.h
+++ b/src/mame/video/decodmd3.h
@@ -14,13 +14,17 @@
#include "machine/timer.h"
#include "video/mc6845.h"
-#define MCFG_DECODMD_TYPE3_ADD(_tag, _region) \
- MCFG_DEVICE_ADD(_tag, DECODMD3, 0) \
- downcast<decodmd_type3_device &>(*device).set_gfxregion(_region);
class decodmd_type3_device : public device_t
{
public:
+ template <typename T>
+ decodmd_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&gfxregion_tag)
+ : decodmd_type3_device(mconfig, tag, owner, clock)
+ {
+ set_gfxregion(std::forward<T>(gfxregion_tag));
+ }
+
decodmd_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
DECLARE_WRITE8_MEMBER(data_w);
@@ -33,7 +37,7 @@ public:
DECLARE_WRITE16_MEMBER(crtc_register_w);
DECLARE_READ16_MEMBER(crtc_status_r);
- 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 decodmd3_map(address_map &map);
protected:
@@ -48,7 +52,7 @@ private:
required_memory_bank m_rambank;
required_memory_bank m_rombank;
- memory_region* m_rom;
+ required_region_ptr<uint8_t> m_rom;
uint8_t m_status;
uint8_t m_crtc_index;
@@ -58,8 +62,6 @@ private:
uint8_t m_busy;
uint8_t m_command;
- const char* m_gfxtag;
-
TIMER_DEVICE_CALLBACK_MEMBER(dmd_irq);
MC6845_UPDATE_ROW(crtc_update_row);
};