diff --git a/src/mame/audio/meadows.c b/src/mame/audio/meadows.c index 4a5ed0eaa07..f8ef6d6a151 100644 --- a/src/mame/audio/meadows.c +++ b/src/mame/audio/meadows.c @@ -32,7 +32,7 @@ SAMPLES_START( meadows_sh_start ) { meadows_state *state = device.machine().driver_data(); state->m_0c00 = state->m_0c01 = state->m_0c02 = state->m_0c03 = 0; - state->m_dac = 0; + state->m_dac_data = 0; state->m_dac_enable = 0; state->m_channel = 0; state->m_freq1 = state->m_freq2 = 1000; @@ -94,9 +94,9 @@ void meadows_sh_update(running_machine &machine) state->m_dac_enable = state->m_0c03 & ENABLE_DAC; if (state->m_dac_enable) - machine.device("dac")->write_unsigned8(state->m_dac); + state->m_dac->write_unsigned8(state->m_dac_data); else - machine.device("dac")->write_unsigned8(0); + state->m_dac->write_unsigned8(0); } state->m_latched_0c01 = state->m_0c01; @@ -110,9 +110,9 @@ void meadows_sh_update(running_machine &machine) void meadows_sh_dac_w(running_machine &machine, int data) { meadows_state *state = machine.driver_data(); - state->m_dac = data; + state->m_dac_data = data; if (state->m_dac_enable) - machine.device("dac")->write_unsigned8(state->m_dac); + state->m_dac->write_unsigned8(state->m_dac_data); else - machine.device("dac")->write_unsigned8(0); + state->m_dac->write_unsigned8(0); } diff --git a/src/mame/drivers/namcos1.c b/src/mame/drivers/namcos1.c index 0e8452bb288..9d77ecbd67f 100644 --- a/src/mame/drivers/namcos1.c +++ b/src/mame/drivers/namcos1.c @@ -384,7 +384,7 @@ WRITE8_MEMBER(namcos1_state::namcos1_coin_w) static void namcos1_update_DACs(running_machine &machine) { namcos1_state *state = machine.driver_data(); - machine.device("dac")->write_signed16(0x8000 + (state->m_dac0_value * state->m_dac0_gain) + (state->m_dac1_value * state->m_dac1_gain)); + state->m_dac->write_signed16(0x8000 + (state->m_dac0_value * state->m_dac0_gain) + (state->m_dac1_value * state->m_dac1_gain)); } void namcos1_init_DACs(running_machine &machine) diff --git a/src/mame/includes/meadows.h b/src/mame/includes/meadows.h index fb45ae515c2..50ea36403d5 100644 --- a/src/mame/includes/meadows.h +++ b/src/mame/includes/meadows.h @@ -3,7 +3,7 @@ Meadows S2650 hardware *************************************************************************/ - +#include "sound/dac.h" #include "sound/samples.h" class meadows_state : public driver_device @@ -13,11 +13,12 @@ public: : driver_device(mconfig, type, tag), m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_dac(*this, "dac") { } optional_shared_ptr m_spriteram; required_shared_ptr m_videoram; - UINT8 m_dac; + UINT8 m_dac_data; int m_dac_enable; int m_channel; int m_freq1; @@ -52,6 +53,7 @@ public: INTERRUPT_GEN_MEMBER(audio_interrupt); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip); required_device m_maincpu; + optional_device m_dac; }; diff --git a/src/mame/includes/namcos1.h b/src/mame/includes/namcos1.h index 0ce13a74681..0add239d67f 100644 --- a/src/mame/includes/namcos1.h +++ b/src/mame/includes/namcos1.h @@ -1,3 +1,4 @@ +#include "sound/dac.h" #define NAMCOS1_MAX_BANK 0x400 /* Bank handler definitions */ @@ -17,7 +18,8 @@ public: m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_subcpu(*this, "sub"), - m_mcu(*this, "mcu") { } + m_mcu(*this, "mcu"), + m_dac(*this, "dac") { } int m_dac0_value; int m_dac1_value; @@ -103,6 +105,7 @@ public: required_device m_audiocpu; required_device m_subcpu; required_device m_mcu; + required_device m_dac; }; /*----------- defined in drivers/namcos1.c -----------*/