diff options
Diffstat (limited to 'src/devices/machine/53c810.h')
-rw-r--r-- | src/devices/machine/53c810.h | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/devices/machine/53c810.h b/src/devices/machine/53c810.h index 0e0d0743b14..b80c0aa2c4a 100644 --- a/src/devices/machine/53c810.h +++ b/src/devices/machine/53c810.h @@ -7,11 +7,6 @@ #include "legscsi.h" -#define LSI53C810_IRQ_CB(name) void name(int state) -#define LSI53C810_DMA_CB(name) void name(uint32_t src, uint32_t dst, int length, int byteswap) -#define LSI53C810_FETCH_CB(name) uint32_t name(uint32_t dsp) - - class lsi53c810_device : public legacy_scsi_host_adapter { public: @@ -20,11 +15,22 @@ public: typedef device_delegate<uint32_t (uint32_t dsp)> fetch_delegate; // construction/destruction - lsi53c810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + lsi53c810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + template <class FunctionClass> void set_irq_callback(void (FunctionClass::*callback)(int), const char *name) + { + m_irq_cb = irq_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)); + } + + template <class FunctionClass> void set_dma_callback(void (FunctionClass::*callback)(uint32_t, uint32_t, int, int), const char *name) + { + m_dma_cb = dma_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)); + } - template <typename Object> void set_irq_callback(Object &&cb) { m_irq_cb = std::forward<Object>(cb); } - template <typename Object> void set_dma_callback(Object &&cb) { m_dma_cb = std::forward<Object>(cb); } - template <typename Object> void set_fetch_callback(Object &&cb) { m_fetch_cb = std::forward<Object>(cb); } + template <class FunctionClass> void set_fetch_callback(uint32_t (FunctionClass::*callback)(uint32_t), const char *name) + { + m_fetch_cb = fetch_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)); + } uint8_t reg_r(int offset); void reg_w(int offset, uint8_t data); @@ -101,14 +107,4 @@ private: // device type definition DECLARE_DEVICE_TYPE(LSI53C810, lsi53c810_device) - -#define MCFG_LSI53C810_IRQ_CB(_class, _method) \ - downcast<lsi53c810_device &>(*device).set_irq_callback(lsi53c810_device::irq_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_LSI53C810_DMA_CB(_class, _method) \ - downcast<lsi53c810_device &>(*device).set_dma_callback(lsi53c810_device::dma_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_LSI53C810_FETCH_CB(_class, _method) \ - downcast<lsi53c810_device &>(*device).set_fetch_callback(lsi53c810_device::fetch_delegate(&_class::_method, #_class "::" #_method, this)); - #endif // MAME_MACHINE_53C810_H |