diff options
Diffstat (limited to 'src/devices/bus/a2bus/a2eauxslot.cpp')
-rw-r--r-- | src/devices/bus/a2bus/a2eauxslot.cpp | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/devices/bus/a2bus/a2eauxslot.cpp b/src/devices/bus/a2bus/a2eauxslot.cpp index 5fab40ba9ae..6885d528128 100644 --- a/src/devices/bus/a2bus/a2eauxslot.cpp +++ b/src/devices/bus/a2bus/a2eauxslot.cpp @@ -33,16 +33,20 @@ a2eauxslot_slot_device::a2eauxslot_slot_device(const machine_config &mconfig, co a2eauxslot_slot_device::a2eauxslot_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , device_slot_interface(mconfig, *this) - , m_a2eauxslot(*this, finder_base::DUMMY_TAG) + , m_a2eauxslot_tag(nullptr) + , m_a2eauxslot_slottag(nullptr) { } -void a2eauxslot_slot_device::device_resolve_objects() +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void a2eauxslot_slot_device::device_start() { device_a2eauxslot_card_interface *dev = dynamic_cast<device_a2eauxslot_card_interface *>(get_card_device()); - if (dev) - dev->set_a2eauxslot_device(m_a2eauxslot.target()); + if (dev) dev->set_a2eauxslot_tag(m_a2eauxslot_tag, m_a2eauxslot_slottag); } //************************************************************************** @@ -66,31 +70,34 @@ a2eauxslot_device::a2eauxslot_device(const machine_config &mconfig, const char * a2eauxslot_device::a2eauxslot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) - , m_space(*this, finder_base::DUMMY_TAG, -1) + , m_maincpu(nullptr) , m_out_irq_cb(*this) , m_out_nmi_cb(*this) , m_device(nullptr) + , m_cputag(nullptr) { } - //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time +// device_start - device-specific startup //------------------------------------------------- -void a2eauxslot_device::device_resolve_objects() +void a2eauxslot_device::device_start() { + m_maincpu = machine().device<cpu_device>(m_cputag); + // resolve callbacks m_out_irq_cb.resolve_safe(); m_out_nmi_cb.resolve_safe(); + + // clear slot + m_device = nullptr; } //------------------------------------------------- -// device_start - device-specific startup +// device_reset - device-specific reset //------------------------------------------------- -void a2eauxslot_device::device_start() +void a2eauxslot_device::device_reset() { } @@ -134,7 +141,7 @@ 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_slot_card_interface(mconfig, device), m_a2eauxslot(nullptr), - m_slot(0), m_next(nullptr) + m_a2eauxslot_tag(nullptr), m_a2eauxslot_slottag(nullptr), m_slot(0), m_next(nullptr) { } @@ -147,8 +154,8 @@ device_a2eauxslot_card_interface::~device_a2eauxslot_card_interface() { } -void device_a2eauxslot_card_interface::set_a2eauxslot_device(a2eauxslot_device *a2eauxslot) +void device_a2eauxslot_card_interface::set_a2eauxslot_device() { - m_a2eauxslot = a2eauxslot; + m_a2eauxslot = dynamic_cast<a2eauxslot_device *>(device().machine().device(m_a2eauxslot_tag)); m_a2eauxslot->add_a2eauxslot_card(this); } |