diff --git a/src/mame/includes/snes.h b/src/mame/includes/snes.h index 7e911878f2e..8464c316715 100644 --- a/src/mame/includes/snes.h +++ b/src/mame/includes/snes.h @@ -580,7 +580,11 @@ class snes_state : public driver_device { public: snes_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) { } + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_soundcpu(*this, "soundcpu"), + m_spc700(*this, "spc700"), + m_superfx(*this, "superfx") { } /* misc */ UINT16 m_hblank_offset; @@ -649,10 +653,10 @@ public: UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); /* devices */ - _5a22_device *m_maincpu; - spc700_device *m_soundcpu; - snes_sound_device *m_spc700; - cpu_device *m_superfx; + required_device<_5a22_device> m_maincpu; + required_device m_soundcpu; + required_device m_spc700; + optional_device m_superfx; upd7725_device *m_upd7725; upd96050_device *m_upd96050; diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c index edef9075fdd..1cf6d746028 100644 --- a/src/mame/machine/snes.c +++ b/src/mame/machine/snes.c @@ -1054,12 +1054,6 @@ void snes_state::snes_init_ram() MACHINE_START( snes ) { snes_state *state = machine.driver_data(); - - state->m_maincpu = machine.device<_5a22_device>("maincpu"); - state->m_soundcpu = machine.device("soundcpu"); - state->m_spc700 = machine.device("spc700"); - state->m_superfx = machine.device("superfx"); - // power-on sets these registers like this SNES_CPU_REG_STATE(WRIO) = 0xff; // SNES_CPU_REG_STATE(WRMPYA) = 0xff;