From 93eba4f59610611f06ba7cd28ef4df63fbb149d4 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 14 Sep 2017 07:22:27 -0400 Subject: advision: Synchronize sound commands (fixes sound in turtles, nw) --- src/mame/includes/advision.h | 2 ++ src/mame/machine/advision.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mame/includes/advision.h b/src/mame/includes/advision.h index f0435127ae7..716e7522413 100644 --- a/src/mame/includes/advision.h +++ b/src/mame/includes/advision.h @@ -56,6 +56,8 @@ public: DECLARE_WRITE8_MEMBER( bankswitch_w ); DECLARE_WRITE8_MEMBER( av_control_w ); DECLARE_READ_LINE_MEMBER( vsync_r ); + + TIMER_CALLBACK_MEMBER( sound_cmd_sync ); DECLARE_READ8_MEMBER( sound_cmd_r ); DECLARE_WRITE8_MEMBER( sound_g_w ); DECLARE_WRITE8_MEMBER( sound_d_w ); diff --git a/src/mame/machine/advision.cpp b/src/mame/machine/advision.cpp index adc01887ead..baa59914536 100644 --- a/src/mame/machine/advision.cpp +++ b/src/mame/machine/advision.cpp @@ -109,6 +109,11 @@ WRITE8_MEMBER( advision_state::ext_ram_w ) /* Sound */ +TIMER_CALLBACK_MEMBER( advision_state::sound_cmd_sync ) +{ + m_sound_cmd = param; +} + READ8_MEMBER( advision_state::sound_cmd_r ) { return m_sound_cmd; @@ -138,7 +143,7 @@ WRITE8_MEMBER( advision_state::sound_d_w ) WRITE8_MEMBER( advision_state::av_control_w ) { - m_sound_cmd = data >> 4; + machine().scheduler().synchronize(timer_expired_delegate(FUNC(advision_state::sound_cmd_sync), this), data >> 4); if ((m_video_enable == 0x00) && (data & 0x10)) { -- cgit v1.2.3