summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-06-16 22:32:22 +1000
committer Vas Crabb <vas@vastheman.com>2018-06-16 22:32:22 +1000
commit521bf0b88ce95c3fcf0744ec44a7136a3133edfc (patch)
treea03b6524105f15228c9a974a24b0d521255f8baa /src/devices/machine
parent1959691bf6e133d909d66195e4c5156413da2078 (diff)
make it possible to set screen update functions without macros without syntax that looks absolutely terrible - examples will come with devcb3 (nw)
Diffstat (limited to 'src/devices/machine')
-rw-r--r--src/devices/machine/laserdsc.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/devices/machine/laserdsc.h b/src/devices/machine/laserdsc.h
index 71d77801e86..f3ce05b4865 100644
--- a/src/devices/machine/laserdsc.h
+++ b/src/devices/machine/laserdsc.h
@@ -65,12 +65,10 @@ enum laserdisc_field_code
downcast<laserdisc_device &>(*device).set_audio(_func);
#define MCFG_LASERDISC_SCREEN(_tag) \
downcast<laserdisc_device &>(*device).set_screen(_tag);
-#define MCFG_LASERDISC_OVERLAY_STATIC(_width, _height, _func) \
- downcast<laserdisc_device &>(*device).set_overlay(_width, _height, screen_update_delegate_smart(&screen_update_##_func, "screen_update_" #_func));
#define MCFG_LASERDISC_OVERLAY_DRIVER(_width, _height, _class, _method) \
- downcast<laserdisc_device &>(*device).set_overlay(_width, _height, screen_update_delegate_smart(&_class::_method, #_class "::" #_method, nullptr));
+ downcast<laserdisc_device &>(*device).set_overlay(_width, _height, &_class::_method, #_class "::" #_method);
#define MCFG_LASERDISC_OVERLAY_DEVICE(_width, _height, _device, _class, _method) \
- downcast<laserdisc_device &>(*device).set_overlay(_width, _height, screen_update_delegate_smart(&_class::_method, #_class "::" #_method, _device));
+ downcast<laserdisc_device &>(*device).set_overlay(_width, _height, _device, &_class::_method, #_class "::" #_method);
#define MCFG_LASERDISC_OVERLAY_CLIP(_minx, _maxx, _miny, _maxy) \
downcast<laserdisc_device &>(*device).set_overlay_clip(_minx, _maxx, _miny, _maxy);
#define MCFG_LASERDISC_OVERLAY_POSITION(_posx, _posy) \
@@ -166,6 +164,27 @@ public:
// configuration helpers
void set_get_disc(get_disc_delegate &&callback) { m_getdisc_callback = std::move(callback); }
void set_audio(audio_delegate &&callback) { m_audio_callback = std::move(callback); }
+ template <class FunctionClass>
+ // FIXME: these should be aware of current device for resolving the tag
+ void set_overlay(uint32_t width, uint32_t height, u32 (FunctionClass::*callback)(screen_device &, bitmap_ind16 &, const rectangle &), const char *name)
+ {
+ set_overlay(width, height, screen_update_ind16_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
+ }
+ template <class FunctionClass>
+ void set_overlay(uint32_t width, uint32_t height, u32 (FunctionClass::*callback)(screen_device &, bitmap_rgb32 &, const rectangle &), const char *name)
+ {
+ set_overlay(width, height, screen_update_rgb32_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
+ }
+ template <class FunctionClass>
+ void set_overlay(uint32_t width, uint32_t height, const char *devname, u32 (FunctionClass::*callback)(screen_device &, bitmap_ind16 &, const rectangle &), const char *name)
+ {
+ set_overlay(width, height, screen_update_ind16_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
+ }
+ template <class FunctionClass>
+ void set_overlay(uint32_t width, uint32_t height, const char *devname, u32 (FunctionClass::*callback)(screen_device &, bitmap_rgb32 &, const rectangle &), const char *name)
+ {
+ set_overlay(width, height, screen_update_rgb32_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
+ }
void set_overlay(uint32_t width, uint32_t height, screen_update_ind16_delegate &&update)
{
m_overwidth = width;