diff options
author | 2013-04-14 09:15:45 +0000 | |
---|---|---|
committer | 2013-04-14 09:15:45 +0000 | |
commit | ee30ffbc296cec7e8d9cc182779999a26190c1cf (patch) | |
tree | 7b9488f9b8627012fd68625b1a7a1888ffeaa2fe | |
parent | 339ae40d840c3244c2154ac2499b4155e8dfa3b7 (diff) |
"msm" lookup tag removal (nw)
102 files changed, 452 insertions, 368 deletions
diff --git a/src/mame/drivers/40love.c b/src/mame/drivers/40love.c index 65fc012458f..29b3a4db35f 100644 --- a/src/mame/drivers/40love.c +++ b/src/mame/drivers/40love.c @@ -696,30 +696,24 @@ MACHINE_RESET_MEMBER(fortyl_state,ta7630) WRITE8_MEMBER(fortyl_state::sound_control_0_w) { - device_t *device = machine().device("msm"); m_snd_ctrl0 = data & 0xff; // popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); /* this definitely controls main melody voice on 2'-1 and 4'-1 outputs */ - device_sound_interface *sound; - device->interface(sound); - sound->set_output_gain(0, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ - sound->set_output_gain(1, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ - sound->set_output_gain(2, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ - sound->set_output_gain(3, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(0, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(1, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(2, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(3, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ } WRITE8_MEMBER(fortyl_state::sound_control_1_w) { - device_t *device = machine().device("msm"); m_snd_ctrl1 = data & 0xff; // popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); - device_sound_interface *sound; - device->interface(sound); - sound->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - sound->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - sound->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - sound->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + m_msm->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + m_msm->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ } WRITE8_MEMBER(fortyl_state::sound_control_2_w) diff --git a/src/mame/drivers/appoooh.c b/src/mame/drivers/appoooh.c index 4ea05b32337..ecd434734aa 100644 --- a/src/mame/drivers/appoooh.c +++ b/src/mame/drivers/appoooh.c @@ -178,17 +178,17 @@ WRITE_LINE_MEMBER(appoooh_state::appoooh_adpcm_int) UINT8 *RAM = memregion("adpcm")->base(); m_adpcm_data = RAM[m_adpcm_address++]; - msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4); + msm5205_data_w(m_msm, m_adpcm_data >> 4); if (m_adpcm_data == 0x70) { m_adpcm_address = 0xffffffff; - msm5205_reset_w(machine().device("msm"), 1); + msm5205_reset_w(m_msm, 1); } } else { - msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f ); + msm5205_data_w(m_msm, m_adpcm_data & 0x0f ); m_adpcm_data = -1; } } @@ -198,7 +198,7 @@ WRITE_LINE_MEMBER(appoooh_state::appoooh_adpcm_int) WRITE8_MEMBER(appoooh_state::appoooh_adpcm_w) { m_adpcm_address = data << 8; - msm5205_reset_w(m_adpcm, 0); + msm5205_reset_w(m_msm, 0); m_adpcm_data = 0xffffffff; } @@ -409,8 +409,6 @@ static const sn76496_config psg_intf = void appoooh_state::machine_start() { - m_adpcm = machine().device("msm"); - save_item(NAME(m_adpcm_data)); save_item(NAME(m_adpcm_address)); } diff --git a/src/mame/drivers/ashnojoe.c b/src/mame/drivers/ashnojoe.c index 7889f50dc78..4b81987c9f5 100644 --- a/src/mame/drivers/ashnojoe.c +++ b/src/mame/drivers/ashnojoe.c @@ -277,12 +277,11 @@ WRITE_LINE_MEMBER(ashnojoe_state::ym2203_irq_handler) WRITE8_MEMBER(ashnojoe_state::ym2203_write_a) { - device_t *device = machine().device("msm"); /* This gets called at 8910 startup with 0xff before the 5205 exists, causing a crash */ if (data == 0xff) return; - msm5205_reset_w(device, !(data & 0x01)); + msm5205_reset_w(m_msm, !(data & 0x01)); } WRITE8_MEMBER(ashnojoe_state::ym2203_write_b) @@ -307,11 +306,11 @@ WRITE_LINE_MEMBER(ashnojoe_state::ashnojoe_vclk_cb) { if (m_msm5205_vclk_toggle == 0) { - msm5205_data_w(machine().device("msm"), m_adpcm_byte >> 4); + msm5205_data_w(m_msm, m_adpcm_byte >> 4); } else { - msm5205_data_w(machine().device("msm"), m_adpcm_byte & 0xf); + msm5205_data_w(m_msm, m_adpcm_byte & 0xf); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c index 30376888168..ad29a9907a2 100644 --- a/src/mame/drivers/asuka.c +++ b/src/mame/drivers/asuka.c @@ -262,14 +262,14 @@ WRITE_LINE_MEMBER(asuka_state::asuka_msm5205_vck) { if (m_adpcm_data != -1) { - msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f); + msm5205_data_w(m_msm, m_adpcm_data & 0x0f); m_adpcm_data = -1; } else { m_adpcm_data = machine().root_device().memregion("ymsnd")->base()[m_adpcm_pos]; m_adpcm_pos = (m_adpcm_pos + 1) & 0xffff; - msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4); + msm5205_data_w(m_msm, m_adpcm_data >> 4); } } @@ -280,14 +280,12 @@ WRITE8_MEMBER(asuka_state::asuka_msm5205_address_w) WRITE8_MEMBER(asuka_state::asuka_msm5205_start_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm, 0); } WRITE8_MEMBER(asuka_state::asuka_msm5205_stop_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device, 1); + msm5205_reset_w(m_msm, 1); m_adpcm_pos &= 0xff00; } diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c index b560f2f66ab..3fcd2ed01dc 100644 --- a/src/mame/drivers/battlera.c +++ b/src/mame/drivers/battlera.c @@ -85,7 +85,7 @@ ADDRESS_MAP_END WRITE_LINE_MEMBER(battlera_state::battlera_adpcm_int) { - msm5205_data_w(machine().device("msm"),m_msm5205next >> 4); + msm5205_data_w(m_msm,m_msm5205next >> 4); m_msm5205next <<= 4; m_toggle = 1 - m_toggle; @@ -100,8 +100,7 @@ WRITE8_MEMBER(battlera_state::battlera_adpcm_data_w) WRITE8_MEMBER(battlera_state::battlera_adpcm_reset_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm, 0); } static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, battlera_state ) diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c index 626987977ad..b50a915086d 100644 --- a/src/mame/drivers/cabal.c +++ b/src/mame/drivers/cabal.c @@ -210,21 +210,19 @@ ADDRESS_MAP_END WRITE8_MEMBER(cabal_state::cabalbl_1_adpcm_w) { - device_t *device = machine().device("msm1"); - msm5205_reset_w(device,(data>>7)&1); + msm5205_reset_w(m_msm1,(data>>7)&1); /* ?? bit 6?? */ - msm5205_data_w(device,data); - msm5205_vclk_w(device,1); - msm5205_vclk_w(device,0); + msm5205_data_w(m_msm1,data); + msm5205_vclk_w(m_msm1,1); + msm5205_vclk_w(m_msm1,0); } WRITE8_MEMBER(cabal_state::cabalbl_2_adpcm_w) { - device_t *device = machine().device("msm2"); - msm5205_reset_w(device,(data>>7)&1); + msm5205_reset_w(m_msm2,(data>>7)&1); /* ?? bit 6?? */ - msm5205_data_w(device,data); - msm5205_vclk_w(device,1); - msm5205_vclk_w(device,0); + msm5205_data_w(m_msm2,data); + msm5205_vclk_w(m_msm2,1); + msm5205_vclk_w(m_msm2,0); } static ADDRESS_MAP_START( cabalbl_talk1_map, AS_PROGRAM, 8, cabal_state ) AM_RANGE(0x0000, 0xffff) AM_ROM AM_WRITENOP diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c index 73ba1d8aad5..7fbdf829a14 100644 --- a/src/mame/drivers/combatsc.c +++ b/src/mame/drivers/combatsc.c @@ -399,16 +399,15 @@ ADDRESS_MAP_END WRITE8_MEMBER(combatsc_state::combatscb_dac_w) { - device_t *device = machine().device("msm5205"); if(data & 0x60) printf("%02x\n",data); membank("bl_abank")->set_entry((data & 0x80) >> 7); - //msm5205_reset_w(device, (data >> 4) & 1); - msm5205_data_w(device, (data & 0x0f)); - msm5205_vclk_w(device, 1); - msm5205_vclk_w(device, 0); + //msm5205_reset_w(m_msm5205, (data >> 4) & 1); + msm5205_data_w(m_msm5205, (data & 0x0f)); + msm5205_vclk_w(m_msm5205, 1); + msm5205_vclk_w(m_msm5205, 0); } static ADDRESS_MAP_START( combatscb_sound_map, AS_PROGRAM, 8, combatsc_state ) diff --git a/src/mame/drivers/crgolf.c b/src/mame/drivers/crgolf.c index 3c1abb4d95a..9a1badde5e5 100644 --- a/src/mame/drivers/crgolf.c +++ b/src/mame/drivers/crgolf.c @@ -204,7 +204,7 @@ WRITE_LINE_MEMBER(crgolf_state::vck_callback) UINT8 data = memregion("adpcm")->base()[m_sample_offset >> 1]; /* write the next nibble and advance */ - msm5205_data_w(machine().device("msm"), (data >> (4 * (~m_sample_offset & 1))) & 0x0f); + msm5205_data_w(m_msm, (data >> (4 * (~m_sample_offset & 1))) & 0x0f); m_sample_offset++; /* every 256 clocks, we decrement the length */ @@ -214,7 +214,7 @@ WRITE_LINE_MEMBER(crgolf_state::vck_callback) /* if we hit 0xff, automatically turn off playback */ if (m_sample_count == 0xff) - msm5205_reset_w(machine().device("msm"), 1); + msm5205_reset_w(m_msm, 1); } } } @@ -222,13 +222,11 @@ WRITE_LINE_MEMBER(crgolf_state::vck_callback) WRITE8_MEMBER(crgolf_state::crgolfhi_sample_w) { - device_t *device = machine().device("msm"); - switch (offset) { /* offset 0 holds the MSM5205 in reset */ case 0: - msm5205_reset_w(device, 1); + msm5205_reset_w(m_msm, 1); break; /* offset 1 is the length/256 nibbles */ @@ -243,7 +241,7 @@ WRITE8_MEMBER(crgolf_state::crgolfhi_sample_w) /* offset 3 turns on playback */ case 3: - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm, 0); break; } } diff --git a/src/mame/drivers/dacholer.c b/src/mame/drivers/dacholer.c index 1065ee25a65..582bdf68ee0 100644 --- a/src/mame/drivers/dacholer.c +++ b/src/mame/drivers/dacholer.c @@ -46,7 +46,8 @@ public: m_audiocpu(*this,"audiocpu"), m_bgvideoram(*this, "bgvideoram"), m_fgvideoram(*this, "fgvideoram"), - m_spriteram(*this, "spriteram"){ } + m_spriteram(*this, "spriteram"), + m_msm(*this, "msm"){ } /* devices */ required_device<cpu_device> m_maincpu; @@ -55,6 +56,8 @@ public: required_shared_ptr<UINT8> m_bgvideoram; required_shared_ptr<UINT8> m_fgvideoram; required_shared_ptr<UINT8> m_spriteram; + + optional_device<msm5205_device> m_msm; /* video-related */ tilemap_t *m_bg_tilemap; @@ -562,7 +565,7 @@ WRITE_LINE_MEMBER(dacholer_state::adpcm_int) { if (m_snd_interrupt_enable == 1 || (m_snd_interrupt_enable == 0 && m_msm_toggle == 1)) { - msm5205_data_w(machine().device("msm"), m_msm_data >> 4); + msm5205_data_w(m_msm, m_msm_data >> 4); m_msm_data <<= 4; m_msm_toggle ^= 1; if (m_msm_toggle == 0) diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c index e03a09cd97e..589023c29a8 100644 --- a/src/mame/drivers/darius.c +++ b/src/mame/drivers/darius.c @@ -526,9 +526,8 @@ WRITE8_MEMBER(darius_state::adpcm_nmi_enable) WRITE8_MEMBER(darius_state::adpcm_data_w) { - device_t *device = machine().device("msm"); - msm5205_data_w(device, data); - msm5205_reset_w(device, !(data & 0x20)); /* my best guess, but it could be output enable as well */ + msm5205_data_w(m_msm, data); + msm5205_reset_w(m_msm, !(data & 0x20)); /* my best guess, but it could be output enable as well */ } static ADDRESS_MAP_START( darius_sound2_io_map, AS_IO, 8, darius_state ) diff --git a/src/mame/drivers/dec0.c b/src/mame/drivers/dec0.c index 918d593a910..f0ab47c351f 100644 --- a/src/mame/drivers/dec0.c +++ b/src/mame/drivers/dec0.c @@ -1388,11 +1388,11 @@ WRITE_LINE_MEMBER(dec0_automat_state::automat_vclk_cb) { if (m_automat_msm5205_vclk_toggle == 0) { - msm5205_data_w(machine().device("msm"), m_automat_adpcm_byte & 0xf); + msm5205_data_w(m_msm, m_automat_adpcm_byte & 0xf); } else { - msm5205_data_w(machine().device("msm"), m_automat_adpcm_byte >> 4); + msm5205_data_w(m_msm, m_automat_adpcm_byte >> 4); //device->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); // gives some scratch samples but breaks other sounds too } diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c index 6dee38c8eaa..813d122f769 100644 --- a/src/mame/drivers/dec8.c +++ b/src/mame/drivers/dec8.c @@ -484,14 +484,13 @@ WRITE_LINE_MEMBER(dec8_state::csilver_adpcm_int) if (m_toggle) m_audiocpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); - msm5205_data_w(machine().device("msm"), m_msm5205next >> 4); + msm5205_data_w(m_msm, m_msm5205next >> 4); m_msm5205next <<= 4; } READ8_MEMBER(dec8_state::csilver_adpcm_reset_r) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm, 0); return 0; } diff --git a/src/mame/drivers/discoboy.c b/src/mame/drivers/discoboy.c index a2afd215e3c..7a138d63e94 100644 --- a/src/mame/drivers/discoboy.c +++ b/src/mame/drivers/discoboy.c @@ -52,7 +52,8 @@ public: discoboy_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_audiocpu(*this, "audiocpu") , - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } /* video-related */ UINT8 m_ram_bank; @@ -93,6 +94,7 @@ public: void discoboy_setrombank( UINT8 data ); DECLARE_WRITE_LINE_MEMBER(yunsung8_adpcm_int); required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; }; @@ -331,9 +333,8 @@ ADDRESS_MAP_END WRITE8_MEMBER(discoboy_state::yunsung8_sound_bankswitch_w) { - device_t *device = machine().device("msm"); /* Note: this is bit 5 on yunsung8.c */ - msm5205_reset_w(device, (data & 0x08) >> 3); + msm5205_reset_w(m_msm, (data & 0x08) >> 3); membank("sndbank")->set_entry(data & 0x07); @@ -474,7 +475,7 @@ void discoboy_state::machine_reset() WRITE_LINE_MEMBER(discoboy_state::yunsung8_adpcm_int) { - msm5205_data_w(machine().device("msm"), m_adpcm >> 4); + msm5205_data_w(m_msm, m_adpcm >> 4); m_adpcm <<= 4; m_toggle ^= 1; diff --git a/src/mame/drivers/docastle.c b/src/mame/drivers/docastle.c index 7712f3e1aca..8f91b68aea5 100644 --- a/src/mame/drivers/docastle.c +++ b/src/mame/drivers/docastle.c @@ -165,17 +165,17 @@ WRITE_LINE_MEMBER(docastle_state::idsoccer_adpcm_int) if (m_adpcm_pos >= memregion("adpcm")->bytes()) { m_adpcm_idle = 1; - msm5205_reset_w(machine().device("msm"), 1); + msm5205_reset_w(m_msm, 1); } else if (m_adpcm_data != -1) { - msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f); + msm5205_data_w(m_msm, m_adpcm_data & 0x0f); m_adpcm_data = -1; } else { m_adpcm_data = machine().root_device().memregion("adpcm")->base()[m_adpcm_pos++]; - msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4); + msm5205_data_w(m_msm, m_adpcm_data >> 4); } } @@ -188,18 +188,16 @@ READ8_MEMBER(docastle_state::idsoccer_adpcm_status_r) WRITE8_MEMBER(docastle_state::idsoccer_adpcm_w) { - device_t *device = machine().device("msm"); - if (data & 0x80) { m_adpcm_idle = 1; - msm5205_reset_w(device, 1); + msm5205_reset_w(m_msm, 1); } else { m_adpcm_pos = (data & 0x7f) * 0x200; m_adpcm_idle = 0; - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm, 0); } } diff --git a/src/mame/drivers/drmicro.c b/src/mame/drivers/drmicro.c index 4760eb8f82f..15096ef30b3 100644 --- a/src/mame/drivers/drmicro.c +++ b/src/mame/drivers/drmicro.c @@ -236,8 +236,6 @@ static const sn76496_config psg_intf = void drmicro_state::machine_start() { - m_msm = machine().device("msm"); - save_item(NAME(m_nmi_enable)); save_item(NAME(m_pcm_adr)); save_item(NAME(m_flipscreen)); diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c index 01ed22add7b..7b82545e958 100644 --- a/src/mame/drivers/dynax.c +++ b/src/mame/drivers/dynax.c @@ -392,7 +392,7 @@ WRITE8_MEMBER(dynax_state::nanajign_palette_w) WRITE_LINE_MEMBER(dynax_state::adpcm_int) { - msm5205_data_w(machine().device("msm"), m_msm5205next >> 4); + msm5205_data_w(m_msm, m_msm5205next >> 4); m_msm5205next <<= 4; m_toggle = 1 - m_toggle; @@ -406,7 +406,7 @@ WRITE_LINE_MEMBER(dynax_state::adpcm_int) WRITE_LINE_MEMBER(dynax_state::adpcm_int_cpu1) { - msm5205_data_w(machine().device("msm"), m_msm5205next >> 4); + msm5205_data_w(m_msm, m_msm5205next >> 4); m_msm5205next <<= 4; m_toggle_cpu1 = 1 - m_toggle_cpu1; @@ -425,16 +425,15 @@ WRITE8_MEMBER(dynax_state::adpcm_data_w) WRITE8_MEMBER(dynax_state::adpcm_reset_w) { - device_t *device = machine().device("msm"); m_resetkludge = data & 1; - msm5205_reset_w(device, ~data & 1); + msm5205_reset_w(m_msm, ~data & 1); } MACHINE_RESET_MEMBER(dynax_state,adpcm) { /* start with the MSM5205 reset */ m_resetkludge = 0; - msm5205_reset_w(machine().device("msm"), 1); + msm5205_reset_w(m_msm, 1); } WRITE8_MEMBER(dynax_state::yarunara_layer_half_w) @@ -4008,7 +4007,7 @@ MACHINE_START_MEMBER(dynax_state,dynax) MACHINE_RESET_MEMBER(dynax_state,dynax) { - if (machine().device("msm") != NULL) + if (m_msm != NULL) MACHINE_RESET_CALL_MEMBER(adpcm); m_sound_irq = 0; diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c index 3b01d0fee03..d2e9e903934 100644 --- a/src/mame/drivers/fantland.c +++ b/src/mame/drivers/fantland.c @@ -389,10 +389,10 @@ void fantland_state::borntofi_adpcm_int( device_t *device, int voice ) } } -WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_0) { borntofi_adpcm_int(machine().device("msm1"), 0); } -WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_1) { borntofi_adpcm_int(machine().device("msm2"), 1); } -WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_2) { borntofi_adpcm_int(machine().device("msm3"), 2); } -WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_3) { borntofi_adpcm_int(machine().device("msm4"), 3); } +WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_0) { borntofi_adpcm_int(m_msm1, 0); } +WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_1) { borntofi_adpcm_int(m_msm2, 1); } +WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_2) { borntofi_adpcm_int(m_msm3, 2); } +WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_3) { borntofi_adpcm_int(m_msm4, 3); } static ADDRESS_MAP_START( borntofi_sound_map, AS_PROGRAM, 8, fantland_state ) @@ -943,11 +943,6 @@ MACHINE_START_MEMBER(fantland_state,borntofi) { MACHINE_START_CALL_MEMBER(fantland); - m_msm1 = machine().device("msm1"); - m_msm2 = machine().device("msm2"); - m_msm3 = machine().device("msm3"); - m_msm4 = machine().device("msm4"); - save_item(NAME(m_old_x)); save_item(NAME(m_old_y)); save_item(NAME(m_old_f)); @@ -980,10 +975,10 @@ MACHINE_RESET_MEMBER(fantland_state,borntofi) m_adpcm_nibble[i] = 0; } - borntofi_adpcm_stop(machine().device("msm1"), 0); - borntofi_adpcm_stop(machine().device("msm2"), 1); - borntofi_adpcm_stop(machine().device("msm3"), 2); - borntofi_adpcm_stop(machine().device("msm4"), 3); + borntofi_adpcm_stop(m_msm1, 0); + borntofi_adpcm_stop(m_msm2, 1); + borntofi_adpcm_stop(m_msm3, 2); + borntofi_adpcm_stop(m_msm4, 3); } static MACHINE_CONFIG_START( borntofi, fantland_state ) diff --git a/src/mame/drivers/firetrap.c b/src/mame/drivers/firetrap.c index 54dafbdde8c..cf0f1ee3bc9 100644 --- a/src/mame/drivers/firetrap.c +++ b/src/mame/drivers/firetrap.c @@ -320,7 +320,7 @@ WRITE8_MEMBER(firetrap_state::firetrap_sound_bankselect_w) WRITE_LINE_MEMBER(firetrap_state::firetrap_adpcm_int) { - msm5205_data_w(machine().device("msm"), m_msm5205next >> 4); + msm5205_data_w(m_msm, m_msm5205next >> 4); m_msm5205next <<= 4; m_adpcm_toggle ^= 1; @@ -590,8 +590,6 @@ void firetrap_state::machine_start() UINT8 *MAIN = memregion("maincpu")->base(); UINT8 *SOUND = memregion("audiocpu")->base(); - m_msm = machine().device("msm"); - membank("bank1")->configure_entries(0, 4, &MAIN[0x10000], 0x4000); membank("bank2")->configure_entries(0, 2, &SOUND[0x10000], 0x4000); diff --git a/src/mame/drivers/flstory.c b/src/mame/drivers/flstory.c index 0971c3b72e0..b43c3f6e188 100644 --- a/src/mame/drivers/flstory.c +++ b/src/mame/drivers/flstory.c @@ -384,32 +384,24 @@ MACHINE_RESET_MEMBER(flstory_state,ta7630) WRITE8_MEMBER(flstory_state::sound_control_0_w) { - device_t *device = machine().device("msm"); - m_snd_ctrl0 = data & 0xff; // popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); /* this definitely controls main melody voice on 2'-1 and 4'-1 outputs */ - device_sound_interface *sound; - device->interface(sound); - sound->set_output_gain(0, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ - sound->set_output_gain(1, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ - sound->set_output_gain(2, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ - sound->set_output_gain(3, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(0, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(1, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(2, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(3, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ } WRITE8_MEMBER(flstory_state::sound_control_1_w) { - device_t *device = machine().device("msm"); - m_snd_ctrl1 = data & 0xff; // popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); - device_sound_interface *sound; - device->interface(sound); - sound->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - sound->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - sound->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - sound->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + m_msm->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + m_msm->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ } WRITE8_MEMBER(flstory_state::sound_control_2_w) diff --git a/src/mame/drivers/fromance.c b/src/mame/drivers/fromance.c index 458180b221e..078807f580e 100644 --- a/src/mame/drivers/fromance.c +++ b/src/mame/drivers/fromance.c @@ -122,11 +122,10 @@ WRITE8_MEMBER(fromance_state::fromance_rombank_w) WRITE8_MEMBER(fromance_state::fromance_adpcm_reset_w) { - device_t *device = machine().device("msm"); m_adpcm_reset = (data & 0x01); m_vclk_left = 0; - msm5205_reset_w(device, !(data & 0x01)); + msm5205_reset_w(m_msm, !(data & 0x01)); } @@ -146,7 +145,7 @@ WRITE_LINE_MEMBER(fromance_state::fromance_adpcm_int) /* clock the data through */ if (m_vclk_left) { - msm5205_data_w(machine().device("msm"), (m_adpcm_data >> 4)); + msm5205_data_w(m_msm, (m_adpcm_data >> 4)); m_adpcm_data <<= 4; m_vclk_left--; } diff --git a/src/mame/drivers/gcpinbal.c b/src/mame/drivers/gcpinbal.c index dd0a2eadf8b..2deb7c0bc1d 100644 --- a/src/mame/drivers/gcpinbal.c +++ b/src/mame/drivers/gcpinbal.c @@ -205,10 +205,10 @@ WRITE16_MEMBER(gcpinbal_state::ioc_w) WRITE_LINE_MEMBER(gcpinbal_state::gcp_adpcm_int) { if (m_adpcm_idle) - msm5205_reset_w(machine().device("msm"), 1); + msm5205_reset_w(m_msm, 1); if (m_adpcm_start >= 0x200000 || m_adpcm_start > m_adpcm_end) { - //msm5205_reset_w(machine().device("msm"),1); + //msm5205_reset_w(m_msm,1); m_adpcm_start = m_msm_start + m_msm_bank; m_adpcm_trigger = 0; } @@ -217,7 +217,7 @@ WRITE_LINE_MEMBER(gcpinbal_state::gcp_adpcm_int) UINT8 *ROM = machine().root_device().memregion("msm")->base(); m_adpcm_data = ((m_adpcm_trigger ? (ROM[m_adpcm_start] & 0x0f) : (ROM[m_adpcm_start] & 0xf0) >> 4)); - msm5205_data_w(machine().device("msm"), m_adpcm_data & 0xf); + msm5205_data_w(m_msm, m_adpcm_data & 0xf); m_adpcm_trigger ^= 1; if (m_adpcm_trigger == 0) m_adpcm_start++; diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c index 1189a17fcda..c92049fcf8b 100644 --- a/src/mame/drivers/gladiatr.c +++ b/src/mame/drivers/gladiatr.c @@ -278,16 +278,15 @@ WRITE_LINE_MEMBER(gladiatr_state::gladiator_ym_irq) /*Sound Functions*/ WRITE8_MEMBER(gladiatr_state::glad_adpcm_w) -{ - device_t *device = machine().device("msm"); +{ UINT8 *rom = machine().root_device().memregion("audiocpu")->base() + 0x10000; /* bit6 = bank offset */ machine().root_device().membank("bank2")->set_base(rom + ((data & 0x40) ? 0xc000 : 0)); - msm5205_data_w(device,data); /* bit0..3 */ - msm5205_reset_w(device,(data>>5)&1); /* bit 5 */ - msm5205_vclk_w (device,(data>>4)&1); /* bit4 */ + msm5205_data_w(m_msm,data); /* bit0..3 */ + msm5205_reset_w(m_msm,(data>>5)&1); /* bit 5 */ + msm5205_vclk_w (m_msm,(data>>4)&1); /* bit4 */ } WRITE8_MEMBER(gladiatr_state::glad_cpu_sound_command_w) diff --git a/src/mame/drivers/goal92.c b/src/mame/drivers/goal92.c index 1a480540422..23f18af985c 100644 --- a/src/mame/drivers/goal92.c +++ b/src/mame/drivers/goal92.c @@ -69,10 +69,9 @@ ADDRESS_MAP_END WRITE8_MEMBER(goal92_state::adpcm_control_w) { - device_t *device = machine().device("msm"); membank("bank1")->set_entry(data & 0x01); - msm5205_reset_w(device, data & 0x08); + msm5205_reset_w(m_msm, data & 0x08); } WRITE8_MEMBER(goal92_state::adpcm_data_w) @@ -227,7 +226,7 @@ static const ym2203_interface ym2203_config = WRITE_LINE_MEMBER(goal92_state::goal92_adpcm_int) { - msm5205_data_w(machine().device("msm"), m_msm5205next); + msm5205_data_w(m_msm, m_msm5205next); m_msm5205next >>= 4; m_adpcm_toggle^= 1; diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c index 3ccc0048055..f36a5e39f12 100644 --- a/src/mame/drivers/gsword.c +++ b/src/mame/drivers/gsword.c @@ -312,10 +312,9 @@ READ8_MEMBER(gsword_state::gsword_fake_1_r) WRITE8_MEMBER(gsword_state::gsword_adpcm_data_w) { - device_t *device = machine().device("msm"); - msm5205_data_w (device,data & 0x0f); /* bit 0..3 */ - msm5205_reset_w(device,(data>>5)&1); /* bit 5 */ - msm5205_vclk_w(device,(data>>4)&1); /* bit 4 */ + msm5205_data_w (m_msm,data & 0x0f); /* bit 0..3 */ + msm5205_reset_w(m_msm,(data>>5)&1); /* bit 5 */ + msm5205_vclk_w(m_msm,(data>>4)&1); /* bit 4 */ } WRITE8_MEMBER(gsword_state::adpcm_soundcommand_w) diff --git a/src/mame/drivers/hnayayoi.c b/src/mame/drivers/hnayayoi.c index c7f4b757725..7e21d48936a 100644 --- a/src/mame/drivers/hnayayoi.c +++ b/src/mame/drivers/hnayayoi.c @@ -69,26 +69,22 @@ WRITE8_MEMBER(hnayayoi_state::keyboard_w) WRITE8_MEMBER(hnayayoi_state::adpcm_data_w) { - device_t *device = machine().device("msm"); - msm5205_data_w(device, data); + msm5205_data_w(m_msm, data); } WRITE8_MEMBER(hnayayoi_state::adpcm_vclk_w) { - device_t *device = machine().device("msm"); - msm5205_vclk_w(device, data & 1); + msm5205_vclk_w(m_msm, data & 1); } WRITE8_MEMBER(hnayayoi_state::adpcm_reset_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device, data & 1); + msm5205_reset_w(m_msm, data & 1); } WRITE8_MEMBER(hnayayoi_state::adpcm_reset_inv_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device, ~data & 1); + msm5205_reset_w(m_msm, ~data & 1); } @@ -542,7 +538,7 @@ void hnayayoi_state::machine_start() void hnayayoi_state::machine_reset() { /* start with the MSM5205 reset */ - msm5205_reset_w(machine().device("msm"), 1); + msm5205_reset_w(m_msm, 1); m_palbank = 0; m_blit_layer = 0; diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c index 0ae4418aec0..f310fab4cc0 100644 --- a/src/mame/drivers/jangou.c +++ b/src/mame/drivers/jangou.c @@ -38,7 +38,8 @@ class jangou_state : public driver_device { public: jangou_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) { } + : driver_device(mconfig, type, tag), + m_msm(*this, "msm") { } /* sound-related */ // Jangou CVSD Sound @@ -94,6 +95,7 @@ public: UINT8 jangou_gfx_nibble( UINT16 niboffset ); void plot_jangou_gfx_pixel( UINT8 pix, int x, int y ); DECLARE_WRITE_LINE_MEMBER(jngolady_vclk_cb); + optional_device<msm5205_device> m_msm; }; @@ -350,10 +352,10 @@ WRITE8_MEMBER(jangou_state::adpcm_w) WRITE_LINE_MEMBER(jangou_state::jngolady_vclk_cb) { if (m_msm5205_vclk_toggle == 0) - msm5205_data_w(machine().device("msm"), m_adpcm_byte >> 4); + msm5205_data_w(m_msm, m_adpcm_byte >> 4); else { - msm5205_data_w(machine().device("msm"), m_adpcm_byte & 0xf); + msm5205_data_w(m_msm, m_adpcm_byte & 0xf); m_cpu_1->execute().set_input_line(0, HOLD_LINE); } diff --git a/src/mame/drivers/kchamp.c b/src/mame/drivers/kchamp.c index 7d763b3b806..a7ee38ba82f 100644 --- a/src/mame/drivers/kchamp.c +++ b/src/mame/drivers/kchamp.c @@ -87,8 +87,7 @@ WRITE8_MEMBER(kchamp_state::sound_reset_w) WRITE8_MEMBER(kchamp_state::sound_control_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device, !(data & 1)); + msm5205_reset_w(m_msm, !(data & 1)); m_sound_nmi_enable = ((data >> 1) & 1); } @@ -348,9 +347,9 @@ INTERRUPT_GEN_MEMBER(kchamp_state::kc_interrupt) WRITE_LINE_MEMBER(kchamp_state::msmint) { if (m_msm_play_lo_nibble) - msm5205_data_w(machine().device("msm"), m_msm_data & 0x0f); + msm5205_data_w(m_msm, m_msm_data & 0x0f); else - msm5205_data_w(machine().device("msm"), (m_msm_data >> 4) & 0x0f); + msm5205_data_w(m_msm, (m_msm_data >> 4) & 0x0f); m_msm_play_lo_nibble ^= 1; diff --git a/src/mame/drivers/lucky74.c b/src/mame/drivers/lucky74.c index 53517f2dc45..a4d92df99c6 100644 --- a/src/mame/drivers/lucky74.c +++ b/src/mame/drivers/lucky74.c @@ -1426,11 +1426,11 @@ WRITE_LINE_MEMBER(lucky74_state::lucky74_adpcm_int) /* transferring 1st nibble */ m_adpcm_data = machine().root_device().memregion("adpcm")->base()[m_adpcm_pos]; m_adpcm_pos = (m_adpcm_pos + 1) & 0xffff; - msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4); + msm5205_data_w(m_msm, m_adpcm_data >> 4); if (m_adpcm_pos == m_adpcm_end) { - msm5205_reset_w(machine().device("msm"), 0); /* reset the M5205 */ + msm5205_reset_w(m_msm, 0); /* reset the M5205 */ m_adpcm_reg[05] = 0; /* clean trigger register */ m_adpcm_busy_line = 0x01; /* deactivate busy flag */ logerror("end of sample.\n"); @@ -1439,7 +1439,7 @@ WRITE_LINE_MEMBER(lucky74_state::lucky74_adpcm_int) else { /* transferring 2nd nibble */ - msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f); + msm5205_data_w(m_msm, m_adpcm_data & 0x0f); m_adpcm_data = -1; } } diff --git a/src/mame/drivers/mastboy.c b/src/mame/drivers/mastboy.c index 6d62d77e37f..9d5f81d94f6 100644 --- a/src/mame/drivers/mastboy.c +++ b/src/mame/drivers/mastboy.c @@ -449,7 +449,8 @@ public: m_workram(*this, "workram"), m_tileram(*this, "tileram"), m_colram(*this, "colram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } required_shared_ptr<UINT8> m_nvram; required_shared_ptr<UINT8> m_workram; @@ -483,6 +484,7 @@ public: INTERRUPT_GEN_MEMBER(mastboy_interrupt); DECLARE_WRITE_LINE_MEMBER(mastboy_adpcm_int); required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; }; @@ -639,30 +641,25 @@ WRITE8_MEMBER(mastboy_state::backupram_enable_w) WRITE8_MEMBER(mastboy_state::msm5205_mastboy_m5205_sambit0_w) { - device_t *adpcm = machine().device("msm"); - m_m5205_sambit0 = data & 1; - msm5205_playmode_w(adpcm, (1 << 2) | (m_m5205_sambit1 << 1) | (m_m5205_sambit0) ); + msm5205_playmode_w(m_msm, (1 << 2) | (m_m5205_sambit1 << 1) | (m_m5205_sambit0) ); logerror("msm5205 samplerate bit 0, set to %02x\n",data); } WRITE8_MEMBER(mastboy_state::msm5205_mastboy_m5205_sambit1_w) { - device_t *adpcm = machine().device("msm"); - m_m5205_sambit1 = data & 1; - msm5205_playmode_w(adpcm, (1 << 2) | (m_m5205_sambit1 << 1) | (m_m5205_sambit0) ); + msm5205_playmode_w(m_msm, (1 << 2) | (m_m5205_sambit1 << 1) | (m_m5205_sambit0) ); logerror("msm5205 samplerate bit 0, set to %02x\n",data); } WRITE8_MEMBER(mastboy_state::mastboy_msm5205_reset_w) { - device_t *device = machine().device("msm"); m_m5205_part = 0; - msm5205_reset_w(device,data&1); + msm5205_reset_w(m_msm,data&1); } WRITE8_MEMBER(mastboy_state::mastboy_msm5205_data_w) @@ -672,7 +669,7 @@ WRITE8_MEMBER(mastboy_state::mastboy_msm5205_data_w) WRITE_LINE_MEMBER(mastboy_state::mastboy_adpcm_int) { - msm5205_data_w(machine().device("msm"), m_m5205_next); + msm5205_data_w(m_msm, m_m5205_next); m_m5205_next >>= 4; m_m5205_part ^= 1; @@ -880,7 +877,7 @@ void mastboy_state::machine_reset() memset( m_vram, 0x00, 0x10000); m_m5205_part = 0; - msm5205_reset_w(machine().device("msm"),1); + msm5205_reset_w(m_msm,1); m_irq0_ack = 0; } diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c index efb6f24fc8a..a266d720426 100644 --- a/src/mame/drivers/mitchell.c +++ b/src/mame/drivers/mitchell.c @@ -1178,7 +1178,7 @@ GFXDECODE_END WRITE_LINE_MEMBER(mitchell_state::spangbl_adpcm_int) { - msm5205_data_w(machine().device("msm"), m_sample_buffer & 0x0f); + msm5205_data_w(m_msm, m_sample_buffer & 0x0f); m_sample_buffer >>= 4; m_sample_select ^= 1; if(m_sample_select == 0) diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c index 37e34fe904a..621c7a73129 100644 --- a/src/mame/drivers/mlanding.c +++ b/src/mame/drivers/mlanding.c @@ -39,7 +39,8 @@ public: m_mecha_ram(*this, "mecha_ram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "sub") { } + m_subcpu(*this, "sub"), + m_msm(*this, "msm") { } required_shared_ptr<UINT16> m_g_ram; required_shared_ptr<UINT16> m_ml_tileram; @@ -87,6 +88,7 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<cpu_device> m_subcpu; + required_device<msm5205_device> m_msm; }; @@ -294,7 +296,7 @@ WRITE_LINE_MEMBER(mlanding_state::ml_msm5205_vck) if (m_adpcm_pos >= 0x50000 || m_adpcm_idle) { //m_adpcm_idle = 1; - msm5205_reset_w(machine().device("msm"),1); + msm5205_reset_w(m_msm,1); m_trigger = 0; } else @@ -302,7 +304,7 @@ WRITE_LINE_MEMBER(mlanding_state::ml_msm5205_vck) UINT8 *ROM = machine().root_device().memregion("adpcm")->base(); m_adpcm_data = ((m_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0)>>4) ); - msm5205_data_w(machine().device("msm"),m_adpcm_data & 0xf); + msm5205_data_w(m_msm,m_adpcm_data & 0xf); m_trigger^=1; if(m_trigger == 0) { @@ -529,10 +531,9 @@ ADDRESS_MAP_END WRITE8_MEMBER(mlanding_state::ml_msm_start_lsb_w) { - device_t *device = machine().device("msm"); m_adpcm_pos = (m_adpcm_pos & 0x0f0000) | ((data & 0xff)<<8) | 0x20; m_adpcm_idle = 0; - msm5205_reset_w(device,0); + msm5205_reset_w(m_msm,0); m_adpcm_end = (m_adpcm_pos+0x800); } diff --git a/src/mame/drivers/msisaac.c b/src/mame/drivers/msisaac.c index 43eec1e5a2d..066cbe9c2d4 100644 --- a/src/mame/drivers/msisaac.c +++ b/src/mame/drivers/msisaac.c @@ -236,20 +236,17 @@ MACHINE_RESET_MEMBER(msisaac_state,ta7630) WRITE8_MEMBER(msisaac_state::sound_control_0_w) { - device_t *device = machine().device("msm"); m_snd_ctrl0 = data & 0xff; //popmessage("SND0 0=%2x 1=%2x", m_snd_ctrl0, m_snd_ctrl1); - - device_sound_interface *sound; - device->interface(sound); - sound->set_output_gain(0, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */ - sound->set_output_gain(1, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */ - sound->set_output_gain(2, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */ - sound->set_output_gain(3, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */ - sound->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - sound->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - sound->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - sound->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + + m_msm->set_output_gain(0, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(1, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(2, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(3, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */ + m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + m_msm->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + m_msm->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */ } WRITE8_MEMBER(msisaac_state::sound_control_1_w) { diff --git a/src/mame/drivers/ojankohs.c b/src/mame/drivers/ojankohs.c index 1c5aeb1bb44..aa637016eb8 100644 --- a/src/mame/drivers/ojankohs.c +++ b/src/mame/drivers/ojankohs.c @@ -56,12 +56,11 @@ WRITE8_MEMBER(ojankohs_state::ojankoy_rombank_w) } WRITE8_MEMBER(ojankohs_state::ojankohs_adpcm_reset_w) -{ - device_t *device = machine().device("msm"); +{ m_adpcm_reset = BIT(data, 0); m_vclk_left = 0; - msm5205_reset_w(device, !m_adpcm_reset); + msm5205_reset_w(m_msm, !m_adpcm_reset); } WRITE8_MEMBER(ojankohs_state::ojankohs_msm5205_w) @@ -79,7 +78,7 @@ WRITE_LINE_MEMBER(ojankohs_state::ojankohs_adpcm_int) /* clock the data through */ if (m_vclk_left) { - msm5205_data_w(machine().device("msm"), (m_adpcm_data >> 4)); + msm5205_data_w(m_msm, (m_adpcm_data >> 4)); m_adpcm_data <<= 4; m_vclk_left--; } @@ -787,8 +786,6 @@ static const msm5205_interface msm5205_config = MACHINE_START_MEMBER(ojankohs_state,common) { - m_msm = machine().device("msm"); - save_item(NAME(m_gfxreg)); save_item(NAME(m_flipscreen)); save_item(NAME(m_flipscreen_old)); diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c index ebfe5d19a97..7f713fabf0d 100644 --- a/src/mame/drivers/opwolf.c +++ b/src/mame/drivers/opwolf.c @@ -430,9 +430,7 @@ void opwolf_state::machine_start() { m_pc080sn = machine().device("pc080sn"); m_pc090oj = machine().device("pc090oj"); - m_msm1 = machine().device("msm1"); - m_msm2 = machine().device("msm2"); - + save_item(NAME(m_sprite_ctrl)); save_item(NAME(m_sprites_flipscreen)); @@ -453,8 +451,8 @@ MACHINE_RESET_MEMBER(opwolf_state,opwolf) m_sprite_ctrl = 0; m_sprites_flipscreen = 0; - msm5205_reset_w(machine().device("msm1"), 1); - msm5205_reset_w(machine().device("msm2"), 1); + msm5205_reset_w(m_msm1, 1); + msm5205_reset_w(m_msm2, 1); } void opwolf_state::opwolf_msm5205_vck(device_t *device,int chip) @@ -475,16 +473,15 @@ void opwolf_state::opwolf_msm5205_vck(device_t *device,int chip) } WRITE_LINE_MEMBER(opwolf_state::opwolf_msm5205_vck_1) { - opwolf_msm5205_vck(machine().device("msm1"),0); + opwolf_msm5205_vck(m_msm1,0); } WRITE_LINE_MEMBER(opwolf_state::opwolf_msm5205_vck_2) { - opwolf_msm5205_vck(machine().device("msm2"),1); + opwolf_msm5205_vck(m_msm2,1); } WRITE8_MEMBER(opwolf_state::opwolf_adpcm_b_w) -{ - device_t *device = machine().device("msm1"); +{ int start; int end; @@ -498,7 +495,7 @@ WRITE8_MEMBER(opwolf_state::opwolf_adpcm_b_w) end *= 16; m_adpcm_pos[0] = start; m_adpcm_end[0] = end; - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm1, 0); } // logerror("CPU #1 b00%i-data=%2x pc=%4x\n",offset,data,space.device().safe_pc() ); @@ -507,7 +504,6 @@ WRITE8_MEMBER(opwolf_state::opwolf_adpcm_b_w) WRITE8_MEMBER(opwolf_state::opwolf_adpcm_c_w) { - device_t *device = machine().device("msm2"); int start; int end; @@ -521,7 +517,7 @@ WRITE8_MEMBER(opwolf_state::opwolf_adpcm_c_w) end *= 16; m_adpcm_pos[1] = start; m_adpcm_end[1] = end; - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm2, 0); } // logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,space.device().safe_pc() ); diff --git a/src/mame/drivers/pachifev.c b/src/mame/drivers/pachifev.c index f47ba1d4617..636b4b2b909 100644 --- a/src/mame/drivers/pachifev.c +++ b/src/mame/drivers/pachifev.c @@ -274,7 +274,7 @@ WRITE_LINE_MEMBER(pachifev_state::pf_adpcm_int) if (m_adpcm_pos >= 0x4000 || m_adpcm_idle) { m_adpcm_idle = 1; - msm5205_reset_w(machine().device("msm"),1); + msm5205_reset_w(m_msm,1); m_trigger = 0; } else @@ -282,7 +282,7 @@ WRITE_LINE_MEMBER(pachifev_state::pf_adpcm_int) UINT8 *ROM = machine().root_device().memregion("adpcm")->base(); m_adpcm_data = ((m_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0)>>4) ); - msm5205_data_w(machine().device("msm"),m_adpcm_data & 0xf); + msm5205_data_w(m_msm,m_adpcm_data & 0xf); m_trigger^=1; if(m_trigger == 0) { diff --git a/src/mame/drivers/pcktgal.c b/src/mame/drivers/pcktgal.c index c5298a739c9..cbc895f6ac6 100644 --- a/src/mame/drivers/pcktgal.c +++ b/src/mame/drivers/pcktgal.c @@ -48,7 +48,7 @@ WRITE8_MEMBER(pcktgal_state::pcktgal_sound_w) WRITE_LINE_MEMBER(pcktgal_state::pcktgal_adpcm_int) { - msm5205_data_w(machine().device("msm"),m_msm5205next >> 4); + msm5205_data_w(m_msm,m_msm5205next >> 4); m_msm5205next<<=4; m_toggle = 1 - m_toggle; @@ -63,8 +63,7 @@ WRITE8_MEMBER(pcktgal_state::pcktgal_adpcm_data_w) READ8_MEMBER(pcktgal_state::pcktgal_adpcm_reset_r) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device,0); + msm5205_reset_w(m_msm,0); return 0; } diff --git a/src/mame/drivers/rastan.c b/src/mame/drivers/rastan.c index 0d9e9dc1dda..ea37e0ddae1 100644 --- a/src/mame/drivers/rastan.c +++ b/src/mame/drivers/rastan.c @@ -171,14 +171,14 @@ WRITE_LINE_MEMBER(rastan_state::rastan_msm5205_vck) { if (m_adpcm_data != -1) { - msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f); + msm5205_data_w(m_msm, m_adpcm_data & 0x0f); m_adpcm_data = -1; } else { m_adpcm_data = machine().root_device().memregion("adpcm")->base()[m_adpcm_pos]; m_adpcm_pos = (m_adpcm_pos + 1) & 0xffff; - msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4); + msm5205_data_w(m_msm, m_adpcm_data >> 4); } } @@ -189,14 +189,12 @@ WRITE8_MEMBER(rastan_state::rastan_msm5205_address_w) WRITE8_MEMBER(rastan_state::rastan_msm5205_start_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm, 0); } WRITE8_MEMBER(rastan_state::rastan_msm5205_stop_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device, 1); + msm5205_reset_w(m_msm, 1); m_adpcm_pos &= 0xff00; } diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c index 94615b31e32..0069f59cc12 100644 --- a/src/mame/drivers/rmhaihai.c +++ b/src/mame/drivers/rmhaihai.c @@ -41,7 +41,8 @@ public: : driver_device(mconfig, type, tag), m_colorram(*this, "colorram"), m_videoram(*this, "videoram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } int m_gfxbank; required_shared_ptr<UINT8> m_colorram; @@ -62,6 +63,7 @@ public: DECLARE_MACHINE_RESET(themj); UINT32 screen_update_rmhaihai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; }; @@ -165,10 +167,9 @@ READ8_MEMBER(rmhaihai_state::samples_r) WRITE8_MEMBER(rmhaihai_state::adpcm_w) { - device_t *device = machine().device("msm"); - msm5205_data_w(device,data); /* bit0..3 */ - msm5205_reset_w(device,(data>>5)&1); /* bit 5 */ - msm5205_vclk_w (device,(data>>4)&1); /* bit4 */ + msm5205_data_w(m_msm,data); /* bit0..3 */ + msm5205_reset_w(m_msm,(data>>5)&1); /* bit 5 */ + msm5205_vclk_w (m_msm,(data>>4)&1); /* bit4 */ } WRITE8_MEMBER(rmhaihai_state::ctrl_w) diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c index 72ef3d0ebfa..31ceff9fdc8 100644 --- a/src/mame/drivers/sf.c +++ b/src/mame/drivers/sf.c @@ -178,22 +178,20 @@ WRITE8_MEMBER(sf_state::sound2_bank_w) WRITE8_MEMBER(sf_state::msm1_5205_w) { - device_t *device = machine().device("msm1"); - msm5205_reset_w(device, (data >> 7) & 1); + msm5205_reset_w(m_msm1, (data >> 7) & 1); /* ?? bit 6?? */ - msm5205_data_w(device, data); - msm5205_vclk_w(device, 1); - msm5205_vclk_w(device, 0); + msm5205_data_w(m_msm1, data); + msm5205_vclk_w(m_msm1, 1); + msm5205_vclk_w(m_msm1, 0); } WRITE8_MEMBER(sf_state::msm2_5205_w) { - device_t *device = machine().device("msm2"); - msm5205_reset_w(device, (data >> 7) & 1); + msm5205_reset_w(m_msm2, (data >> 7) & 1); /* ?? bit 6?? */ - msm5205_data_w(device, data); - msm5205_vclk_w(device, 1); - msm5205_vclk_w(device, 0); + msm5205_data_w(m_msm2, data); + msm5205_vclk_w(m_msm2, 1); + msm5205_vclk_w(m_msm2, 0); } diff --git a/src/mame/drivers/sothello.c b/src/mame/drivers/sothello.c index 88ca81702cc..ad62d104be6 100644 --- a/src/mame/drivers/sothello.c +++ b/src/mame/drivers/sothello.c @@ -50,7 +50,8 @@ public: m_v9938(*this, "v9938") , m_maincpu(*this, "maincpu"), m_soundcpu(*this, "soundcpu"), - m_subcpu(*this, "sub") { } + m_subcpu(*this, "sub"), + m_msm(*this, "msm") { } required_device<v9938_device> m_v9938; @@ -81,6 +82,7 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_soundcpu; required_device<cpu_device> m_subcpu; + required_device<msm5205_device> m_msm; }; @@ -172,15 +174,14 @@ ADDRESS_MAP_END WRITE8_MEMBER(sothello_state::msm_cfg_w) { - device_t *device = machine().device("msm"); /* bit 0 = RESET bit 1 = 4B/3B 0 bit 2 = S2 1 bit 3 = S1 2 */ - msm5205_playmode_w(device, BITSWAP8((data>>1), 7,6,5,4,3,0,1,2)); - msm5205_reset_w(device,data&1); + msm5205_playmode_w(m_msm, BITSWAP8((data>>1), 7,6,5,4,3,0,1,2)); + msm5205_reset_w(m_msm,data&1); } WRITE8_MEMBER(sothello_state::msm_data_w) @@ -335,7 +336,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(sothello_state::sothello_interrupt) WRITE_LINE_MEMBER(sothello_state::adpcm_int) { /* only 4 bits are used */ - msm5205_data_w(machine().device("msm"), m_msm_data & 0x0f ); + msm5205_data_w(m_msm, m_msm_data & 0x0f ); m_soundcpu->set_input_line(0, ASSERT_LINE ); } diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c index d066393f65c..f117eaa574b 100644 --- a/src/mame/drivers/spdodgeb.c +++ b/src/mame/drivers/spdodgeb.c @@ -85,12 +85,12 @@ void spdodgeb_state::spd_adpcm_int( device_t *device, int chip ) WRITE_LINE_MEMBER(spdodgeb_state::spd_adpcm_int_1) { - spd_adpcm_int(machine().device("msm1"), 0); + spd_adpcm_int(m_msm1, 0); } WRITE_LINE_MEMBER(spdodgeb_state::spd_adpcm_int_2) { - spd_adpcm_int(machine().device("msm2"), 1); + spd_adpcm_int(m_msm2, 1); } #if 0 // default - more sensitive (state change and timing measured on real board?) diff --git a/src/mame/drivers/splash.c b/src/mame/drivers/splash.c index 3ebc7aee411..4ed321e8cd4 100644 --- a/src/mame/drivers/splash.c +++ b/src/mame/drivers/splash.c @@ -112,7 +112,7 @@ WRITE8_MEMBER(splash_state::splash_adpcm_data_w) WRITE_LINE_MEMBER(splash_state::splash_msm5205_int) { - msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4); + msm5205_data_w(m_msm, m_adpcm_data >> 4); m_adpcm_data = (m_adpcm_data << 4) & 0xf0; } @@ -579,7 +579,7 @@ WRITE_LINE_MEMBER(splash_state::adpcm_int1) { if (m_snd_interrupt_enable1 || m_msm_toggle1 == 1) { - msm5205_data_w(machine().device("msm1"), m_msm_data1 >> 4); + msm5205_data_w(m_msm1, m_msm_data1 >> 4); m_msm_data1 <<= 4; m_msm_toggle1 ^= 1; if (m_msm_toggle1 == 0) @@ -594,7 +594,7 @@ WRITE_LINE_MEMBER(splash_state::adpcm_int2) { if (m_snd_interrupt_enable2 || m_msm_toggle2 == 1) { - msm5205_data_w(machine().device("msm2"), m_msm_data2 >> 4); + msm5205_data_w(m_msm2, m_msm_data2 >> 4); m_msm_data2 <<= 4; m_msm_toggle2 ^= 1; if (m_msm_toggle2 == 0) diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c index 24176ff0e6f..7f853e32a19 100644 --- a/src/mame/drivers/srmp2.c +++ b/src/mame/drivers/srmp2.c @@ -160,7 +160,6 @@ WRITE16_MEMBER(srmp2_state::mjyuugi_adpcm_bank_w) WRITE16_MEMBER(srmp2_state::srmp2_adpcm_code_w) { - device_t *device = machine().device("msm"); /* - Received data may be playing ADPCM number. - 0x000000 - 0x0000ff and 0x010000 - 0x0100ff are offset table. @@ -177,14 +176,13 @@ WRITE16_MEMBER(srmp2_state::srmp2_adpcm_code_w) m_adpcm_sptr += (m_adpcm_bank * 0x10000); m_adpcm_eptr += (m_adpcm_bank * 0x10000); - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm, 0); m_adpcm_data = -1; } WRITE8_MEMBER(srmp2_state::srmp3_adpcm_code_w) { - device_t *device = machine().device("msm"); /* - Received data may be playing ADPCM number. - 0x000000 - 0x0000ff and 0x010000 - 0x0100ff are offset table. @@ -201,7 +199,7 @@ WRITE8_MEMBER(srmp2_state::srmp3_adpcm_code_w) m_adpcm_sptr += (m_adpcm_bank * 0x10000); m_adpcm_eptr += (m_adpcm_bank * 0x10000); - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm, 0); m_adpcm_data = -1; } @@ -218,25 +216,25 @@ WRITE_LINE_MEMBER(srmp2_state::srmp2_adpcm_int) if (m_adpcm_sptr >= m_adpcm_eptr) { - msm5205_reset_w(machine().device("msm"), 1); + msm5205_reset_w(m_msm, 1); m_adpcm_data = 0; m_adpcm_sptr = 0; } else { - msm5205_data_w(machine().device("msm"), ((m_adpcm_data >> 4) & 0x0f)); + msm5205_data_w(m_msm, ((m_adpcm_data >> 4) & 0x0f)); } } else { - msm5205_data_w(machine().device("msm"), ((m_adpcm_data >> 0) & 0x0f)); + msm5205_data_w(m_msm, ((m_adpcm_data >> 0) & 0x0f)); m_adpcm_sptr++; m_adpcm_data = -1; } } else { - msm5205_reset_w(machine().device("msm"), 1); + msm5205_reset_w(m_msm, 1); } } diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c index f798b4a9569..dfb1ace8802 100644 --- a/src/mame/drivers/suprgolf.c +++ b/src/mame/drivers/suprgolf.c @@ -32,7 +32,8 @@ public: suprgolf_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } tilemap_t *m_tilemap; required_shared_ptr<UINT8> m_videoram; @@ -73,6 +74,7 @@ public: DECLARE_WRITE_LINE_MEMBER(irqhandler); DECLARE_WRITE_LINE_MEMBER(adpcm_int); required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; }; TILE_GET_INFO_MEMBER(suprgolf_state::get_tile_info) @@ -437,16 +439,16 @@ static const ym2203_interface ym2203_config = WRITE_LINE_MEMBER(suprgolf_state::adpcm_int) { - msm5205_reset_w(machine().device("msm"),0); + msm5205_reset_w(m_msm,0); m_toggle ^= 1; if(m_toggle) { - msm5205_data_w(machine().device("msm"), (m_msm5205next & 0xf0) >> 4); + msm5205_data_w(m_msm, (m_msm5205next & 0xf0) >> 4); if(m_msm_nmi_mask) { m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } } else { - msm5205_data_w(machine().device("msm"), (m_msm5205next & 0x0f) >> 0); + msm5205_data_w(m_msm, (m_msm5205next & 0x0f) >> 0); } } diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c index 4ec4ef64284..e54e6cec2f3 100644 --- a/src/mame/drivers/taito_l.c +++ b/src/mame/drivers/taito_l.c @@ -559,14 +559,14 @@ WRITE_LINE_MEMBER(taitol_state::champwr_msm5205_vck) { if (m_adpcm_data != -1) { - msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f); + msm5205_data_w(m_msm, m_adpcm_data & 0x0f); m_adpcm_data = -1; } else { m_adpcm_data = machine().root_device().memregion("adpcm")->base()[m_adpcm_pos]; m_adpcm_pos = (m_adpcm_pos + 1) & 0x1ffff; - msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4); + msm5205_data_w(m_msm, m_adpcm_data >> 4); } } @@ -582,24 +582,18 @@ WRITE8_MEMBER(taitol_state::champwr_msm5205_hi_w) WRITE8_MEMBER(taitol_state::champwr_msm5205_start_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm, 0); } WRITE8_MEMBER(taitol_state::champwr_msm5205_stop_w) { - device_t *device = machine().device("msm"); - - msm5205_reset_w(device, 1); + msm5205_reset_w(m_msm, 1); m_adpcm_pos &= 0x1ff00; } WRITE8_MEMBER(taitol_state::champwr_msm5205_volume_w) { - device_t *device = machine().device("msm"); - device_sound_interface *sound; - device->interface(sound); - sound->set_output_gain(0, data / 255.0); + m_msm->set_output_gain(0, data / 255.0); } READ8_MEMBER(taitol_state::horshoes_tracky_reset_r) diff --git a/src/mame/drivers/tbowl.c b/src/mame/drivers/tbowl.c index c660e8729dc..5e86fc9ed5d 100644 --- a/src/mame/drivers/tbowl.c +++ b/src/mame/drivers/tbowl.c @@ -182,12 +182,12 @@ void tbowl_state::tbowl_adpcm_int( device_t *device, int num ) WRITE_LINE_MEMBER(tbowl_state::tbowl_adpcm_int_1) { - tbowl_adpcm_int(machine().device("msm1"), 0); + tbowl_adpcm_int(m_msm1, 0); } WRITE_LINE_MEMBER(tbowl_state::tbowl_adpcm_int_2) { - tbowl_adpcm_int(machine().device("msm2"), 1); + tbowl_adpcm_int(m_msm2, 1); } static ADDRESS_MAP_START( 6206A_map, AS_PROGRAM, 8, tbowl_state ) diff --git a/src/mame/drivers/tecmo.c b/src/mame/drivers/tecmo.c index d7a7ddb5ba7..57cf390a0a2 100644 --- a/src/mame/drivers/tecmo.c +++ b/src/mame/drivers/tecmo.c @@ -78,9 +78,8 @@ WRITE8_MEMBER(tecmo_state::tecmo_nmi_ack_w) WRITE8_MEMBER(tecmo_state::tecmo_adpcm_start_w) { - device_t *device = machine().device("msm"); m_adpcm_pos = data << 8; - msm5205_reset_w(device, 0); + msm5205_reset_w(m_msm, 0); } WRITE8_MEMBER(tecmo_state::tecmo_adpcm_end_w) @@ -90,18 +89,17 @@ WRITE8_MEMBER(tecmo_state::tecmo_adpcm_end_w) WRITE8_MEMBER(tecmo_state::tecmo_adpcm_vol_w) { - device_t *device = machine().device("msm"); - msm5205_set_volume(device,(data & 0x0f) * 100 / 15); + msm5205_set_volume(m_msm,(data & 0x0f) * 100 / 15); } WRITE_LINE_MEMBER(tecmo_state::tecmo_adpcm_int) { if (m_adpcm_pos >= m_adpcm_end || m_adpcm_pos >= memregion("adpcm")->bytes()) - msm5205_reset_w(machine().device("msm"),1); + msm5205_reset_w(m_msm,1); else if (m_adpcm_data != -1) { - msm5205_data_w(machine().device("msm"),m_adpcm_data & 0x0f); + msm5205_data_w(m_msm,m_adpcm_data & 0x0f); m_adpcm_data = -1; } else @@ -109,7 +107,7 @@ WRITE_LINE_MEMBER(tecmo_state::tecmo_adpcm_int) UINT8 *ROM = machine().root_device().memregion("adpcm")->base(); m_adpcm_data = ROM[m_adpcm_pos++]; - msm5205_data_w(machine().device("msm"),m_adpcm_data >> 4); + msm5205_data_w(m_msm,m_adpcm_data >> 4); } } diff --git a/src/mame/drivers/tehkanwc.c b/src/mame/drivers/tehkanwc.c index ac06c4b9855..5e9fd8efafd 100644 --- a/src/mame/drivers/tehkanwc.c +++ b/src/mame/drivers/tehkanwc.c @@ -184,8 +184,7 @@ WRITE8_MEMBER(tehkanwc_state::tehkanwc_portB_w) WRITE8_MEMBER(tehkanwc_state::msm_reset_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device,data ? 0 : 1); + msm5205_reset_w(m_msm,data ? 0 : 1); } WRITE_LINE_MEMBER(tehkanwc_state::tehkanwc_adpcm_int) @@ -194,10 +193,10 @@ WRITE_LINE_MEMBER(tehkanwc_state::tehkanwc_adpcm_int) int msm_data = SAMPLES[m_msm_data_offs & 0x7fff]; if (m_toggle == 0) - msm5205_data_w(machine().device("msm"),(msm_data >> 4) & 0x0f); + msm5205_data_w(m_msm,(msm_data >> 4) & 0x0f); else { - msm5205_data_w(machine().device("msm"),msm_data & 0x0f); + msm5205_data_w(m_msm,msm_data & 0x0f); m_msm_data_offs++; } diff --git a/src/mame/drivers/tigeroad.c b/src/mame/drivers/tigeroad.c index a40c65bea02..4af34282273 100644 --- a/src/mame/drivers/tigeroad.c +++ b/src/mame/drivers/tigeroad.c @@ -156,11 +156,10 @@ WRITE16_MEMBER(tigeroad_state::tigeroad_soundcmd_w) WRITE8_MEMBER(tigeroad_state::msm5205_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device,(data>>7)&1); - msm5205_data_w(device,data); - msm5205_vclk_w(device,1); - msm5205_vclk_w(device,0); + msm5205_reset_w(m_msm,(data>>7)&1); + msm5205_data_w(m_msm,data); + msm5205_vclk_w(m_msm,1); + msm5205_vclk_w(m_msm,0); } diff --git a/src/mame/drivers/toki.c b/src/mame/drivers/toki.c index 4ee4946ca35..b676e8e7258 100644 --- a/src/mame/drivers/toki.c +++ b/src/mame/drivers/toki.c @@ -58,7 +58,7 @@ READ16_MEMBER(toki_state::pip16_r) WRITE_LINE_MEMBER(toki_state::toki_adpcm_int) { - msm5205_data_w (machine().device("msm"), m_msm5205next); + msm5205_data_w (m_msm, m_msm5205next); m_msm5205next >>= 4; m_toggle ^= 1; @@ -68,7 +68,6 @@ WRITE_LINE_MEMBER(toki_state::toki_adpcm_int) WRITE8_MEMBER(toki_state::toki_adpcm_control_w) { - device_t *device = machine().device("msm"); int bankaddress; UINT8 *RAM = memregion("audiocpu")->base(); @@ -77,7 +76,7 @@ WRITE8_MEMBER(toki_state::toki_adpcm_control_w) bankaddress = 0x10000 + (data & 0x01) * 0x4000; membank("bank1")->set_base(&RAM[bankaddress]); - msm5205_reset_w(device,data & 0x08); + msm5205_reset_w(m_msm,data & 0x08); } WRITE8_MEMBER(toki_state::toki_adpcm_data_w) diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c index df9a5d40eef..18ef20d1c9b 100644 --- a/src/mame/drivers/topspeed.c +++ b/src/mame/drivers/topspeed.c @@ -683,8 +683,8 @@ void topspeed_state::machine_start() m_pc080sn_1 = machine().device("pc080sn_1"); m_pc080sn_2 = machine().device("pc080sn_2"); - m_msm_chip[0] = machine().device("msm1"); - m_msm_chip[1] = machine().device("msm2"); + m_msm_chip[0] = m_msm1; + m_msm_chip[1] = m_msm2; m_msm_rom[0] = memregion("adpcm")->base(); m_msm_rom[1] = memregion("adpcm")->base() + 0x10000; diff --git a/src/mame/drivers/tubep.c b/src/mame/drivers/tubep.c index 2e8de95c735..ad34a7d0cbe 100644 --- a/src/mame/drivers/tubep.c +++ b/src/mame/drivers/tubep.c @@ -526,10 +526,9 @@ READ8_MEMBER(tubep_state::rjammer_soundlatch_r) WRITE8_MEMBER(tubep_state::rjammer_voice_startstop_w) { - device_t *device = machine().device("msm"); /* bit 0 of data selects voice start/stop (reset pin on MSM5205)*/ // 0 -stop; 1-start - msm5205_reset_w (device, (data&1)^1 ); + msm5205_reset_w (m_msm, (data&1)^1 ); return; } @@ -537,13 +536,12 @@ WRITE8_MEMBER(tubep_state::rjammer_voice_startstop_w) WRITE8_MEMBER(tubep_state::rjammer_voice_frequency_select_w) { - device_t *device = machine().device("msm"); /* bit 0 of data selects voice frequency on MSM5205 */ // 0 -4 KHz; 1- 8KHz if (data & 1) - msm5205_playmode_w(device, MSM5205_S48_4B); /* 8 KHz */ + msm5205_playmode_w(m_msm, MSM5205_S48_4B); /* 8 KHz */ else - msm5205_playmode_w(device, MSM5205_S96_4B); /* 4 KHz */ + msm5205_playmode_w(m_msm, MSM5205_S96_4B); /* 4 KHz */ return; } @@ -555,12 +553,12 @@ WRITE_LINE_MEMBER(tubep_state::rjammer_adpcm_vck) if (m_ls74 == 1) { - msm5205_data_w(machine().device("msm"), (m_ls377 >> 0) & 15 ); + msm5205_data_w(m_msm, (m_ls377 >> 0) & 15 ); m_soundcpu->set_input_line(0, ASSERT_LINE ); } else { - msm5205_data_w(machine().device("msm"), (m_ls377 >> 4) & 15 ); + msm5205_data_w(m_msm, (m_ls377 >> 4) & 15 ); } } diff --git a/src/mame/drivers/wc90b.c b/src/mame/drivers/wc90b.c index 7caf5092eef..f69d722703a 100644 --- a/src/mame/drivers/wc90b.c +++ b/src/mame/drivers/wc90b.c @@ -122,7 +122,6 @@ WRITE8_MEMBER(wc90b_state::wc90b_sound_command_w) WRITE8_MEMBER(wc90b_state::adpcm_control_w) { - device_t *device = machine().device("msm"); int bankaddress; UINT8 *ROM = memregion("audiocpu")->base(); @@ -130,7 +129,7 @@ WRITE8_MEMBER(wc90b_state::adpcm_control_w) bankaddress = 0x10000 + (data & 0x01) * 0x4000; membank("bank3")->set_base(&ROM[bankaddress]); - msm5205_reset_w(device,data & 0x08); + msm5205_reset_w(m_msm,data & 0x08); } WRITE8_MEMBER(wc90b_state::adpcm_data_w) @@ -345,11 +344,11 @@ WRITE_LINE_MEMBER(wc90b_state::adpcm_int) m_toggle ^= 1; if(m_toggle) { - msm5205_data_w(machine().device("msm"), (m_msm5205next & 0xf0) >> 4); + msm5205_data_w(m_msm, (m_msm5205next & 0xf0) >> 4); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } else - msm5205_data_w(machine().device("msm"), (m_msm5205next & 0x0f) >> 0); + msm5205_data_w(m_msm, (m_msm5205next & 0x0f) >> 0); } static const msm5205_interface msm5205_config = diff --git a/src/mame/drivers/yunsung8.c b/src/mame/drivers/yunsung8.c index c2365a88bf3..44dc534e0b7 100644 --- a/src/mame/drivers/yunsung8.c +++ b/src/mame/drivers/yunsung8.c @@ -95,8 +95,7 @@ ADDRESS_MAP_END WRITE8_MEMBER(yunsung8_state::yunsung8_sound_bankswitch_w) { - device_t *device = machine().device("msm"); - msm5205_reset_w(device, data & 0x20); + msm5205_reset_w(m_msm, data & 0x20); membank("bank2")->set_entry(data & 0x07); @@ -445,7 +444,7 @@ GFXDECODE_END WRITE_LINE_MEMBER(yunsung8_state::yunsung8_adpcm_int) { - msm5205_data_w(machine().device("msm"), m_adpcm >> 4); + msm5205_data_w(m_msm, m_adpcm >> 4); m_adpcm <<= 4; m_toggle ^= 1; diff --git a/src/mame/includes/40love.h b/src/mame/includes/40love.h index a4b06d1e849..f2dec62e1f2 100644 --- a/src/mame/includes/40love.h +++ b/src/mame/includes/40love.h @@ -1,3 +1,4 @@ +#include "sound/msm5232.h" class fortyl_state : public driver_device { public: @@ -11,7 +12,8 @@ public: m_mcu_ram(*this, "mcu_ram"), m_audiocpu(*this, "audiocpu"), m_maincpu(*this, "maincpu"), - m_mcu(*this, "mcu") { } + m_mcu(*this, "mcu"), + m_msm(*this, "msm") { } /* memory pointers */ required_shared_ptr<UINT8> m_videoram; @@ -107,4 +109,5 @@ public: void draw_pixram( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device<cpu_device> m_maincpu; optional_device<cpu_device> m_mcu; + optional_device<msm5232_device> m_msm; }; diff --git a/src/mame/includes/appoooh.h b/src/mame/includes/appoooh.h index 279272ce124..7a061d7be99 100644 --- a/src/mame/includes/appoooh.h +++ b/src/mame/includes/appoooh.h @@ -1,4 +1,4 @@ - +#include "sound/msm5205.h" class appoooh_state : public driver_device { @@ -11,6 +11,7 @@ public: m_spriteram_2(*this, "spriteram_2"), m_bg_videoram(*this, "bg_videoram"), m_bg_colorram(*this, "bg_colorram"), + m_msm(*this, "msm"), m_maincpu(*this, "maincpu") { } /* memory pointers */ @@ -32,7 +33,7 @@ public: UINT32 m_adpcm_address; /* devices */ - device_t *m_adpcm; + required_device<msm5205_device> m_msm; UINT8 m_nmi_mask; DECLARE_WRITE8_MEMBER(appoooh_adpcm_w); diff --git a/src/mame/includes/ashnojoe.h b/src/mame/includes/ashnojoe.h index bf4338a1423..961be2450ef 100644 --- a/src/mame/includes/ashnojoe.h +++ b/src/mame/includes/ashnojoe.h @@ -3,6 +3,7 @@ Success Joe / Ashita no Joe *************************************************************************/ +#include "sound/msm5205.h" class ashnojoe_state : public driver_device { @@ -18,7 +19,8 @@ public: m_tileram(*this, "tileram"), m_tilemap_reg(*this, "tilemap_reg"), m_audiocpu(*this, "audiocpu"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } /* memory pointers */ UINT16 * m_tileram_1; @@ -79,4 +81,5 @@ public: DECLARE_WRITE_LINE_MEMBER(ym2203_irq_handler); DECLARE_WRITE_LINE_MEMBER(ashnojoe_vclk_cb); required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/asuka.h b/src/mame/includes/asuka.h index f50d7a2804f..4bf4b55a04c 100644 --- a/src/mame/includes/asuka.h +++ b/src/mame/includes/asuka.h @@ -3,6 +3,7 @@ Asuka & Asuka (+ Taito/Visco games on similar hardware) *************************************************************************/ +#include "sound/msm5205.h" class asuka_state : public driver_device { @@ -11,7 +12,8 @@ public: : driver_device(mconfig, type, tag), m_cadash_shared_ram(*this, "sharedram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm") { } /* memory pointers */ // UINT16 * paletteram; // this currently uses generic palette handlers @@ -37,6 +39,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + optional_device<msm5205_device> m_msm; device_t *m_pc090oj; device_t *m_tc0100scn; DECLARE_WRITE8_MEMBER(sound_bankswitch_w); diff --git a/src/mame/includes/battlera.h b/src/mame/includes/battlera.h index 9336c65a326..c25f4d668be 100644 --- a/src/mame/includes/battlera.h +++ b/src/mame/includes/battlera.h @@ -1,10 +1,13 @@ +#include "sound/msm5205.h" + class battlera_state : public driver_device { public: battlera_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm") { } int m_control_port_select; int m_msm5205next; @@ -45,4 +48,5 @@ public: void draw_sprites(bitmap_ind16 &bitmap,const rectangle &clip,int pri); DECLARE_WRITE_LINE_MEMBER(battlera_adpcm_int); required_device<cpu_device> m_audiocpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/cabal.h b/src/mame/includes/cabal.h index 541f18802c8..fc689d7e19e 100644 --- a/src/mame/includes/cabal.h +++ b/src/mame/includes/cabal.h @@ -1,3 +1,4 @@ +#include "sound/msm5205.h" class cabal_state : public driver_device { public: @@ -7,7 +8,9 @@ public: m_colorram(*this, "colorram"), m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_msm1(*this, "msm1"), + m_msm2(*this, "msm2") { } required_shared_ptr<UINT16> m_spriteram; required_shared_ptr<UINT16> m_colorram; @@ -41,4 +44,6 @@ public: void seibu_sound_bootleg(const char *cpu,int length); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + optional_device<msm5205_device> m_msm1; + optional_device<msm5205_device> m_msm2; }; diff --git a/src/mame/includes/combatsc.h b/src/mame/includes/combatsc.h index 2dad1b5082b..8f038da5959 100644 --- a/src/mame/includes/combatsc.h +++ b/src/mame/includes/combatsc.h @@ -4,6 +4,7 @@ *************************************************************************/ #include "sound/upd7759.h" +#include "sound/msm5205.h" class combatsc_state : public driver_device { @@ -15,7 +16,8 @@ public: m_k007121_1(*this, "k007121_1"), m_k007121_2(*this, "k007121_2"), m_maincpu(*this, "maincpu"), - m_upd7759(*this, "upd") { } + m_upd7759(*this, "upd"), + m_msm5205(*this, "msm5205") { } /* memory pointers */ UINT8 * m_videoram; @@ -92,4 +94,5 @@ public: void bootleg_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *source, int circuit ); required_device<cpu_device> m_maincpu; optional_device<upd7759_device> m_upd7759; + optional_device<msm5205_device> m_msm5205; }; diff --git a/src/mame/includes/crgolf.h b/src/mame/includes/crgolf.h index b003d77f6ae..5876dc05163 100644 --- a/src/mame/includes/crgolf.h +++ b/src/mame/includes/crgolf.h @@ -3,7 +3,7 @@ Kitco Crowns Golf hardware **************************************************************************/ - +#include "sound/msm5205.h" #define MASTER_CLOCK 18432000 @@ -18,7 +18,8 @@ public: m_screenb_enable(*this, "screenb_enable"), m_screena_enable(*this, "screena_enable"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm"){ } /* memory pointers */ UINT8 * m_videoram_a; @@ -39,6 +40,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + optional_device<msm5205_device> m_msm; DECLARE_WRITE8_MEMBER(rom_bank_select_w); DECLARE_READ8_MEMBER(switch_input_r); DECLARE_READ8_MEMBER(analog_input_r); diff --git a/src/mame/includes/darius.h b/src/mame/includes/darius.h index d9f4d471c6b..ea91d0ed9a3 100644 --- a/src/mame/includes/darius.h +++ b/src/mame/includes/darius.h @@ -4,8 +4,9 @@ *************************************************************************/ -#include <sound/flt_vol.h> -#include <audio/taitosnd.h> +#include "sound/flt_vol.h" +#include "audio/taitosnd.h" +#include "sound/msm5205.h" #define DARIUS_VOL_MAX (3*2 + 2) #define DARIUS_PAN_MAX (2 + 2 + 1) /* FM 2port + PSG 2port + DA 1port */ @@ -18,7 +19,8 @@ public: m_spriteram(*this, "spriteram"), m_fg_ram(*this, "fg_ram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm"){ } /* memory pointers */ required_shared_ptr<UINT16> m_spriteram; @@ -40,6 +42,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + required_device<msm5205_device> m_msm; device_t *m_cpub; device_t *m_adpcm; tc0140syt_device *m_tc0140syt; diff --git a/src/mame/includes/dec0.h b/src/mame/includes/dec0.h index d69516d170d..4f23746b955 100644 --- a/src/mame/includes/dec0.h +++ b/src/mame/includes/dec0.h @@ -1,5 +1,6 @@ #include "video/decbac06.h" #include "video/decmxc06.h" +#include "sound/msm5205.h" class dec0_state : public driver_device { @@ -16,7 +17,8 @@ public: m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_subcpu(*this, "sub"), - m_mcu(*this, "mcu") { } + m_mcu(*this, "mcu"), + m_msm(*this, "msm") { } required_shared_ptr<UINT16> m_ram; required_shared_ptr<UINT16> m_spriteram; @@ -98,6 +100,7 @@ public: required_device<cpu_device> m_audiocpu; optional_device<cpu_device> m_subcpu; optional_device<cpu_device> m_mcu; + optional_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/dec8.h b/src/mame/includes/dec8.h index 3278eeaee6f..311191b4647 100644 --- a/src/mame/includes/dec8.h +++ b/src/mame/includes/dec8.h @@ -1,4 +1,5 @@ #include "video/bufsprite.h" +#include "sound/msm5205.h" class dec8_state : public driver_device { @@ -11,7 +12,8 @@ public: m_mcu(*this, "mcu"), m_spriteram(*this, "spriteram") , m_videoram(*this, "videoram"), - m_bg_data(*this, "bg_data") { } + m_bg_data(*this, "bg_data"), + m_msm(*this, "msm") { } /* devices */ required_device<cpu_device> m_maincpu; @@ -23,6 +25,8 @@ public: /* memory pointers */ required_shared_ptr<UINT8> m_videoram; optional_shared_ptr<UINT8> m_bg_data; + + optional_device<msm5205_device> m_msm; UINT8 * m_pf1_data; UINT8 * m_row; // UINT8 * m_paletteram; // currently this uses generic palette handling diff --git a/src/mame/includes/docastle.h b/src/mame/includes/docastle.h index 8de1c1f5ce2..96eb96e843b 100644 --- a/src/mame/includes/docastle.h +++ b/src/mame/includes/docastle.h @@ -1,4 +1,4 @@ - +#include "sound/msm5205.h" class docastle_state : public driver_device { @@ -9,7 +9,8 @@ public: m_colorram(*this, "colorram"), m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), - m_slave(*this, "slave"){ } + m_slave(*this, "slave"), + m_msm(*this, "msm"){ } /* memory pointers */ required_shared_ptr<UINT8> m_videoram; @@ -30,6 +31,8 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_slave; + optional_device<msm5205_device> m_msm; + DECLARE_READ8_MEMBER(docastle_shared0_r); DECLARE_READ8_MEMBER(docastle_shared1_r); DECLARE_WRITE8_MEMBER(docastle_shared0_w); diff --git a/src/mame/includes/drmicro.h b/src/mame/includes/drmicro.h index 36ed9646951..fb65cd7516b 100644 --- a/src/mame/includes/drmicro.h +++ b/src/mame/includes/drmicro.h @@ -3,13 +3,14 @@ Dr. Micro *************************************************************************/ - +#include "sound/msm5205.h" class drmicro_state : public driver_device { public: drmicro_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) , + : driver_device(mconfig, type, tag), + m_msm(*this, "msm"), m_maincpu(*this, "maincpu") { } /* memory pointers */ @@ -25,7 +26,7 @@ public: int m_pcm_adr; /* devices */ - device_t *m_msm; + required_device<msm5205_device> m_msm; DECLARE_WRITE8_MEMBER(nmi_enable_w); DECLARE_WRITE8_MEMBER(pcm_set_w); DECLARE_WRITE8_MEMBER(drmicro_videoram_w); diff --git a/src/mame/includes/dynax.h b/src/mame/includes/dynax.h index b54da654a76..d2b1687c18b 100644 --- a/src/mame/includes/dynax.h +++ b/src/mame/includes/dynax.h @@ -3,7 +3,7 @@ Dynax hardware ***************************************************************************/ - +#include "sound/msm5205.h" #include "sound/okim6295.h" class dynax_state : public driver_device @@ -16,7 +16,8 @@ public: m_protection2(*this, "protection2"), m_maincpu(*this, "maincpu"), m_soundcpu(*this, "soundcpu"), - m_oki(*this, "oki") + m_oki(*this, "oki"), + m_msm(*this, "msm") { } // up to 8 layers, 2 images per layer (interleaved on screen) @@ -162,6 +163,7 @@ public: device_t *m_rtc; device_t *m_ymsnd; optional_device<okim6295_device> m_oki; + optional_device<msm5205_device> m_msm; device_t *m_top_scr; device_t *m_bot_scr; DECLARE_WRITE8_MEMBER(dynax_vblank_ack_w); diff --git a/src/mame/includes/fantland.h b/src/mame/includes/fantland.h index ae227dc83f9..11cea3e3ebd 100644 --- a/src/mame/includes/fantland.h +++ b/src/mame/includes/fantland.h @@ -1,10 +1,14 @@ - +#include "sound/msm5205.h" class fantland_state : public driver_device { public: fantland_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_msm1(*this, "msm1"), + m_msm2(*this, "msm2"), + m_msm3(*this, "msm3"), + m_msm4(*this, "msm4"), m_spriteram(*this, "spriteram", 0), m_spriteram2(*this, "spriteram2", 0), m_maincpu(*this, "maincpu"), @@ -26,10 +30,10 @@ public: int m_adpcm_nibble[4]; /* devices */ - device_t *m_msm1; - device_t *m_msm2; - device_t *m_msm3; - device_t *m_msm4; + optional_device<msm5205_device> m_msm1; + optional_device<msm5205_device> m_msm2; + optional_device<msm5205_device> m_msm3; + optional_device<msm5205_device> m_msm4; optional_shared_ptr<UINT8> m_spriteram; optional_shared_ptr<UINT8> m_spriteram2; DECLARE_WRITE_LINE_MEMBER(galaxygn_sound_irq); diff --git a/src/mame/includes/firetrap.h b/src/mame/includes/firetrap.h index d1a84a2292a..15d81f8461f 100644 --- a/src/mame/includes/firetrap.h +++ b/src/mame/includes/firetrap.h @@ -3,6 +3,7 @@ Fire Trap ***************************************************************************/ +#include "sound/msm5205.h" class firetrap_state : public driver_device { @@ -14,7 +15,8 @@ public: m_fgvideoram(*this, "fgvideoram"), m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm"){ } /* memory pointers */ required_shared_ptr<UINT8> m_bg1videoram; @@ -44,7 +46,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; - device_t *m_msm; + required_device<msm5205_device> m_msm; DECLARE_WRITE8_MEMBER(firetrap_nmi_disable_w); DECLARE_WRITE8_MEMBER(firetrap_bankselect_w); DECLARE_READ8_MEMBER(firetrap_8751_bootleg_r); diff --git a/src/mame/includes/flstory.h b/src/mame/includes/flstory.h index d47aaf954f7..b105286a240 100644 --- a/src/mame/includes/flstory.h +++ b/src/mame/includes/flstory.h @@ -1,3 +1,4 @@ +#include "sound/msm5232.h" class flstory_state : public driver_device { @@ -10,7 +11,8 @@ public: m_workram(*this, "workram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_mcu(*this, "mcu"){ } + m_mcu(*this, "mcu"), + m_msm(*this, "msm"){ } /* memory pointers */ required_shared_ptr<UINT8> m_videoram; @@ -58,6 +60,7 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; optional_device<cpu_device> m_mcu; + required_device<msm5232_device> m_msm; /* mcu */ UINT8 m_mcu_cmd; diff --git a/src/mame/includes/fromance.h b/src/mame/includes/fromance.h index f310112d857..c1e46fcc325 100644 --- a/src/mame/includes/fromance.h +++ b/src/mame/includes/fromance.h @@ -6,7 +6,7 @@ and Bryan McPhail, Nicola Salmoria, Aaron Giles ***************************************************************************/ - +#include "sound/msm5205.h" #include "video/vsystem_spr2.h" class fromance_state : public driver_device @@ -18,7 +18,8 @@ public: m_spriteram(*this, "spriteram"), m_spr_old(*this, "vsystem_spr_old"), m_subcpu(*this, "sub"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } /* memory pointers (used by pipedrm) */ optional_shared_ptr<UINT8> m_videoram; @@ -96,4 +97,5 @@ public: void init_common( ); DECLARE_WRITE_LINE_MEMBER(fromance_adpcm_int); required_device<cpu_device> m_maincpu; + optional_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/gladiatr.h b/src/mame/includes/gladiatr.h index 1b8cbc59edd..64a66a9ab44 100644 --- a/src/mame/includes/gladiatr.h +++ b/src/mame/includes/gladiatr.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + class gladiatr_state : public driver_device { public: @@ -10,7 +12,8 @@ public: m_textram(*this, "textram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "sub") { } + m_subcpu(*this, "sub"), + m_msm(*this, "msm") { } required_shared_ptr<UINT8> m_nvram; required_shared_ptr<UINT8> m_spriteram; @@ -75,4 +78,5 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<cpu_device> m_subcpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/goal92.h b/src/mame/includes/goal92.h index da50b6dbd3e..85e30c2ebd4 100644 --- a/src/mame/includes/goal92.h +++ b/src/mame/includes/goal92.h @@ -3,7 +3,7 @@ Goal! '92 *************************************************************************/ - +#include "sound/msm5205.h" class goal92_state : public driver_device { public: @@ -15,7 +15,8 @@ public: m_spriteram(*this, "spriteram"), m_scrollram(*this, "scrollram"), m_audiocpu(*this, "audiocpu"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } /* memory pointers */ required_shared_ptr<UINT16> m_bg_data; @@ -59,4 +60,5 @@ public: DECLARE_WRITE_LINE_MEMBER(irqhandler); DECLARE_WRITE_LINE_MEMBER(goal92_adpcm_int); required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/gsword.h b/src/mame/includes/gsword.h index 316591eac11..ecb9bb7ac44 100644 --- a/src/mame/includes/gsword.h +++ b/src/mame/includes/gsword.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + class gsword_state : public driver_device { public: @@ -10,7 +12,8 @@ public: m_cpu2_ram(*this, "cpu2_ram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "sub") { } + m_subcpu(*this, "sub"), + m_msm(*this, "msm") { } required_shared_ptr<UINT8> m_spritetile_ram; required_shared_ptr<UINT8> m_spritexy_ram; @@ -55,4 +58,5 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; optional_device<cpu_device> m_subcpu; + optional_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/hnayayoi.h b/src/mame/includes/hnayayoi.h index c63db8ed5b9..835a3c5941b 100644 --- a/src/mame/includes/hnayayoi.h +++ b/src/mame/includes/hnayayoi.h @@ -3,13 +3,15 @@ Hana Yayoi & other Dynax games (using 1st version of their blitter) *************************************************************************/ +#include "sound/msm5205.h" class hnayayoi_state : public driver_device { public: hnayayoi_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } /* video-related */ UINT8 *m_pixmap[8]; @@ -43,4 +45,5 @@ public: void draw_layer_interleaved( bitmap_ind16 &bitmap, const rectangle &cliprect, int left_pixmap, int right_pixmap, int palbase, int transp ); DECLARE_WRITE_LINE_MEMBER(irqhandler); required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/kchamp.h b/src/mame/includes/kchamp.h index d7f56fd06ec..3f8d9c62084 100644 --- a/src/mame/includes/kchamp.h +++ b/src/mame/includes/kchamp.h @@ -3,6 +3,7 @@ Karate Champ *************************************************************************/ +#include "sound/msm5205.h" class kchamp_state : public driver_device { @@ -13,7 +14,8 @@ public: m_colorram(*this, "colorram"), m_spriteram(*this, "spriteram"), m_audiocpu(*this, "audiocpu"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } /* memory pointers */ required_shared_ptr<UINT8> m_videoram; @@ -59,4 +61,5 @@ public: UINT8 *decrypt_code(); DECLARE_WRITE_LINE_MEMBER(msmint); required_device<cpu_device> m_maincpu; + optional_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/lucky74.h b/src/mame/includes/lucky74.h index 5d3f3f69b1d..80db8e3265e 100644 --- a/src/mame/includes/lucky74.h +++ b/src/mame/includes/lucky74.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + class lucky74_state : public driver_device { public: @@ -7,7 +9,8 @@ public: m_fg_colorram(*this, "fg_colorram"), m_bg_videoram(*this, "bg_videoram"), m_bg_colorram(*this, "bg_colorram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } UINT8 m_ym2149_portb; UINT8 m_usart_8251; @@ -44,4 +47,5 @@ public: INTERRUPT_GEN_MEMBER(nmi_interrupt); DECLARE_WRITE_LINE_MEMBER(lucky74_adpcm_int); required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/mitchell.h b/src/mame/includes/mitchell.h index d7526968802..97a9620263a 100644 --- a/src/mame/includes/mitchell.h +++ b/src/mame/includes/mitchell.h @@ -7,6 +7,7 @@ #include "sound/okim6295.h" #include "machine/nvram.h" #include "machine/eeprom.h" +#include "sound/msm5205.h" class mitchell_state : public driver_device { @@ -19,7 +20,8 @@ public: m_nvram(*this, "nvram"), m_colorram(*this, "colorram"), m_videoram(*this, "videoram"), - m_eeprom(*this, "eeprom"){ } + m_eeprom(*this, "eeprom"), + m_msm(*this, "msm"){ } /* devices */ required_device<cpu_device> m_maincpu; @@ -31,6 +33,7 @@ public: required_shared_ptr<UINT8> m_videoram; optional_device<eeprom_device> m_eeprom; + optional_device<msm5205_device> m_msm; /* video-related */ tilemap_t *m_bg_tilemap; diff --git a/src/mame/includes/msisaac.h b/src/mame/includes/msisaac.h index fca3cf60550..cc17c451f90 100644 --- a/src/mame/includes/msisaac.h +++ b/src/mame/includes/msisaac.h @@ -1,3 +1,4 @@ +#include "sound/msm5232.h" /* Disabled because the mcu dump is currently unavailable. -AS */ //#define USE_MCU @@ -11,7 +12,8 @@ public: m_videoram3(*this, "videoram3"), m_videoram2(*this, "videoram2"), m_audiocpu(*this, "audiocpu"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } /* memory pointers */ required_shared_ptr<UINT8> m_spriteram; @@ -78,4 +80,5 @@ public: TIMER_CALLBACK_MEMBER(nmi_callback); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device<cpu_device> m_maincpu; + required_device<msm5232_device> m_msm; }; diff --git a/src/mame/includes/ojankohs.h b/src/mame/includes/ojankohs.h index 14040a524b6..359813adda2 100644 --- a/src/mame/includes/ojankohs.h +++ b/src/mame/includes/ojankohs.h @@ -3,6 +3,7 @@ Ojanko High School & other Video System mahjong series *************************************************************************/ +#include "sound/msm5205.h" class ojankohs_state : public driver_device { @@ -12,7 +13,8 @@ public: m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), m_paletteram(*this, "paletteram"), - m_maincpu(*this, "maincpu"){ } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm"){ } /* memory pointers */ optional_shared_ptr<UINT8> m_videoram; @@ -37,7 +39,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; - device_t *m_msm; + required_device<msm5205_device> m_msm; DECLARE_WRITE8_MEMBER(ojankohs_rombank_w); DECLARE_WRITE8_MEMBER(ojankoy_rombank_w); DECLARE_WRITE8_MEMBER(ojankohs_msm5205_w); diff --git a/src/mame/includes/opwolf.h b/src/mame/includes/opwolf.h index 567476fe817..597c8318a5d 100644 --- a/src/mame/includes/opwolf.h +++ b/src/mame/includes/opwolf.h @@ -3,6 +3,7 @@ Operation Wolf *************************************************************************/ +#include "sound/msm5205.h" class opwolf_state : public driver_device { @@ -11,7 +12,9 @@ public: : driver_device(mconfig, type, tag), m_cchip_ram(*this, "cchip_ram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_msm1(*this, "msm1"), + m_msm2(*this, "msm2") { } /* memory pointers */ optional_shared_ptr<UINT8> m_cchip_ram; @@ -50,8 +53,8 @@ public: required_device<cpu_device> m_audiocpu; device_t *m_pc080sn; device_t *m_pc090oj; - device_t *m_msm1; - device_t *m_msm2; + required_device<msm5205_device> m_msm1; + required_device<msm5205_device> m_msm2; DECLARE_READ16_MEMBER(cchip_r); DECLARE_WRITE16_MEMBER(cchip_w); DECLARE_READ16_MEMBER(opwolf_in_r); diff --git a/src/mame/includes/pcktgal.h b/src/mame/includes/pcktgal.h index 201a53de675..7345edc5e1d 100644 --- a/src/mame/includes/pcktgal.h +++ b/src/mame/includes/pcktgal.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + class pcktgal_state : public driver_device { public: @@ -5,7 +7,8 @@ public: : driver_device(mconfig, type, tag), m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm") { } int m_msm5205next; int m_toggle; @@ -24,4 +27,5 @@ public: DECLARE_WRITE_LINE_MEMBER(pcktgal_adpcm_int); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/rastan.h b/src/mame/includes/rastan.h index d0f02da3ae8..943396657bc 100644 --- a/src/mame/includes/rastan.h +++ b/src/mame/includes/rastan.h @@ -3,6 +3,7 @@ Rastan *************************************************************************/ +#include "sound/msm5205.h" class rastan_state : public driver_device { @@ -10,7 +11,8 @@ public: rastan_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm") { } /* memory pointers */ // UINT16 * paletteram; // this currently uses generic palette handlers @@ -26,6 +28,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + required_device<msm5205_device> m_msm; device_t *m_pc090oj; device_t *m_pc080sn; DECLARE_WRITE8_MEMBER(rastan_msm5205_address_w); diff --git a/src/mame/includes/sf.h b/src/mame/includes/sf.h index dfbdb7a0f15..ff406dd2868 100644 --- a/src/mame/includes/sf.h +++ b/src/mame/includes/sf.h @@ -3,6 +3,7 @@ Street Fighter *************************************************************************/ +#include "sound/msm5205.h" class sf_state : public driver_device { @@ -12,7 +13,9 @@ public: m_videoram(*this, "videoram"), m_objectram(*this, "objectram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_msm1(*this, "msm1"), + m_msm2(*this, "msm2"){ } /* memory pointers */ required_shared_ptr<UINT16> m_videoram; @@ -53,4 +56,6 @@ public: inline int sf_invert( int nb ); void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ); void write_dword( address_space &space, offs_t offset, UINT32 data ); + required_device<msm5205_device> m_msm1; + required_device<msm5205_device> m_msm2; }; diff --git a/src/mame/includes/spdodgeb.h b/src/mame/includes/spdodgeb.h index 0494fa6c622..67ecc0bd5a8 100644 --- a/src/mame/includes/spdodgeb.h +++ b/src/mame/includes/spdodgeb.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + class spdodgeb_state : public driver_device { public: @@ -6,7 +8,9 @@ public: m_videoram(*this, "videoram"), m_spriteram(*this, "spriteram"), m_maincpu(*this,"maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_msm1(*this, "msm1"), + m_msm2(*this, "msm2"){ } int m_toggle; int m_adpcm_pos[2]; @@ -56,4 +60,6 @@ public: DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_1); DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_2); required_device<cpu_device> m_audiocpu; + required_device<msm5205_device> m_msm1; + required_device<msm5205_device> m_msm2; }; diff --git a/src/mame/includes/splash.h b/src/mame/includes/splash.h index 974f45a70e5..bbb129ec401 100644 --- a/src/mame/includes/splash.h +++ b/src/mame/includes/splash.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + class splash_state : public driver_device { public: @@ -10,7 +12,10 @@ public: m_protdata(*this, "protdata"), m_bitmap_mode(*this, "bitmap_mode"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm"), + m_msm1(*this, "msm1"), + m_msm2(*this, "msm2") { } required_shared_ptr<UINT16> m_pixelram; required_shared_ptr<UINT16> m_videoram; @@ -77,4 +82,7 @@ public: DECLARE_WRITE_LINE_MEMBER(adpcm_int2); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + optional_device<msm5205_device> m_msm; + optional_device<msm5205_device> m_msm1; + optional_device<msm5205_device> m_msm2; }; diff --git a/src/mame/includes/srmp2.h b/src/mame/includes/srmp2.h index bef9da77c11..25a3e29c315 100644 --- a/src/mame/includes/srmp2.h +++ b/src/mame/includes/srmp2.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + struct iox_t { int reset,ff_event,ff_1,protcheck[4],protlatch[4]; @@ -11,7 +13,8 @@ class srmp2_state : public driver_device public: srmp2_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } int m_color_bank; int m_gfx_bank; @@ -53,4 +56,5 @@ public: UINT8 iox_key_matrix_calc(UINT8 p_side); DECLARE_WRITE_LINE_MEMBER(srmp2_adpcm_int); required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/stfight.h b/src/mame/includes/stfight.h index 965f42bd2e7..f8de2ebb55a 100644 --- a/src/mame/includes/stfight.h +++ b/src/mame/includes/stfight.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + class stfight_state : public driver_device { public: @@ -7,7 +9,8 @@ public: m_text_attr_ram(*this, "text_attr_ram"), m_vh_latch_ram(*this, "vh_latch_ram"), m_sprite_ram(*this, "sprite_ram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } required_shared_ptr<UINT8> m_text_char_ram; required_shared_ptr<UINT8> m_text_attr_ram; @@ -54,4 +57,5 @@ public: void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(stfight_adpcm_int); required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/taito_l.h b/src/mame/includes/taito_l.h index fbeaaad3186..6afac7f6177 100644 --- a/src/mame/includes/taito_l.h +++ b/src/mame/includes/taito_l.h @@ -1,3 +1,4 @@ +#include "sound/msm5205.h" #define TAITOL_SPRITERAM_SIZE 0x400 @@ -7,7 +8,8 @@ public: taitol_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm") { } /* memory pointers */ UINT8 * m_shared_ram; @@ -56,6 +58,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; optional_device<cpu_device> m_audiocpu; + optional_device<msm5205_device> m_msm; /* memory buffers */ UINT8 m_rambanks[0x1000 * 12]; diff --git a/src/mame/includes/tbowl.h b/src/mame/includes/tbowl.h index 127e02079a9..4c658bcef26 100644 --- a/src/mame/includes/tbowl.h +++ b/src/mame/includes/tbowl.h @@ -1,3 +1,4 @@ +#include "sound/msm5205.h" class tbowl_state : public driver_device { @@ -10,7 +11,9 @@ public: m_bg2videoram(*this, "bg2videoram"), m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_msm1(*this, "msm1"), + m_msm2(*this, "msm2") { } int m_adpcm_pos[2]; int m_adpcm_end[2]; @@ -62,4 +65,6 @@ public: DECLARE_WRITE_LINE_MEMBER(tbowl_adpcm_int_2); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + required_device<msm5205_device> m_msm1; + required_device<msm5205_device> m_msm2; }; diff --git a/src/mame/includes/tecmo.h b/src/mame/includes/tecmo.h index fe529566c22..96d85e27806 100644 --- a/src/mame/includes/tecmo.h +++ b/src/mame/includes/tecmo.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + class tecmo_state : public driver_device { public: @@ -8,7 +10,8 @@ public: m_bgvideoram(*this, "bgvideoram"), m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), - m_soundcpu(*this, "soundcpu") { } + m_soundcpu(*this, "soundcpu"), + m_msm(*this, "msm") { } int m_adpcm_pos; int m_adpcm_end; @@ -56,4 +59,5 @@ public: DECLARE_WRITE_LINE_MEMBER(tecmo_adpcm_int); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_soundcpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/tehkanwc.h b/src/mame/includes/tehkanwc.h index 94d6dad0515..94f3c6f32d2 100644 --- a/src/mame/includes/tehkanwc.h +++ b/src/mame/includes/tehkanwc.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + class tehkanwc_state : public driver_device { public: @@ -9,7 +11,8 @@ public: m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "sub") { } + m_subcpu(*this, "sub"), + m_msm(*this, "msm") { } int m_track0[2]; int m_track1[2]; @@ -57,4 +60,5 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<cpu_device> m_subcpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/tigeroad.h b/src/mame/includes/tigeroad.h index 2067c6462e6..229e06e2329 100644 --- a/src/mame/includes/tigeroad.h +++ b/src/mame/includes/tigeroad.h @@ -1,4 +1,5 @@ #include "video/bufsprite.h" +#include "sound/msm5205.h" class tigeroad_state : public driver_device { @@ -9,7 +10,8 @@ public: m_videoram(*this, "videoram"), m_ram16(*this, "ram16"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm") { } required_device<buffered_spriteram16_device> m_spriteram; required_shared_ptr<UINT16> m_videoram; @@ -35,4 +37,5 @@ public: DECLARE_WRITE_LINE_MEMBER(irqhandler); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + optional_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/toki.h b/src/mame/includes/toki.h index f28969d5dc7..465c8b65c51 100644 --- a/src/mame/includes/toki.h +++ b/src/mame/includes/toki.h @@ -1,4 +1,5 @@ #include "video/bufsprite.h" +#include "sound/msm5205.h" class toki_state : public driver_device { @@ -11,7 +12,8 @@ public: m_videoram(*this, "videoram"), m_scrollram16(*this, "scrollram16"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm") { } required_device<buffered_spriteram16_device> m_spriteram; required_shared_ptr<UINT16> m_background1_videoram16; @@ -47,4 +49,5 @@ public: DECLARE_WRITE_LINE_MEMBER(toki_adpcm_int); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + optional_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/topspeed.h b/src/mame/includes/topspeed.h index 94ccda0af2d..78cd9e9b13c 100644 --- a/src/mame/includes/topspeed.h +++ b/src/mame/includes/topspeed.h @@ -3,6 +3,7 @@ Top Speed / Full Throttle *************************************************************************/ +#include "sound/msm5205.h" class topspeed_state : public driver_device { @@ -15,7 +16,9 @@ public: m_sharedram(*this, "sharedram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "subcpu") + m_subcpu(*this, "subcpu"), + m_msm1(*this, "msm1"), + m_msm2(*this, "msm2") { } /* memory pointers */ @@ -41,6 +44,8 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<cpu_device> m_subcpu; + required_device<msm5205_device> m_msm1; + required_device<msm5205_device> m_msm2; device_t *m_pc080sn_1; device_t *m_pc080sn_2; device_t *m_tc0220ioc; diff --git a/src/mame/includes/tubep.h b/src/mame/includes/tubep.h index cf81ccf3681..fcc313640c0 100644 --- a/src/mame/includes/tubep.h +++ b/src/mame/includes/tubep.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + class tubep_state : public driver_device { public: @@ -10,7 +12,8 @@ public: m_maincpu(*this, "maincpu"), m_soundcpu(*this, "soundcpu"), m_slave(*this, "slave"), - m_mcu(*this, "mcu") { } + m_mcu(*this, "mcu"), + m_msm(*this, "msm") { } UINT8 m_sound_latch; UINT8 m_ls74; @@ -93,6 +96,7 @@ public: required_device<cpu_device> m_soundcpu; required_device<cpu_device> m_slave; required_device<cpu_device> m_mcu; + optional_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/wc90b.h b/src/mame/includes/wc90b.h index 88069a5803d..611cb2bc2eb 100644 --- a/src/mame/includes/wc90b.h +++ b/src/mame/includes/wc90b.h @@ -1,3 +1,5 @@ +#include "sound/msm5205.h" + class wc90b_state : public driver_device { public: @@ -13,7 +15,8 @@ public: m_scroll_x_lo(*this, "scroll_x_lo"), m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_msm(*this, "msm") { } int m_msm5205next; int m_toggle; @@ -47,4 +50,5 @@ public: DECLARE_WRITE_LINE_MEMBER(adpcm_int); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/yunsung8.h b/src/mame/includes/yunsung8.h index a82b2f6a0c9..4b997362964 100644 --- a/src/mame/includes/yunsung8.h +++ b/src/mame/includes/yunsung8.h @@ -3,6 +3,7 @@ Yun Sung 8 Bit Games *************************************************************************/ +#include "sound/msm5205.h" class yunsung8_state : public driver_device { @@ -10,7 +11,8 @@ public: yunsung8_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_audiocpu(*this, "audiocpu") , - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_msm(*this, "msm") { } /* video-related */ tilemap_t *m_tilemap_0; @@ -44,4 +46,5 @@ public: UINT32 screen_update_yunsung8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(yunsung8_adpcm_int); required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; }; diff --git a/src/mame/machine/stfight.c b/src/mame/machine/stfight.c index 979e44e483c..19e4b16458b 100644 --- a/src/mame/machine/stfight.c +++ b/src/mame/machine/stfight.c @@ -194,15 +194,15 @@ WRITE_LINE_MEMBER(stfight_state::stfight_adpcm_int) // finished playing sample? if( m_adpcm_data_offs == m_adpcm_data_end ) { - msm5205_reset_w(machine().device("msm"), 1 ); + msm5205_reset_w(m_msm, 1 ); return; } if( m_toggle == 0 ) - msm5205_data_w(machine().device("msm"), ( adpcm_data >> 4 ) & 0x0f ); + msm5205_data_w(m_msm, ( adpcm_data >> 4 ) & 0x0f ); else { - msm5205_data_w(machine().device("msm"), adpcm_data & 0x0f ); + msm5205_data_w(m_msm, adpcm_data & 0x0f ); m_adpcm_data_offs++; } @@ -217,7 +217,7 @@ WRITE8_MEMBER(stfight_state::stfight_adpcm_control_w) m_adpcm_data_end = sampleLimits[data+1]; } - msm5205_reset_w( machine().device("msm"), data & 0x08 ? 1 : 0 ); + msm5205_reset_w( m_msm, data & 0x08 ? 1 : 0 ); } WRITE8_MEMBER(stfight_state::stfight_e800_w) diff --git a/src/mess/includes/pce.h b/src/mess/includes/pce.h index c615aed47d4..5345bf1df8b 100644 --- a/src/mess/includes/pce.h +++ b/src/mess/includes/pce.h @@ -113,13 +113,15 @@ public: m_maincpu(*this, "maincpu"), m_cd_ram(*this, "cd_ram"), m_user_ram(*this, "user_ram"), - m_huc6260(*this, "huc6260") + m_huc6260(*this, "huc6260"), + m_msm5205(*this, "msm5205") { } required_device<h6280_device> m_maincpu; required_shared_ptr<UINT8> m_cd_ram; required_shared_ptr<UINT8> m_user_ram; optional_device<huc6260_device> m_huc6260; + optional_device<msm5205_device> m_msm5205; UINT8 m_io_port_options; UINT8 m_sys3_card; UINT8 m_acard; diff --git a/src/mess/machine/pce.c b/src/mess/machine/pce.c index 542ce6c60d9..332ab640d44 100644 --- a/src/mess/machine/pce.c +++ b/src/mess/machine/pce.c @@ -1271,12 +1271,12 @@ TIMER_CALLBACK_MEMBER(pce_state::pce_cd_adpcm_fadeout_callback) if(pce_cd.adpcm_volume <= 0) { pce_cd.adpcm_volume = 0.0; - msm5205_set_volume(machine().device("msm5205"), 0.0); + msm5205_set_volume(m_msm5205, 0.0); pce_cd.adpcm_fadeout_timer->adjust(attotime::never); } else { - msm5205_set_volume(machine().device("msm5205"), pce_cd.adpcm_volume); + msm5205_set_volume(m_msm5205, pce_cd.adpcm_volume); pce_cd.adpcm_fadeout_timer->adjust(attotime::from_usec(param), param); } } @@ -1289,12 +1289,12 @@ TIMER_CALLBACK_MEMBER(pce_state::pce_cd_adpcm_fadein_callback) if(pce_cd.adpcm_volume >= 100.0) { pce_cd.adpcm_volume = 100.0; - msm5205_set_volume(machine().device("msm5205"), 100.0); + msm5205_set_volume(m_msm5205, 100.0); pce_cd.adpcm_fadein_timer->adjust(attotime::never); } else { - msm5205_set_volume(machine().device("msm5205"), pce_cd.adpcm_volume); + msm5205_set_volume(m_msm5205, pce_cd.adpcm_volume); pce_cd.adpcm_fadein_timer->adjust(attotime::from_usec(param), param); } } @@ -1418,7 +1418,7 @@ WRITE8_MEMBER(pce_state::pce_cd_intf_w) break; case 0x0E: /* ADPCM playback rate */ pce_cd.adpcm_clock_divider = 0x10 - ( data & 0x0F ); - msm5205_change_clock_w(machine().device("msm5205"), (PCE_CD_CLOCK / 6) / pce_cd.adpcm_clock_divider); + msm5205_change_clock_w(m_msm5205, (PCE_CD_CLOCK / 6) / pce_cd.adpcm_clock_divider); break; case 0x0F: /* ADPCM and CD audio fade timer */ /* TODO: timers needs HW tests */ |