summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/a2bus/a2eauxslot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/a2bus/a2eauxslot.cpp')
-rw-r--r--src/devices/bus/a2bus/a2eauxslot.cpp56
1 files changed, 29 insertions, 27 deletions
diff --git a/src/devices/bus/a2bus/a2eauxslot.cpp b/src/devices/bus/a2bus/a2eauxslot.cpp
index 7ad4f91c628..1b37eecde0a 100644
--- a/src/devices/bus/a2bus/a2eauxslot.cpp
+++ b/src/devices/bus/a2bus/a2eauxslot.cpp
@@ -2,9 +2,8 @@
// copyright-holders:R. Belmont
/***************************************************************************
- a2eauxslot.c - Apple IIe auxiliary slot and card emulation
-
- by R. Belmont
+ a2eauxslot.cpp - Apple IIe auxiliary slot and card emulation
+ by R. Belmont
***************************************************************************/
@@ -41,7 +40,7 @@ void a2eauxslot_slot_device::device_resolve_objects()
{
device_a2eauxslot_card_interface *const dev = get_card_device();
if (dev)
- dev->set_a2eauxslot_device(m_a2eauxslot.target());
+ dev->set_a2eauxslot(m_a2eauxslot.target(), tag());
}
//**************************************************************************
@@ -73,19 +72,6 @@ a2eauxslot_device::a2eauxslot_device(const machine_config &mconfig, device_type
}
//-------------------------------------------------
-// device_resolve_objects - resolve objects that
-// may be needed for other devices to set
-// initial conditions at start time
-//-------------------------------------------------
-
-void a2eauxslot_device::device_resolve_objects()
-{
- // resolve callbacks
- m_out_irq_cb.resolve_safe();
- m_out_nmi_cb.resolve_safe();
-}
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -114,8 +100,8 @@ void a2eauxslot_device::set_nmi_line(int state)
}
// interrupt request from a2eauxslot card
-WRITE_LINE_MEMBER( a2eauxslot_device::irq_w ) { m_out_irq_cb(state); }
-WRITE_LINE_MEMBER( a2eauxslot_device::nmi_w ) { m_out_nmi_cb(state); }
+void a2eauxslot_device::irq_w(int state) { m_out_irq_cb(state); }
+void a2eauxslot_device::nmi_w(int state) { m_out_nmi_cb(state); }
//**************************************************************************
// DEVICE CONFIG A2EAUXSLOT CARD INTERFACE
@@ -132,11 +118,33 @@ WRITE_LINE_MEMBER( a2eauxslot_device::nmi_w ) { m_out_nmi_cb(state); }
device_a2eauxslot_card_interface::device_a2eauxslot_card_interface(const machine_config &mconfig, device_t &device)
: device_interface(device, "a2eaux"),
- m_a2eauxslot(nullptr),
- m_slot(0), m_next(nullptr)
+ m_a2eauxslot_finder(device, finder_base::DUMMY_TAG), m_a2eauxslot(nullptr),
+ m_a2eauxslot_slottag(nullptr), m_slot(0), m_next(nullptr)
{
}
+void device_a2eauxslot_card_interface::interface_validity_check(validity_checker &valid) const
+{
+ if (m_a2eauxslot_finder && m_a2eauxslot && (m_a2eauxslot != m_a2eauxslot_finder))
+ osd_printf_error("Contradictory buses configured (%s and %s)\n", m_a2eauxslot_finder->tag(), m_a2eauxslot->tag());
+}
+
+void device_a2eauxslot_card_interface::interface_pre_start()
+{
+ if (!m_a2eauxslot)
+ {
+ m_a2eauxslot = m_a2eauxslot_finder;
+ if (!m_a2eauxslot)
+ fatalerror("Can't find Apple IIe Aux Slot device %s\n", m_a2eauxslot_finder.finder_tag());
+ }
+
+ if (!m_a2eauxslot->started())
+ {
+ throw device_missing_dependencies();
+ }
+
+ m_a2eauxslot->add_a2eauxslot_card(this);
+}
//-------------------------------------------------
// ~device_a2eauxslot_card_interface - destructor
@@ -145,9 +153,3 @@ device_a2eauxslot_card_interface::device_a2eauxslot_card_interface(const machine
device_a2eauxslot_card_interface::~device_a2eauxslot_card_interface()
{
}
-
-void device_a2eauxslot_card_interface::set_a2eauxslot_device(a2eauxslot_device *a2eauxslot)
-{
- m_a2eauxslot = a2eauxslot;
- m_a2eauxslot->add_a2eauxslot_card(this);
-}