summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/cpc/cpcexp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/cpc/cpcexp.cpp')
-rw-r--r--src/devices/bus/cpc/cpcexp.cpp37
1 files changed, 11 insertions, 26 deletions
diff --git a/src/devices/bus/cpc/cpcexp.cpp b/src/devices/bus/cpc/cpcexp.cpp
index 3f9f04e89ea..c625ed4689e 100644
--- a/src/devices/bus/cpc/cpcexp.cpp
+++ b/src/devices/bus/cpc/cpcexp.cpp
@@ -25,7 +25,7 @@ DEFINE_DEVICE_TYPE(CPC_EXPANSION_SLOT, cpc_expansion_slot_device, "cpc_expansion
device_cpc_expansion_card_interface::device_cpc_expansion_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+ : device_interface(device, "cpcexp")
, m_rom_sel(0)
{
}
@@ -43,7 +43,7 @@ device_cpc_expansion_card_interface::~device_cpc_expansion_card_interface()
cpc_expansion_slot_device::cpc_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, CPC_EXPANSION_SLOT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_cpc_expansion_card_interface>(mconfig, *this)
, m_cpu(*this, finder_base::DUMMY_TAG)
, m_out_irq_cb(*this)
, m_out_nmi_cb(*this)
@@ -64,14 +64,7 @@ cpc_expansion_slot_device::~cpc_expansion_slot_device()
void cpc_expansion_slot_device::device_start()
{
- m_card = dynamic_cast<device_cpc_expansion_card_interface *>(get_card_device());
-
- // resolve callbacks
- m_out_irq_cb.resolve_safe();
- m_out_nmi_cb.resolve_safe();
- m_out_reset_cb.resolve_safe();
- m_out_romdis_cb.resolve_safe();
- m_out_rom_select.resolve_safe();
+ m_card = get_card_device();
}
//-------------------------------------------------
@@ -83,25 +76,17 @@ void cpc_expansion_slot_device::device_start()
void cpc_expansion_slot_device::device_config_complete()
{
// for passthrough connectors, use the parent slot's CPU tag
- if ((m_cpu.finder_tag() == finder_base::DUMMY_TAG) && (dynamic_cast<device_cpc_expansion_card_interface *>(owner()) != nullptr))
+ if ((m_cpu.finder_tag() == finder_base::DUMMY_TAG) && dynamic_cast<device_cpc_expansion_card_interface *>(owner()))
{
- auto parent = dynamic_cast<cpc_expansion_slot_device *>(owner()->owner());
- if (parent != nullptr)
+ auto const parent = dynamic_cast<cpc_expansion_slot_device *>(owner()->owner());
+ if (parent)
m_cpu.set_tag(parent->m_cpu);
}
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void cpc_expansion_slot_device::device_reset()
-{
-}
-
-WRITE_LINE_MEMBER( cpc_expansion_slot_device::irq_w ) { m_out_irq_cb(state); }
-WRITE_LINE_MEMBER( cpc_expansion_slot_device::nmi_w ) { m_out_nmi_cb(state); }
-WRITE_LINE_MEMBER( cpc_expansion_slot_device::reset_w ) { m_out_reset_cb(state); }
-WRITE_LINE_MEMBER( cpc_expansion_slot_device::romdis_w ) { m_out_romdis_cb(state); }
-WRITE8_MEMBER( cpc_expansion_slot_device::rom_select ) { m_out_rom_select(data); }
+void cpc_expansion_slot_device::irq_w(int state) { m_out_irq_cb(state); }
+void cpc_expansion_slot_device::nmi_w(int state) { m_out_nmi_cb(state); }
+void cpc_expansion_slot_device::reset_w(int state) { m_out_reset_cb(state); }
+void cpc_expansion_slot_device::romdis_w(int state) { m_out_romdis_cb(state); }
+void cpc_expansion_slot_device::rom_select(uint8_t data) { m_out_rom_select(data); }