summaryrefslogtreecommitdiffstats
path: root/src/devices/bus/vip/exp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/vip/exp.h')
-rw-r--r--src/devices/bus/vip/exp.h62
1 files changed, 25 insertions, 37 deletions
diff --git a/src/devices/bus/vip/exp.h b/src/devices/bus/vip/exp.h
index dfca23fc038..9073dafee0d 100644
--- a/src/devices/bus/vip/exp.h
+++ b/src/devices/bus/vip/exp.h
@@ -46,27 +46,6 @@
#define VIP_EXPANSION_SLOT_TAG "exp"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_VIP_EXPANSION_SLOT_ADD(_tag, _clock, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, VIP_EXPANSION_SLOT, _clock) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
-
-#define MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(_write) \
- downcast<vip_expansion_slot_device &>(*device).set_int_wr_callback(DEVCB_##_write);
-
-#define MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(_write) \
- downcast<vip_expansion_slot_device &>(*device).set_dma_out_wr_callback(DEVCB_##_write);
-
-#define MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(_write) \
- downcast<vip_expansion_slot_device &>(*device).set_dma_in_wr_callback(DEVCB_##_write);
-
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -80,24 +59,33 @@ class vip_expansion_slot_device : public device_t,
{
public:
// construction/destruction
+ template <typename T>
+ vip_expansion_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock, T &&opts, char const *dflt)
+ : vip_expansion_slot_device(mconfig, tag, owner, clock)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_int_wr_callback(Object &&cb) { return m_write_int.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_dma_out_wr_callback(Object &&cb) { return m_write_dma_out.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_dma_in_wr_callback(Object &&cb) { return m_write_dma_in.set_callback(std::forward<Object>(cb)); }
+ auto int_wr_callback() { return m_write_int.bind(); }
+ auto dma_out_wr_callback() { return m_write_dma_out.bind(); }
+ auto dma_in_wr_callback() { return m_write_dma_in.bind(); }
// computer interface
- uint8_t program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh);
- void program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh);
- uint8_t io_r(address_space &space, offs_t offset);
- void io_w(address_space &space, offs_t offset, uint8_t data);
- DECLARE_READ8_MEMBER(dma_r);
- DECLARE_WRITE8_MEMBER(dma_w);
+ uint8_t program_r(offs_t offset, int cs, int cdef, int *minh);
+ void program_w(offs_t offset, uint8_t data, int cdef, int *minh);
+ uint8_t io_r(offs_t offset);
+ void io_w(offs_t offset, uint8_t data);
+ uint8_t dma_r(offs_t offset);
+ void dma_w(offs_t offset, uint8_t data);
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_READ_LINE_MEMBER(ef1_r);
DECLARE_READ_LINE_MEMBER(ef3_r);
DECLARE_READ_LINE_MEMBER(ef4_r);
- DECLARE_WRITE8_MEMBER(sc_w);
+ void sc_w(offs_t offset, uint8_t data);
DECLARE_WRITE_LINE_MEMBER(q_w);
DECLARE_WRITE_LINE_MEMBER(tpb_w);
DECLARE_WRITE_LINE_MEMBER(run_w);
@@ -130,14 +118,14 @@ protected:
device_vip_expansion_card_interface(const machine_config &mconfig, device_t &device);
// runtime
- virtual uint8_t vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) { return 0xff; }
- virtual void vip_program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) { }
+ virtual uint8_t vip_program_r(offs_t offset, int cs, int cdef, int *minh) { return 0xff; }
+ virtual void vip_program_w(offs_t offset, uint8_t data, int cdef, int *minh) { }
- virtual uint8_t vip_io_r(address_space &space, offs_t offset) { return 0xff; }
- virtual void vip_io_w(address_space &space, offs_t offset, uint8_t data) { }
+ virtual uint8_t vip_io_r(offs_t offset) { return 0xff; }
+ virtual void vip_io_w(offs_t offset, uint8_t data) { }
- virtual uint8_t vip_dma_r(address_space &space, offs_t offset) { return 0xff; }
- virtual void vip_dma_w(address_space &space, offs_t offset, uint8_t data) { }
+ virtual uint8_t vip_dma_r(offs_t offset) { return 0xff; }
+ virtual void vip_dma_w(offs_t offset, uint8_t data) { }
virtual uint32_t vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; }