tvcexp_slot_device: converted to devcb2 (nw)
This commit is contained in:
parent
ba8ba29bb5
commit
1c45335184
@ -54,7 +54,9 @@ device_tvcexp_interface::~device_tvcexp_interface()
|
|||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
tvcexp_slot_device::tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
tvcexp_slot_device::tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||||
device_t(mconfig, TVCEXP_SLOT, "TVC64 Expansion Slot", tag, owner, clock, "tvcexp_slot", __FILE__),
|
device_t(mconfig, TVCEXP_SLOT, "TVC64 Expansion Slot", tag, owner, clock, "tvcexp_slot", __FILE__),
|
||||||
device_slot_interface(mconfig, *this)
|
device_slot_interface(mconfig, *this),
|
||||||
|
m_out_irq_cb(*this),
|
||||||
|
m_out_nmi_cb(*this)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,34 +77,10 @@ void tvcexp_slot_device::device_start()
|
|||||||
m_cart = dynamic_cast<device_tvcexp_interface *>(get_card_device());
|
m_cart = dynamic_cast<device_tvcexp_interface *>(get_card_device());
|
||||||
|
|
||||||
// resolve callbacks
|
// resolve callbacks
|
||||||
m_out_irq_func.resolve(m_out_irq_cb, *this);
|
m_out_irq_cb.resolve_safe();
|
||||||
m_out_nmi_func.resolve(m_out_nmi_cb, *this);
|
m_out_nmi_cb.resolve_safe();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
|
||||||
// device_config_complete - perform any
|
|
||||||
// operations now that the configuration is
|
|
||||||
// complete
|
|
||||||
//-------------------------------------------------
|
|
||||||
|
|
||||||
void tvcexp_slot_device::device_config_complete()
|
|
||||||
{
|
|
||||||
// inherit a copy of the static data
|
|
||||||
const tvcexp_interface *intf = reinterpret_cast<const tvcexp_interface *>(static_config());
|
|
||||||
if (intf != NULL)
|
|
||||||
{
|
|
||||||
*static_cast<tvcexp_interface *>(this) = *intf;
|
|
||||||
}
|
|
||||||
|
|
||||||
// or initialize to defaults if none provided
|
|
||||||
else
|
|
||||||
{
|
|
||||||
memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
|
|
||||||
memset(&m_out_nmi_cb, 0, sizeof(m_out_nmi_cb));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
module id read
|
module id read
|
||||||
-------------------------------------------------*/
|
-------------------------------------------------*/
|
||||||
|
@ -61,15 +61,6 @@
|
|||||||
TYPE DEFINITIONS
|
TYPE DEFINITIONS
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
// ======================> tvcexp_interface
|
|
||||||
|
|
||||||
struct tvcexp_interface
|
|
||||||
{
|
|
||||||
devcb_write_line m_out_irq_cb;
|
|
||||||
devcb_write_line m_out_nmi_cb;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// ======================> device_tvcexp_interface
|
// ======================> device_tvcexp_interface
|
||||||
|
|
||||||
class device_tvcexp_interface : public device_slot_card_interface
|
class device_tvcexp_interface : public device_slot_card_interface
|
||||||
@ -92,17 +83,18 @@ public:
|
|||||||
// ======================> tvcexp_slot_device
|
// ======================> tvcexp_slot_device
|
||||||
|
|
||||||
class tvcexp_slot_device : public device_t,
|
class tvcexp_slot_device : public device_t,
|
||||||
public tvcexp_interface,
|
|
||||||
public device_slot_interface
|
public device_slot_interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||||
virtual ~tvcexp_slot_device();
|
virtual ~tvcexp_slot_device();
|
||||||
|
|
||||||
|
template<class _Object> static devcb2_base &set_out_irq_callback(device_t &device, _Object object) { return downcast<tvcexp_slot_device &>(device).m_out_irq_cb.set_callback(object); }
|
||||||
|
template<class _Object> static devcb2_base &set_out_nmi_callback(device_t &device, _Object object) { return downcast<tvcexp_slot_device &>(device).m_out_nmi_cb.set_callback(object); }
|
||||||
|
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
virtual void device_config_complete();
|
|
||||||
|
|
||||||
// reading and writing
|
// reading and writing
|
||||||
virtual UINT8 id_r();
|
virtual UINT8 id_r();
|
||||||
@ -113,8 +105,8 @@ public:
|
|||||||
virtual DECLARE_READ8_MEMBER(io_read);
|
virtual DECLARE_READ8_MEMBER(io_read);
|
||||||
virtual DECLARE_WRITE8_MEMBER(io_write);
|
virtual DECLARE_WRITE8_MEMBER(io_write);
|
||||||
|
|
||||||
devcb_resolved_write_line m_out_irq_func;
|
devcb2_write_line m_out_irq_cb;
|
||||||
devcb_resolved_write_line m_out_nmi_func;
|
devcb2_write_line m_out_nmi_cb;
|
||||||
|
|
||||||
device_tvcexp_interface* m_cart;
|
device_tvcexp_interface* m_cart;
|
||||||
};
|
};
|
||||||
@ -127,8 +119,12 @@ extern const device_type TVCEXP_SLOT;
|
|||||||
DEVICE CONFIGURATION MACROS
|
DEVICE CONFIGURATION MACROS
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#define MCFG_TVC64_EXPANSION_ADD(_tag,_config,_slot_intf,_def_slot) \
|
// MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||||
MCFG_DEVICE_ADD(_tag, TVCEXP_SLOT, 0) \
|
|
||||||
MCFG_DEVICE_CONFIG(_config) \
|
#define MCFG_TVCEXP_SLOT_OUT_IRQ_CB(_devcb) \
|
||||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
devcb = &tvcexp_slot_device::set_out_irq_callback(*device, DEVCB2_##_devcb);
|
||||||
|
|
||||||
|
#define MCFG_TVCEXP_SLOT_OUT_NMI_CB(_devcb) \
|
||||||
|
devcb = &tvcexp_slot_device::set_out_nmi_callback(*device, DEVCB2_##_devcb);
|
||||||
|
|
||||||
#endif /* __TVCEXP_H__ */
|
#endif /* __TVCEXP_H__ */
|
||||||
|
@ -657,12 +657,6 @@ static const cassette_interface tvc_cassette_interface =
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static const tvcexp_interface tvc_exp_interface =
|
|
||||||
{
|
|
||||||
DEVCB_CPU_INPUT_LINE("maincpu", 0),
|
|
||||||
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_NMI),
|
|
||||||
};
|
|
||||||
|
|
||||||
extern SLOT_INTERFACE_START(tvc_exp)
|
extern SLOT_INTERFACE_START(tvc_exp)
|
||||||
SLOT_INTERFACE("hbf", TVC_HBF) // Videoton HBF floppy interface
|
SLOT_INTERFACE("hbf", TVC_HBF) // Videoton HBF floppy interface
|
||||||
SLOT_INTERFACE_END
|
SLOT_INTERFACE_END
|
||||||
@ -710,10 +704,22 @@ static MACHINE_CONFIG_START( tvc, tvc_state )
|
|||||||
MCFG_CARTSLOT_INTERFACE("tvc_cart")
|
MCFG_CARTSLOT_INTERFACE("tvc_cart")
|
||||||
|
|
||||||
/* expansion interface */
|
/* expansion interface */
|
||||||
MCFG_TVC64_EXPANSION_ADD("exp1", tvc_exp_interface, tvc_exp , NULL)
|
MCFG_DEVICE_ADD("exp1", TVCEXP_SLOT, 0)
|
||||||
MCFG_TVC64_EXPANSION_ADD("exp2", tvc_exp_interface, tvc_exp , NULL)
|
MCFG_DEVICE_SLOT_INTERFACE(tvc_exp , NULL, false)
|
||||||
MCFG_TVC64_EXPANSION_ADD("exp3", tvc_exp_interface, tvc_exp , NULL)
|
MCFG_TVCEXP_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0))
|
||||||
MCFG_TVC64_EXPANSION_ADD("exp4", tvc_exp_interface, tvc_exp , NULL)
|
MCFG_TVCEXP_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
|
||||||
|
MCFG_DEVICE_ADD("exp2", TVCEXP_SLOT, 0)
|
||||||
|
MCFG_DEVICE_SLOT_INTERFACE(tvc_exp , NULL, false)
|
||||||
|
MCFG_TVCEXP_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0))
|
||||||
|
MCFG_TVCEXP_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
|
||||||
|
MCFG_DEVICE_ADD("exp3", TVCEXP_SLOT, 0)
|
||||||
|
MCFG_DEVICE_SLOT_INTERFACE(tvc_exp , NULL, false)
|
||||||
|
MCFG_TVCEXP_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0))
|
||||||
|
MCFG_TVCEXP_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
|
||||||
|
MCFG_DEVICE_ADD("exp4", TVCEXP_SLOT, 0)
|
||||||
|
MCFG_DEVICE_SLOT_INTERFACE(tvc_exp , NULL, false)
|
||||||
|
MCFG_TVCEXP_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0))
|
||||||
|
MCFG_TVCEXP_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
|
||||||
|
|
||||||
/* cassette */
|
/* cassette */
|
||||||
MCFG_CASSETTE_ADD( "cassette", tvc_cassette_interface )
|
MCFG_CASSETTE_ADD( "cassette", tvc_cassette_interface )
|
||||||
|
Loading…
Reference in New Issue
Block a user