From 504129eff898dabd7e190c2195564881da0cfa53 Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 22 Jun 2018 12:08:53 -0400 Subject: mystston.cpp: Eliminate machine().device (nw) --- src/mame/drivers/mystston.cpp | 5 ++--- src/mame/includes/mystston.h | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mame/drivers/mystston.cpp b/src/mame/drivers/mystston.cpp index aa64298b2f0..31f4308c654 100644 --- a/src/mame/drivers/mystston.cpp +++ b/src/mame/drivers/mystston.cpp @@ -19,7 +19,6 @@ #include "includes/mystston.h" #include "cpu/m6502/m6502.h" -#include "sound/ay8910.h" #include "speaker.h" @@ -80,14 +79,14 @@ WRITE8_MEMBER(mystston_state::mystston_ay8910_select_w) if (((*m_ay8910_select & 0x20) == 0x20) && ((data & 0x20) == 0x00)) { /* bit 4 goes to the 8910 #0 BC1 pin */ - machine().device("ay1")->data_address_w(space, *m_ay8910_select >> 4, *m_ay8910_data); + m_ay8910[0]->data_address_w(space, *m_ay8910_select >> 4, *m_ay8910_data); } /* bit 7 goes to 8910 #1 BDIR pin */ if (((*m_ay8910_select & 0x80) == 0x80) && ((data & 0x80) == 0x00)) { /* bit 6 goes to the 8910 #1 BC1 pin */ - machine().device("ay2")->data_address_w(space, *m_ay8910_select >> 6, *m_ay8910_data); + m_ay8910[1]->data_address_w(space, *m_ay8910_select >> 6, *m_ay8910_data); } *m_ay8910_select = data; diff --git a/src/mame/includes/mystston.h b/src/mame/includes/mystston.h index 089d2946573..3b250f43981 100644 --- a/src/mame/includes/mystston.h +++ b/src/mame/includes/mystston.h @@ -8,6 +8,7 @@ ***************************************************************************/ +#include "sound/ay8910.h" #include "emupal.h" #include "screen.h" @@ -20,6 +21,7 @@ class mystston_state : public driver_device public: mystston_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_ay8910(*this, "ay%u", 1U), m_ay8910_data(*this, "ay8910_data"), m_ay8910_select(*this, "ay8910_select"), m_bg_videoram(*this, "bg_videoram"), @@ -34,6 +36,7 @@ public: m_palette(*this, "palette") { } /* machine state */ + required_device_array m_ay8910; required_shared_ptr m_ay8910_data; required_shared_ptr m_ay8910_select; -- cgit v1.2.3