diff options
author | mooglyguy <therealmogminer@gmail.com> | 2018-06-17 09:10:21 +0200 |
---|---|---|
committer | mooglyguy <therealmogminer@gmail.com> | 2018-06-17 09:10:43 +0200 |
commit | c88b846931fe58a7024e331ee46f9fcff2dca95b (patch) | |
tree | 8cd9e9b48ad48bf788315daa7653606b14979e8e | |
parent | 22ba8d40ddb2b1e61d812bf59a38d9f9c805299f (diff) |
seicopbl: Removed machine().device, nw
-rw-r--r-- | src/mame/drivers/seicupbl.cpp | 2 | ||||
-rw-r--r-- | src/mame/machine/seicopbl.cpp | 6 | ||||
-rw-r--r-- | src/mame/machine/seicopbl.h | 14 |
3 files changed, 13 insertions, 9 deletions
diff --git a/src/mame/drivers/seicupbl.cpp b/src/mame/drivers/seicupbl.cpp index 825064b1fbd..8333f8c786c 100644 --- a/src/mame/drivers/seicupbl.cpp +++ b/src/mame/drivers/seicupbl.cpp @@ -563,7 +563,7 @@ MACHINE_CONFIG_START(seicupbl_state::cupsocbl) MCFG_DEVICE_PROGRAM_MAP(cupsocbl_mem) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seicupbl_state, irq4_line_hold) /* VBL */ - MCFG_DEVICE_SEIBUCOP_BOOTLEG_ADD("seibucop_boot") + MCFG_DEVICE_ADD("seibucop_boot", SEIBU_COP_BOOTLEG, "maincpu") /*Different Sound hardware*/ MCFG_DEVICE_ADD("audiocpu", Z80,14318180/4) diff --git a/src/mame/machine/seicopbl.cpp b/src/mame/machine/seicopbl.cpp index 8489b669723..b6db3793117 100644 --- a/src/mame/machine/seicopbl.cpp +++ b/src/mame/machine/seicopbl.cpp @@ -405,8 +405,9 @@ void seibu_cop_bootleg_device::seibucopbl_map(address_map &map) seibu_cop_bootleg_device::seibu_cop_bootleg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEIBU_COP_BOOTLEG, tag, owner, clock), - device_memory_interface(mconfig, *this), - m_space_config("regs", ENDIANNESS_BIG, 16, 9, 0, address_map_constructor(), address_map_constructor(FUNC(seibu_cop_bootleg_device::seibucopbl_map), this)) + device_memory_interface(mconfig, *this), + m_host_cpu(*this, finder_base::DUMMY_TAG), + m_space_config("regs", ENDIANNESS_BIG, 16, 9, 0, address_map_constructor(), address_map_constructor(FUNC(seibu_cop_bootleg_device::seibucopbl_map), this)) { } @@ -435,7 +436,6 @@ void seibu_cop_bootleg_device::device_start() void seibu_cop_bootleg_device::device_reset() { - m_host_cpu = machine().device<cpu_device>("maincpu"); m_host_space = &m_host_cpu->space(AS_PROGRAM); } diff --git a/src/mame/machine/seicopbl.h b/src/mame/machine/seicopbl.h index 4951366f356..fe1f3192903 100644 --- a/src/mame/machine/seicopbl.h +++ b/src/mame/machine/seicopbl.h @@ -10,6 +10,13 @@ class seibu_cop_bootleg_device : public device_t, public device_memory_interface { public: + template <typename T> + seibu_cop_bootleg_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu_tag) + : seibu_cop_bootleg_device(mconfig, tag, owner, (uint32_t)0) + { + m_host_cpu.set_tag(std::forward<T>(cpu_tag)); + } + seibu_cop_bootleg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER( read ); @@ -39,8 +46,8 @@ protected: virtual space_config_vector memory_space_config() const override; private: - cpu_device *m_host_cpu; /**< reference to the host cpu */ - address_space *m_host_space; /**< reference to the host cpu space */ + required_device<cpu_device> m_host_cpu; + address_space *m_host_space; const address_space_config m_space_config; inline uint16_t read_word(offs_t address); inline void write_word(offs_t address, uint16_t data); @@ -56,7 +63,4 @@ private: DECLARE_DEVICE_TYPE(SEIBU_COP_BOOTLEG, seibu_cop_bootleg_device) -#define MCFG_DEVICE_SEIBUCOP_BOOTLEG_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, SEIBU_COP_BOOTLEG, 0) - #endif // MAME_MACHINE_SEICOP_H |