summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/svi3x8/expander/expander.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
committer Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
commit97b67170277437131adf6ed4d60139c172529e4f (patch)
tree7a5cbf608f191075f1612b1af15832c206a3fe2d /src/devices/bus/svi3x8/expander/expander.h
parentb380514764cf857469bae61c11143a19f79a74c5 (diff)
(nw) Clean up the mess on master
This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
Diffstat (limited to 'src/devices/bus/svi3x8/expander/expander.h')
-rw-r--r--src/devices/bus/svi3x8/expander/expander.h74
1 files changed, 27 insertions, 47 deletions
diff --git a/src/devices/bus/svi3x8/expander/expander.h b/src/devices/bus/svi3x8/expander/expander.h
index 549a17c5970..cc7e75f6332 100644
--- a/src/devices/bus/svi3x8/expander/expander.h
+++ b/src/devices/bus/svi3x8/expander/expander.h
@@ -40,36 +40,6 @@
#pragma once
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_SVI_EXPANDER_BUS_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, SVI_EXPANDER, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(svi_expander_modules, nullptr, false)
-#define MCFG_SVI_EXPANDER_INT_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_int_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_ROMDIS_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_romdis_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_RAMDIS_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_ramdis_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_CTRL1_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_ctrl1_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_CTRL2_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_ctrl2_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_EXCSR_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_excsr_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_EXCSW_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_excsw_handler(DEVCB_##_devcb);
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -82,17 +52,27 @@ class svi_expander_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
+ template <typename T>
+ svi_expander_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts)
+ : svi_expander_device(mconfig, tag, owner, uint32_t(0))
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(nullptr);
+ set_fixed(false);
+ }
+
svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~svi_expander_device();
// callbacks
- template <class Object> devcb_base &set_int_handler(Object &&cb) { return m_int_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_romdis_handler(Object &&cb) { return m_romdis_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ramdis_handler(Object &&cb) { return m_ramdis_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ctrl1_handler(Object &&cb) { return m_ctrl1_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ctrl2_handler(Object &&cb) { return m_ctrl2_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_excsr_handler(Object &&cb) { return m_excsr_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_excsw_handler(Object &&cb) { return m_excsw_handler.set_callback(std::forward<Object>(cb)); }
+ auto int_handler() { return m_int_handler.bind(); }
+ auto romdis_handler() { return m_romdis_handler.bind(); }
+ auto ramdis_handler() { return m_ramdis_handler.bind(); }
+ auto ctrl1_handler() { return m_ctrl1_handler.bind(); }
+ auto ctrl2_handler() { return m_ctrl2_handler.bind(); }
+ auto excsr_handler() { return m_excsr_handler.bind(); }
+ auto excsw_handler() { return m_excsw_handler.bind(); }
// called from cart device
DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); }
@@ -101,14 +81,14 @@ public:
DECLARE_WRITE_LINE_MEMBER( ctrl1_w ) { m_ctrl1_handler(state); }
DECLARE_WRITE_LINE_MEMBER( ctrl2_w ) { m_ctrl2_handler(state); }
- DECLARE_READ8_MEMBER( excs_r ) { return m_excsr_handler(space, offset); }
- DECLARE_WRITE8_MEMBER( excs_w ) { m_excsw_handler(space, offset, data); }
+ uint8_t excs_r(offs_t offset) { return m_excsr_handler(offset); }
+ void excs_w(offs_t offset, uint8_t data) { m_excsw_handler(offset, data); }
// called from host
- DECLARE_READ8_MEMBER( mreq_r );
- DECLARE_WRITE8_MEMBER( mreq_w );
- DECLARE_READ8_MEMBER( iorq_r );
- DECLARE_WRITE8_MEMBER( iorq_w );
+ uint8_t mreq_r(offs_t offset);
+ void mreq_w(offs_t offset, uint8_t data);
+ uint8_t iorq_r(offs_t offset);
+ void iorq_w(offs_t offset, uint8_t data);
DECLARE_WRITE_LINE_MEMBER( bk21_w );
DECLARE_WRITE_LINE_MEMBER( bk22_w );
@@ -141,10 +121,10 @@ public:
// construction/destruction
virtual ~device_svi_expander_interface();
- virtual DECLARE_READ8_MEMBER( mreq_r ) { return 0xff; }
- virtual DECLARE_WRITE8_MEMBER( mreq_w ) { }
- virtual DECLARE_READ8_MEMBER( iorq_r ) { return 0xff; }
- virtual DECLARE_WRITE8_MEMBER( iorq_w ) { }
+ virtual uint8_t mreq_r(offs_t offset) { return 0xff; }
+ virtual void mreq_w(offs_t offset, uint8_t data) { }
+ virtual uint8_t iorq_r(offs_t offset) { return 0xff; }
+ virtual void iorq_w(offs_t offset, uint8_t data) { }
virtual void bk21_w(int state) { }
virtual void bk22_w(int state) { }