summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/cpc/playcity.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-12-14 14:24:12 -0500
committer AJR <ajrhacker@users.noreply.github.com>2018-12-14 14:26:07 -0500
commit5384d7b24e9128e0d4905dbfd8afefd71bf50570 (patch)
tree7eb7214b4c0b819bd5a3383e68280f297b7200df /src/devices/bus/cpc/playcity.cpp
parentbde657fff1299dae958740280ea33bd98dafff5f (diff)
cpcexp: Modernization (nw)
- Replace MCFG_ macros with devcb3 - Remove most instances of machine().device - Add bus clock
Diffstat (limited to 'src/devices/bus/cpc/playcity.cpp')
-rw-r--r--src/devices/bus/cpc/playcity.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/devices/bus/cpc/playcity.cpp b/src/devices/bus/cpc/playcity.cpp
index 95a0a5f6c2b..548e35f4437 100644
--- a/src/devices/bus/cpc/playcity.cpp
+++ b/src/devices/bus/cpc/playcity.cpp
@@ -24,7 +24,8 @@ void cpc_exp_cards(device_slot_interface &device);
DEFINE_DEVICE_TYPE(CPC_PLAYCITY, cpc_playcity_device, "cpc_playcity", "PlayCity")
// device machine config
-MACHINE_CONFIG_START(cpc_playcity_device::device_add_mconfig)
+void cpc_playcity_device::device_add_mconfig(machine_config &config)
+{
Z80CTC(config, m_ctc, XTAL(4'000'000));
m_ctc->zc_callback<1>().set(FUNC(cpc_playcity_device::ctc_zc1_cb));
m_ctc->zc_callback<2>().set(m_ctc, FUNC(z80ctc_device::trg3));
@@ -38,13 +39,11 @@ MACHINE_CONFIG_START(cpc_playcity_device::device_add_mconfig)
m_ymz2->add_route(ALL_OUTPUTS, "lspeaker", 0.30);
// pass-through
- MCFG_DEVICE_ADD("exp", CPC_EXPANSION_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(cpc_exp_cards, nullptr, false)
- MCFG_CPC_EXPANSION_SLOT_OUT_IRQ_CB(WRITELINE("^", cpc_expansion_slot_device, irq_w))
- MCFG_CPC_EXPANSION_SLOT_OUT_NMI_CB(WRITELINE("^", cpc_expansion_slot_device, nmi_w))
- MCFG_CPC_EXPANSION_SLOT_OUT_ROMDIS_CB(WRITELINE("^", cpc_expansion_slot_device, romdis_w)) // ROMDIS
-
-MACHINE_CONFIG_END
+ cpc_expansion_slot_device &exp(CPC_EXPANSION_SLOT(config, "exp", DERIVED_CLOCK(1, 1), cpc_exp_cards, nullptr));
+ exp.irq_callback().set(DEVICE_SELF_OWNER, FUNC(cpc_expansion_slot_device::irq_w));
+ exp.nmi_callback().set(DEVICE_SELF_OWNER, FUNC(cpc_expansion_slot_device::nmi_w));
+ exp.romdis_callback().set(DEVICE_SELF_OWNER, FUNC(cpc_expansion_slot_device::romdis_w)); // ROMDIS
+}
//**************************************************************************
@@ -67,9 +66,8 @@ cpc_playcity_device::cpc_playcity_device(const machine_config &mconfig, const ch
void cpc_playcity_device::device_start()
{
- device_t* cpu = machine().device("maincpu");
- address_space& space = cpu->memory().space(AS_IO);
m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner());
+ address_space &space = m_slot->cpu().space(AS_IO);
space.install_readwrite_handler(0xf880,0xf883,read8_delegate(FUNC(cpc_playcity_device::ctc_r),this),write8_delegate(FUNC(cpc_playcity_device::ctc_w),this));
space.install_readwrite_handler(0xf884,0xf884,read8_delegate(FUNC(cpc_playcity_device::ymz1_data_r),this),write8_delegate(FUNC(cpc_playcity_device::ymz1_data_w),this));