summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/k1ge.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/k1ge.h')
-rw-r--r--src/mame/video/k1ge.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mame/video/k1ge.h b/src/mame/video/k1ge.h
index 1fcac610cf2..de314b98d9a 100644
--- a/src/mame/video/k1ge.h
+++ b/src/mame/video/k1ge.h
@@ -13,23 +13,16 @@
#include "emupal.h"
-
-#define MCFG_K1GE_ADD(_tag, _clock, _screen, _vblank, _hblank ) \
- MCFG_DEVICE_ADD( _tag, K1GE, _clock ) \
- MCFG_VIDEO_SET_SCREEN( _screen ) \
- downcast<k1ge_device &>(*device).set_vblank_callback(DEVCB_##_vblank ); \
- downcast<k1ge_device &>(*device).set_hblank_callback(DEVCB_##_hblank );
-
-#define MCFG_K2GE_ADD(_tag, _clock, _screen, _vblank, _hblank ) \
- MCFG_DEVICE_ADD( _tag, K2GE, _clock ) \
- MCFG_VIDEO_SET_SCREEN( _screen ) \
- downcast<k1ge_device &>(*device).set_vblank_callback(DEVCB_##_vblank ); \
- downcast<k1ge_device &>(*device).set_hblank_callback(DEVCB_##_hblank );
-
-
class k1ge_device : public device_t, public device_video_interface
{
public:
+ template <typename T>
+ k1ge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&screen_tag)
+ : k1ge_device(mconfig, tag, owner, clock)
+ {
+ set_screen(std::forward<T>(screen_tag));
+ }
+
k1ge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
DECLARE_READ8_MEMBER( read );
@@ -38,8 +31,8 @@ public:
void update( bitmap_ind16 &bitmap, const rectangle &cliprect );
// Static methods
- template <class Object> devcb_base &set_vblank_callback(Object &&cb) { return m_vblank_pin_w.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_hblank_callback(Object &&cb) { return m_hblank_pin_w.set_callback(std::forward<Object>(cb)); }
+ auto vblank_callback() { return m_vblank_pin_w.bind(); }
+ auto hblank_callback() { return m_hblank_pin_w.bind(); }
static const int K1GE_SCREEN_HEIGHT = 199;
@@ -75,6 +68,13 @@ private:
class k2ge_device : public k1ge_device
{
public:
+ template <typename T>
+ k2ge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&screen_tag)
+ : k2ge_device(mconfig, tag, owner, clock)
+ {
+ set_screen(std::forward<T>(screen_tag));
+ }
+
k2ge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected: