From 743b0a9c834869370cd7fbe70a2f7fa4de8f27c2 Mon Sep 17 00:00:00 2001 From: fulivi Date: Wed, 9 May 2018 16:03:21 +0200 Subject: [PATCH] tms9914: fixed handling of GTS aux command. --- src/devices/machine/tms9914.cpp | 16 ++++++++++------ src/devices/machine/tms9914.h | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/devices/machine/tms9914.cpp b/src/devices/machine/tms9914.cpp index 9706f22157b..4f47302a187 100644 --- a/src/devices/machine/tms9914.cpp +++ b/src/devices/machine/tms9914.cpp @@ -547,6 +547,7 @@ void tms9914_device::do_swrst() m_rl_state = FSM_RL_LOCS; m_pp_ppas = false; m_c_state = FSM_C_CIDS; + m_gts = false; update_int(); set_accrq(false); @@ -847,6 +848,7 @@ void tms9914_device::update_fsm() prev_state = m_c_state; if (controller_reset()) { m_c_state = FSM_C_CIDS; + m_gts = false; m_c_dly_timer->reset(); } else { switch (m_c_state) { @@ -863,8 +865,13 @@ void tms9914_device::update_fsm() case FSM_C_CACS: if (m_rpp) { m_c_state = FSM_C_CPWS; + m_gts = false; + } else if (m_gts && !sh_active()) { + m_c_state = FSM_C_CSBS; + m_gts = false; + // This ensures a BO interrupt is generated if TACS is active + m_sh_state = FSM_SH_SIDS; } - // gts -> CSBS break; case FSM_C_CSBS: @@ -1246,11 +1253,8 @@ void tms9914_device::do_aux_cmd(unsigned cmd , bool set_bit) break; case AUXCMD_GTS: - if (m_c_state == FSM_C_CACS && !sh_active()) { - m_c_state = FSM_C_CSBS; - m_ext_state_change = true; - // This ensures a BO interrupt is generated if TACS is active - m_sh_state = FSM_SH_SIDS; + if (m_c_state == FSM_C_CACS) { + m_gts = true; update_fsm(); } break; diff --git a/src/devices/machine/tms9914.h b/src/devices/machine/tms9914.h index 0800b58ef74..2c21b1a4d4b 100644 --- a/src/devices/machine/tms9914.h +++ b/src/devices/machine/tms9914.h @@ -160,6 +160,7 @@ private: bool m_hdfa; bool m_hdfe; bool m_rtl; + bool m_gts; bool m_rpp; bool m_sic; bool m_sre;