summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/namco06.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/namco06.h')
-rw-r--r--src/mame/machine/namco06.h63
1 files changed, 4 insertions, 59 deletions
diff --git a/src/mame/machine/namco06.h b/src/mame/machine/namco06.h
index bce93495248..f3bc2db42c2 100644
--- a/src/mame/machine/namco06.h
+++ b/src/mame/machine/namco06.h
@@ -6,74 +6,19 @@
#pragma once
-struct namco_06xx_config
-{
- const char *nmicpu;
- const char *chip0;
- const char *chip1;
- const char *chip2;
- const char *chip3;
-};
-
-
-#define MCFG_NAMCO_06XX_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, NAMCO_06XX, _clock)
-
-#define MCFG_NAMCO_06XX_MAINCPU(_tag) \
- downcast<namco_06xx_device &>(*device).set_maincpu(_tag);
-
-#define MCFG_NAMCO_06XX_READ_0_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_read_callback<0>(DEVCB_##_devcb);
-
-#define MCFG_NAMCO_06XX_READ_1_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_read_callback<1>(DEVCB_##_devcb);
-
-#define MCFG_NAMCO_06XX_READ_2_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_read_callback<2>(DEVCB_##_devcb);
-
-#define MCFG_NAMCO_06XX_READ_3_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_read_callback<3>(DEVCB_##_devcb);
-
-
-#define MCFG_NAMCO_06XX_READ_REQUEST_0_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_read_request_callback<0>(DEVCB_##_devcb);
-
-#define MCFG_NAMCO_06XX_READ_REQUEST_1_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_read_request_callback<1>(DEVCB_##_devcb);
-
-#define MCFG_NAMCO_06XX_READ_REQUEST_2_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_read_request_callback<2>(DEVCB_##_devcb);
-
-#define MCFG_NAMCO_06XX_READ_REQUEST_3_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_read_request_callback<3>(DEVCB_##_devcb);
-
-
-#define MCFG_NAMCO_06XX_WRITE_0_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_write_callback<0>(DEVCB_##_devcb);
-
-#define MCFG_NAMCO_06XX_WRITE_1_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_write_callback<1>(DEVCB_##_devcb);
-
-#define MCFG_NAMCO_06XX_WRITE_2_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_write_callback<2>(DEVCB_##_devcb);
-
-#define MCFG_NAMCO_06XX_WRITE_3_CB(_devcb) \
- downcast<namco_06xx_device &>(*device).set_write_callback<3>(DEVCB_##_devcb);
-
-
/* device get info callback */
class namco_06xx_device : public device_t
{
public:
namco_06xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void set_maincpu(const char *tag) { m_nmicpu.set_tag(tag); }
+ template <typename T> void set_maincpu(T &&tag) { m_nmicpu.set_tag(std::forward<T>(tag)); }
- template <unsigned N, class Object> devcb_base &set_read_callback(Object &&cb) { return m_read[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N> auto read_callback() { return m_read[N].bind(); }
- template <unsigned N, class Object> devcb_base &set_read_request_callback(Object &&cb) { return m_readreq[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N> auto read_request_callback() { return m_readreq[N].bind(); }
- template <unsigned N, class Object> devcb_base &set_write_callback(Object &&cb) { return m_write[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N> auto write_callback() { return m_write[N].bind(); }
DECLARE_READ8_MEMBER( data_r );
DECLARE_WRITE8_MEMBER( data_w );