diff options
Diffstat (limited to 'src/devices/bus/pofo/exp.h')
-rw-r--r-- | src/devices/bus/pofo/exp.h | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/src/devices/bus/pofo/exp.h b/src/devices/bus/pofo/exp.h index ab0685d28ca..2206d5af2fe 100644 --- a/src/devices/bus/pofo/exp.h +++ b/src/devices/bus/pofo/exp.h @@ -54,26 +54,6 @@ #define PORTFOLIO_EXPANSION_SLOT_TAG "exp" - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_PORTFOLIO_EXPANSION_SLOT_ADD(_tag, _clock, _slot_intf, _def_slot) \ - MCFG_DEVICE_ADD(_tag, PORTFOLIO_EXPANSION_SLOT, _clock) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - -#define MCFG_PORTFOLIO_EXPANSION_SLOT_EINT_CALLBACK(_write) \ - downcast<portfolio_expansion_slot_device &>(*device).set_eint_wr_callback(DEVCB_##_write); - -#define MCFG_PORTFOLIO_EXPANSION_SLOT_NMIO_CALLBACK(_write) \ - downcast<portfolio_expansion_slot_device &>(*device).set_nmio_wr_callback(DEVCB_##_write); - -#define MCFG_PORTFOLIO_EXPANSION_SLOT_WAKE_CALLBACK(_write) \ - downcast<portfolio_expansion_slot_device &>(*device).set_wake_wr_callback(DEVCB_##_write); - - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -92,8 +72,8 @@ public: virtual uint8_t iack_r() { return 0xff; } virtual uint8_t eack_r() { return 0xff; } - virtual uint8_t nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { return data; } - virtual void nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { } + virtual uint8_t nrdi_r(offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { return data; } + virtual void nwri_w(offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { } virtual WRITE_LINE_MEMBER( iint_w ) { } @@ -115,11 +95,21 @@ class portfolio_expansion_slot_device : public device_t, public device_slot_inte { public: // construction/destruction + template <typename T> + portfolio_expansion_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock, T &&opts, char const *dflt) + : portfolio_expansion_slot_device(mconfig, tag, owner, clock) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + portfolio_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_eint_wr_callback(Object &&cb) { return m_write_eint.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_nmio_wr_callback(Object &&cb) { return m_write_nmio.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_wake_wr_callback(Object &&cb) { return m_write_wake.set_callback(std::forward<Object>(cb)); } + auto eint_wr_callback() { return m_write_eint.bind(); } + auto nmio_wr_callback() { return m_write_nmio.bind(); } + auto wake_wr_callback() { return m_write_wake.bind(); } // computer interface bool nmd1_r() { return (m_card != nullptr) ? m_card->nmd1() : 1; } @@ -129,8 +119,8 @@ public: uint8_t iack_r() { return (m_card != nullptr) ? m_card->iack_r() : 0xff; }; uint8_t eack_r() { return (m_card != nullptr) ? m_card->eack_r() : 0xff; }; - uint8_t nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { return (m_card != nullptr) ? m_card->nrdi_r(space, offset, data, iom, bcom, ncc1) : data; } - void nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { if (m_card != nullptr) m_card->nwri_w(space, offset, data, iom, bcom, ncc1); } + uint8_t nrdi_r(offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { return (m_card != nullptr) ? m_card->nrdi_r(offset, data, iom, bcom, ncc1) : data; } + void nwri_w(offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { if (m_card != nullptr) m_card->nwri_w(offset, data, iom, bcom, ncc1); } WRITE_LINE_MEMBER( iint_w ) { if (m_card != nullptr) m_card->iint_w(state); } |