diff options
Diffstat (limited to 'src/mess/machine/petcass.h')
-rw-r--r-- | src/mess/machine/petcass.h | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/mess/machine/petcass.h b/src/mess/machine/petcass.h index 99353ea657b..f8d0316b4ad 100644 --- a/src/mess/machine/petcass.h +++ b/src/mess/machine/petcass.h @@ -38,14 +38,10 @@ // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define PET_DATASSETTE_PORT_INTERFACE(_name) \ - const pet_datassette_port_interface (_name) = - - -#define MCFG_PET_DATASSETTE_PORT_ADD(_tag, _config, _slot_intf, _def_slot, _def_inp) \ +#define MCFG_PET_DATASSETTE_PORT_ADD(_tag, _slot_intf, _def_slot, _def_inp, _devcb) \ MCFG_DEVICE_ADD(_tag, PET_DATASSETTE_PORT, 0) \ - MCFG_DEVICE_CONFIG(_config) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) \ + devcb = &pet_datassette_port_device::set_read_handler(*device, DEVCB2_##_devcb); @@ -53,20 +49,11 @@ // TYPE DEFINITIONS //************************************************************************** -// ======================> pet_datassette_port_interface - -struct pet_datassette_port_interface -{ - devcb_write_line m_out_read_cb; -}; - - // ======================> pet_datassette_port_device class device_pet_datassette_port_interface; class pet_datassette_port_device : public device_t, - public pet_datassette_port_interface, public device_slot_interface { public: @@ -74,6 +61,9 @@ public: pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); virtual ~pet_datassette_port_device(); + // static configuration helpers + template<class _Object> static devcb2_base &set_read_handler(device_t &device, _Object object) { return downcast<pet_datassette_port_device &>(device).m_read_handler.set_callback(object); } + // computer interface DECLARE_READ_LINE_MEMBER( read ); DECLARE_WRITE_LINE_MEMBER( write ); @@ -85,10 +75,9 @@ public: protected: // device-level overrides - virtual void device_config_complete(); virtual void device_start(); - devcb_resolved_write_line m_out_read_func; + devcb2_write_line m_read_handler; device_pet_datassette_port_interface *m_cart; }; |