seicopbl: Removed machine().device, nw

This commit is contained in:
mooglyguy 2018-06-17 09:10:21 +02:00
parent 22ba8d40dd
commit c88b846931
3 changed files with 13 additions and 9 deletions

View File

@ -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)

View File

@ -406,6 +406,7 @@ 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_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);
}

View File

@ -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