summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2020-03-31 14:33:28 +0200
committer Olivier Galibert <galibert@pobox.com>2020-03-31 14:46:55 +0200
commitc3c45bb12fea299b43e0883cf9e7c2ab5d04a95c (patch)
tree95c1e52313f1ffd32c14363f1ff5dd00b7ab54c0 /src/mame
parent9d16d76f999e8430d4bd1ec32fd8d12ef9419461 (diff)
Fix some deprecations (nw)
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/konamim2.cpp4
-rw-r--r--src/mame/machine/3dom2.cpp18
-rw-r--r--src/mame/machine/3dom2.h13
3 files changed, 13 insertions, 22 deletions
diff --git a/src/mame/drivers/konamim2.cpp b/src/mame/drivers/konamim2.cpp
index 1c3d8ac46fb..400814a14bf 100644
--- a/src/mame/drivers/konamim2.cpp
+++ b/src/mame/drivers/konamim2.cpp
@@ -1124,7 +1124,7 @@ void konamim2_state::konamim2(machine_config &config)
m_ppc2->set_addrmap(AS_PROGRAM, &konamim2_state::m2_map);
// M2 hardware
- M2_BDA(config, m_bda, M2_CLOCK, m_ppc1, m_ppc2);
+ M2_BDA(config, m_bda, M2_CLOCK, m_ppc1, m_ppc2, m_cde);
m_bda->set_ram_size(m2_bda_device::RAM_8MB, m2_bda_device::RAM_8MB);
m_bda->subdevice<m2_powerbus_device>("powerbus")->int_handler().set(FUNC(konamim2_state::ppc1_int));
m_bda->subdevice<m2_memctl_device>("memctl")->gpio_out_handler<3>().set(FUNC(konamim2_state::ppc2_int)).invert();
@@ -1133,7 +1133,7 @@ void konamim2_state::konamim2(machine_config &config)
m_bda->ldac_handler().set(FUNC(konamim2_state::ldac_out));
m_bda->rdac_handler().set(FUNC(konamim2_state::rdac_out));
- M2_CDE(config, m_cde, M2_CLOCK, m_ppc1);
+ M2_CDE(config, m_cde, M2_CLOCK, m_ppc1, m_bda);
m_cde->int_handler().set(":bda:powerbus", FUNC(m2_powerbus_device::int_line<BDAINT_EXTD4_LINE>));
m_cde->set_syscfg(SYSCONFIG_ARCADE);
m_cde->sdbg_out().set(FUNC(konamim2_state::cde_sdbg_out));
diff --git a/src/mame/machine/3dom2.cpp b/src/mame/machine/3dom2.cpp
index b6bc96e2f7b..34082c729c4 100644
--- a/src/mame/machine/3dom2.cpp
+++ b/src/mame/machine/3dom2.cpp
@@ -213,6 +213,7 @@ m2_bda_device::m2_bda_device(const machine_config &mconfig, const char *tag, dev
device_t(mconfig, M2_BDA, tag, owner, clock),
m_cpu1(*this, finder_base::DUMMY_TAG),
m_cpu2(*this, finder_base::DUMMY_TAG),
+ m_cde(*this, finder_base::DUMMY_TAG),
m_videores_in(*this),
m_memctl(*this, "memctl"),
m_powerbus(*this, "powerbus"),
@@ -478,14 +479,7 @@ void m2_bda_device::configure_ppc_address_map(address_space &space)
space.install_readwrite_handler(CPUID_BASE, CPUID_BASE + DEVICE_MASK, read32_delegate(*this, FUNC(m2_bda_device::cpu_id_r)), write32_delegate(*this, FUNC(m2_bda_device::cpu_id_w)), 0xffffffffffffffffULL);
-
- // Find and install the CDE
- m2_cde_device *cde = downcast<m2_cde_device *>(machine().device("cde"));
-
- if (!cde)
- throw emu_fatalerror("BDA: Could not find the CDE device!");
-
- space.install_readwrite_handler(SLOT4_BASE, SLOT4_BASE + SLOT_MASK, read32_delegate(*cde, FUNC(m2_cde_device::read)), write32_delegate(*cde, FUNC(m2_cde_device::write)), 0xffffffffffffffffULL);
+ space.install_readwrite_handler(SLOT4_BASE, SLOT4_BASE + SLOT_MASK, read32_delegate(*m_cde, FUNC(m2_cde_device::read)), write32_delegate(*m_cde, FUNC(m2_cde_device::write)), 0xffffffffffffffffULL);
}
@@ -1497,6 +1491,7 @@ WRITE32_MEMBER( m2_ctrlport_device::write )
m2_cde_device::m2_cde_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, M2_CDE, tag, owner, clock),
m_cpu1(*this, finder_base::DUMMY_TAG),
+ m_bda(*this, finder_base::DUMMY_TAG),
m_int_handler(*this),
m_sdbg_out_handler(*this)
{
@@ -1509,13 +1504,6 @@ m2_cde_device::m2_cde_device(const machine_config &mconfig, const char *tag, dev
void m2_cde_device::device_start()
{
- // Find our friend the BDA
- m_bda = downcast<m2_bda_device *>(machine().device("bda"));
- assert(m_bda != nullptr);
-
- if (m_bda == nullptr)
- throw device_missing_dependencies();
-
// Resolve callbacks
m_int_handler.resolve_safe();
m_sdbg_out_handler.resolve_safe();
diff --git a/src/mame/machine/3dom2.h b/src/mame/machine/3dom2.h
index 4e59f116ec4..137f9dce6cf 100644
--- a/src/mame/machine/3dom2.h
+++ b/src/mame/machine/3dom2.h
@@ -119,12 +119,13 @@ public:
RAM_16MB = 16
};
- template <typename T, typename U>
- m2_bda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu1_tag, U &&cpu2_tag)
+ template <typename T, typename U, typename V>
+ m2_bda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu1_tag, U &&cpu2_tag, V &&cde_tag)
: m2_bda_device(mconfig, tag, owner, clock)
{
m_cpu1.set_tag(std::forward<T>(cpu1_tag));
m_cpu2.set_tag(std::forward<U>(cpu2_tag));
+ m_cde.set_tag(std::forward<V>(cde_tag));
}
m2_bda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -211,6 +212,7 @@ private:
public: // TODO: THIS SHOULD NOT BE PUBLIC
required_device<ppc_device> m_cpu1;
required_device<ppc_device> m_cpu2;
+ required_device<m2_cde_device> m_cde;
devcb_read_line m_videores_in;
// Sub-devices
@@ -505,11 +507,12 @@ private:
class m2_cde_device : public device_t
{
public:
- template <typename T>
- m2_cde_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu1_tag)
+ template <typename T, typename U>
+ m2_cde_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu1_tag, U &&bda_tag)
: m2_cde_device(mconfig, tag, owner, clock)
{
m_cpu1.set_tag(std::forward<T>(cpu1_tag));
+ m_bda.set_tag(std::forward<U>(bda_tag));
}
m2_cde_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -701,7 +704,7 @@ private:
}
required_device<ppc_device> m_cpu1;
- m2_bda_device *m_bda; // todo
+ required_device<m2_bda_device> m_bda;
devcb_write_line m_int_handler;
devcb_write32 m_sdbg_out_handler;