diff options
| author | 2021-04-04 11:51:14 -0400 | |
|---|---|---|
| committer | 2021-04-04 11:52:09 -0400 | |
| commit | 5a63d0e7380985786e87a49704761b1f6226983e (patch) | |
| tree | 4fbd6b8b0c0b9c5e44b22c54cde3e36f9499efb3 | |
| parent | 6ac210c6bea9e56943a5a4a26666e5268652942c (diff) | |
megasys1.cpp: Reset the sound devices when the sound CPU is reset. This fixes the stuck note in soldam's attract mode.
| -rw-r--r-- | src/mame/includes/megasys1.h | 2 | ||||
| -rw-r--r-- | src/mame/video/megasys1.cpp | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/mame/includes/megasys1.h b/src/mame/includes/megasys1.h index 133a2e81802..22882db2546 100644 --- a/src/mame/includes/megasys1.h +++ b/src/mame/includes/megasys1.h @@ -32,6 +32,7 @@ public: m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_oki(*this, "oki%u", 1U), + m_ymsnd(*this, "ymsnd"), m_p47b_adpcm(*this, "msm%u", 1U), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), @@ -96,6 +97,7 @@ private: required_device<cpu_device> m_maincpu; optional_device<cpu_device> m_audiocpu; optional_device_array<okim6295_device, 2> m_oki; + optional_device<device_t> m_ymsnd; optional_device_array<msm5205_device, 2> m_p47b_adpcm; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; diff --git a/src/mame/video/megasys1.cpp b/src/mame/video/megasys1.cpp index 6c1b3b144dd..e3ffa605b80 100644 --- a/src/mame/video/megasys1.cpp +++ b/src/mame/video/megasys1.cpp @@ -195,6 +195,7 @@ actual code sent to the hardware. #include "emu.h" #include "includes/megasys1.h" +#include "sound/ym2151.h" @@ -261,12 +262,15 @@ void megasys1_state::screen_flag_w(offs_t offset, u16 data, u16 mem_mask) COMBINE_DATA(&m_screen_flag); if (m_audiocpu.found()) - { - if (m_screen_flag & 0x10) - m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - else - m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); - } + m_audiocpu->set_input_line(INPUT_LINE_RESET, BIT(m_screen_flag, 4) ? ASSERT_LINE : CLEAR_LINE); + + ym2151_device *opm = dynamic_cast<ym2151_device *>(m_ymsnd.target()); + if (opm != nullptr) + opm->reset_w(!BIT(m_screen_flag, 4)); + if (BIT(m_screen_flag, 4) && m_oki[0].found()) + m_oki[0]->reset(); + if (BIT(m_screen_flag, 4) && m_oki[1].found()) + m_oki[1]->reset(); } void megasys1_state::soundlatch_w(u16 data) |
