diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2018-07-04 07:24:36 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2018-07-04 07:24:36 -0400 |
commit | 8190d3b13ec646517dc918b00e981915ee2db91d (patch) | |
tree | 307ddb192c3ad36df70ff5a948ea928b5d8bbfcc | |
parent | 5ba14be3b9828753be0e88113fcc0dd2ccfa9bfd (diff) |
megazone: Eliminate machine().device (nw)
-rw-r--r-- | src/mame/drivers/megazone.cpp | 8 | ||||
-rw-r--r-- | src/mame/includes/megazone.h | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/mame/drivers/megazone.cpp b/src/mame/drivers/megazone.cpp index 5ae97473740..659132eed99 100644 --- a/src/mame/drivers/megazone.cpp +++ b/src/mame/drivers/megazone.cpp @@ -72,7 +72,6 @@ REAR BOARD 1C026 N/U (CUSTOM ON ORIGINAL) #include "machine/watchdog.h" #include "sound/ay8910.h" #include "sound/dac.h" -#include "sound/flt_rc.h" #include "sound/volt_reg.h" #include "screen.h" #include "speaker.h" @@ -99,10 +98,7 @@ READ8_MEMBER(megazone_state::megazone_port_a_r) WRITE8_MEMBER(megazone_state::megazone_port_b_w) { - static const char *const fltname[] = { "filter.0.0", "filter.0.1", "filter.0.2" }; - int i; - - for (i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) { int C = 0; if (data & 1) @@ -111,7 +107,7 @@ WRITE8_MEMBER(megazone_state::megazone_port_b_w) C += 220000; /* 220000pF = 0.22uF */ data >>= 2; - downcast<filter_rc_device*>(machine().device(fltname[i]))->filter_rc_set_RC(filter_rc_device::LOWPASS, 1000, 2200, 200, CAP_P(C)); + m_filter[i]->filter_rc_set_RC(filter_rc_device::LOWPASS, 1000, 2200, 200, CAP_P(C)); } } diff --git a/src/mame/includes/megazone.h b/src/mame/includes/megazone.h index 423ee0cb3cb..3c71bd48ecd 100644 --- a/src/mame/includes/megazone.h +++ b/src/mame/includes/megazone.h @@ -6,6 +6,7 @@ *************************************************************************/ +#include "sound/flt_rc.h" #include "emupal.h" class megazone_state : public driver_device @@ -24,7 +25,9 @@ public: m_audiocpu(*this, "audiocpu"), m_daccpu(*this, "daccpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_filter(*this, "filter.0.%u", 0U) + { } void megazone(machine_config &config); @@ -51,6 +54,7 @@ private: required_device<cpu_device> m_daccpu; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; + required_device_array<filter_rc_device, 3> m_filter; uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(megazone_i8039_irq_w); |