diff options
Diffstat (limited to 'src/devices/cpu/esrip/esrip.h')
-rw-r--r-- | src/devices/cpu/esrip/esrip.h | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/src/devices/cpu/esrip/esrip.h b/src/devices/cpu/esrip/esrip.h index b9df5365da3..2508b11976a 100644 --- a/src/devices/cpu/esrip/esrip.h +++ b/src/devices/cpu/esrip/esrip.h @@ -14,33 +14,12 @@ #pragma once -/*************************************************************************** - INTERFACE CONFIGURATION MACROS -***************************************************************************/ -#define ESRIP_DRAW(name) int name(int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank) - -#define MCFG_ESRIP_FDT_R_CALLBACK(_read) \ - downcast<esrip_device &>(*device).set_fdt_r_callback(DEVCB_##_read); - -#define MCFG_ESRIP_FDT_W_CALLBACK(_write) \ - downcast<esrip_device &>(*device).set_fdt_w_callback(DEVCB_##_write); - -#define MCFG_ESRIP_STATUS_IN_CALLBACK(_read) \ - downcast<esrip_device &>(*device).set_status_in_callback(DEVCB_##_read); - -#define MCFG_ESRIP_DRAW_CALLBACK_OWNER(_class, _method) \ - downcast<esrip_device &>(*device).set_draw_callback(esrip_device::draw_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_ESRIP_LBRM_PROM(_tag) \ - downcast<esrip_device &>(*device).lbrm_prom(_tag); - -#define MCFG_ESRIP_SCREEN(screen_tag) \ - downcast<esrip_device &>(*device).set_screen_tag(screen_tag); - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** +#define ESRIP_DRAW(name) int name(int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank) + // device type definition DECLARE_DEVICE_TYPE(ESRIP, esrip_device) @@ -56,12 +35,24 @@ public: esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers - void set_screen_tag(const char *tag) { m_screen.set_tag(tag); } - template <class Object> devcb_base &set_fdt_r_callback(Object &&cb) { return m_fdt_r.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_fdt_w_callback(Object &&cb) { return m_fdt_w.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_status_in_callback(Object &&cb) { return m_status_in.set_callback(std::forward<Object>(cb)); } - template <typename Object> void set_draw_callback(Object &&cb) { m_draw = std::forward<Object>(cb); } - void lbrm_prom(const char *name) { m_lbrm_prom = name; } + void set_lbrm_prom_region(const char *name) { m_lbrm_prom = name; } + template <typename T> void set_screen_tag(T &&tag) { m_screen.set_tag(std::forward<T>(tag)); } + void set_draw_callback(draw_delegate callback) { m_draw = callback; } + template <class FunctionClass> void set_draw_callback(const char *devname, int (FunctionClass::*callback)(int, int, int, int, int, int, int, int), + const char *name) + { + set_draw_callback(draw_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr))); + } + template <class FunctionClass> void set_draw_callback(int (FunctionClass::*callback)(int, int, int, int, int, int, int, int), const char *name) + { + set_draw_callback(draw_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr))); + } + + // devcb3 accessors + auto fdt_r() { return m_fdt_r.bind(); } + auto fdt_w() { return m_fdt_w.bind(); } + auto status_in() { return m_status_in.bind(); } + // public interfaces uint8_t get_rip_status(); |