From 84c7e2bde214cc3185eb6d75e0b70fe106d02499 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Thu, 23 Feb 2023 19:58:14 +0100 Subject: m68000: Ensure tas rmw cycle is actually uninterruptible enough --- src/devices/cpu/m68000/m68000-sdf.cpp | 77 +++++++++++++--------------------- src/devices/cpu/m68000/m68000-sdfm.cpp | 77 +++++++++++++--------------------- src/devices/cpu/m68000/m68000-sdp.cpp | 77 +++++++++++++--------------------- src/devices/cpu/m68000/m68000-sdpm.cpp | 77 +++++++++++++--------------------- src/devices/cpu/m68000/m68000-sif.cpp | 77 +++++++++++++--------------------- src/devices/cpu/m68000/m68000-sifm.cpp | 77 +++++++++++++--------------------- src/devices/cpu/m68000/m68000-sip.cpp | 77 +++++++++++++--------------------- src/devices/cpu/m68000/m68000-sipm.cpp | 77 +++++++++++++--------------------- src/devices/cpu/m68000/m68000gen.py | 34 +++++++++++---- 9 files changed, 249 insertions(+), 401 deletions(-) diff --git a/src/devices/cpu/m68000/m68000-sdf.cpp b/src/devices/cpu/m68000/m68000-sdf.cpp index 340f76eceb9..d311e8c586f 100644 --- a/src/devices/cpu/m68000/m68000-sdf.cpp +++ b/src/devices/cpu/m68000/m68000-sdf.cpp @@ -90675,12 +90675,9 @@ void m68000_device::tas_ais_df() // 4ad0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_dcr = m_da[m_movems]; @@ -90704,7 +90701,7 @@ void m68000_device::tas_ais_df() // 4ad0 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90765,12 +90762,9 @@ void m68000_device::tas_aips_df() // 4ad8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_da[ry] = m_au; @@ -90796,7 +90790,7 @@ void m68000_device::tas_aips_df() // 4ad8 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90858,12 +90852,9 @@ void m68000_device::tas_pais_df() // 4ae0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_at = m_au; @@ -90890,7 +90881,7 @@ void m68000_device::tas_pais_df() // 4ae0 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90971,12 +90962,9 @@ void m68000_device::tas_das_df() // 4ae8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_dcr = m_da[m_movems]; @@ -91000,7 +90988,7 @@ void m68000_device::tas_das_df() // 4ae8 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91121,12 +91109,9 @@ adsw2: if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_dcr = m_da[m_movems]; @@ -91150,7 +91135,7 @@ adsw2: if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91229,12 +91214,9 @@ void m68000_device::tas_adr16_df() // 4af8 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_au = m_pc + 2; @@ -91259,7 +91241,7 @@ void m68000_device::tas_adr16_df() // 4af8 ffff if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91360,12 +91342,9 @@ void m68000_device::tas_adr32_df() // 4af9 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 5; - } else - m_inst_substate = 6; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 5; return; } m_au = m_pc + 2; @@ -91390,7 +91369,7 @@ void m68000_device::tas_adr32_df() // 4af9 ffff if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 7; + m_inst_substate = 5; } else m_inst_substate = 8; return; diff --git a/src/devices/cpu/m68000/m68000-sdfm.cpp b/src/devices/cpu/m68000/m68000-sdfm.cpp index 7e20be9262f..70c70e6bb1d 100644 --- a/src/devices/cpu/m68000/m68000-sdfm.cpp +++ b/src/devices/cpu/m68000/m68000-sdfm.cpp @@ -90675,12 +90675,9 @@ void m68000_device::tas_ais_dfm() // 4ad0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_dcr = m_da[m_movems]; @@ -90704,7 +90701,7 @@ void m68000_device::tas_ais_dfm() // 4ad0 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90765,12 +90762,9 @@ void m68000_device::tas_aips_dfm() // 4ad8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_da[ry] = m_au; @@ -90796,7 +90790,7 @@ void m68000_device::tas_aips_dfm() // 4ad8 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90858,12 +90852,9 @@ void m68000_device::tas_pais_dfm() // 4ae0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_at = m_au; @@ -90890,7 +90881,7 @@ void m68000_device::tas_pais_dfm() // 4ae0 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90971,12 +90962,9 @@ void m68000_device::tas_das_dfm() // 4ae8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_dcr = m_da[m_movems]; @@ -91000,7 +90988,7 @@ void m68000_device::tas_das_dfm() // 4ae8 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91121,12 +91109,9 @@ adsw2: if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_dcr = m_da[m_movems]; @@ -91150,7 +91135,7 @@ adsw2: if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91229,12 +91214,9 @@ void m68000_device::tas_adr16_dfm() // 4af8 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_au = m_pc + 2; @@ -91259,7 +91241,7 @@ void m68000_device::tas_adr16_dfm() // 4af8 ffff if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91360,12 +91342,9 @@ void m68000_device::tas_adr32_dfm() // 4af9 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 5; - } else - m_inst_substate = 6; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 5; return; } m_au = m_pc + 2; @@ -91390,7 +91369,7 @@ void m68000_device::tas_adr32_dfm() // 4af9 ffff if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 7; + m_inst_substate = 5; } else m_inst_substate = 8; return; diff --git a/src/devices/cpu/m68000/m68000-sdp.cpp b/src/devices/cpu/m68000/m68000-sdp.cpp index f9ca8f73b03..0b5230939c1 100644 --- a/src/devices/cpu/m68000/m68000-sdp.cpp +++ b/src/devices/cpu/m68000/m68000-sdp.cpp @@ -103257,12 +103257,9 @@ void m68000_device::tas_ais_dp() // 4ad0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103288,7 +103285,7 @@ void m68000_device::tas_ais_dp() // 4ad0 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103358,12 +103355,9 @@ void m68000_device::tas_aips_dp() // 4ad8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103391,7 +103385,7 @@ void m68000_device::tas_aips_dp() // 4ad8 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103462,12 +103456,9 @@ void m68000_device::tas_pais_dp() // 4ae0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103496,7 +103487,7 @@ void m68000_device::tas_pais_dp() // 4ae0 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103589,12 +103580,9 @@ void m68000_device::tas_das_dp() // 4ae8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103620,7 +103608,7 @@ void m68000_device::tas_das_dp() // 4ae8 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -103756,12 +103744,9 @@ adsw2: if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103787,7 +103772,7 @@ adsw2: if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -103878,12 +103863,9 @@ void m68000_device::tas_adr16_dp() // 4af8 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103910,7 +103892,7 @@ void m68000_device::tas_adr16_dp() // 4af8 ffff if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -104026,12 +104008,9 @@ void m68000_device::tas_adr32_dp() // 4af9 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 5; - } else - m_inst_substate = 6; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 5; return; } [[fallthrough]]; case 6: @@ -104058,7 +104037,7 @@ void m68000_device::tas_adr32_dp() // 4af9 ffff if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 7; + m_inst_substate = 5; } else m_inst_substate = 8; return; diff --git a/src/devices/cpu/m68000/m68000-sdpm.cpp b/src/devices/cpu/m68000/m68000-sdpm.cpp index 3315f15eecb..a5d3d94a73a 100644 --- a/src/devices/cpu/m68000/m68000-sdpm.cpp +++ b/src/devices/cpu/m68000/m68000-sdpm.cpp @@ -103257,12 +103257,9 @@ void m68000_device::tas_ais_dpm() // 4ad0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103288,7 +103285,7 @@ void m68000_device::tas_ais_dpm() // 4ad0 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103358,12 +103355,9 @@ void m68000_device::tas_aips_dpm() // 4ad8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103391,7 +103385,7 @@ void m68000_device::tas_aips_dpm() // 4ad8 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103462,12 +103456,9 @@ void m68000_device::tas_pais_dpm() // 4ae0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103496,7 +103487,7 @@ void m68000_device::tas_pais_dpm() // 4ae0 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103589,12 +103580,9 @@ void m68000_device::tas_das_dpm() // 4ae8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103620,7 +103608,7 @@ void m68000_device::tas_das_dpm() // 4ae8 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -103756,12 +103744,9 @@ adsw2: if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103787,7 +103772,7 @@ adsw2: if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -103878,12 +103863,9 @@ void m68000_device::tas_adr16_dpm() // 4af8 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103910,7 +103892,7 @@ void m68000_device::tas_adr16_dpm() // 4af8 ffff if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -104026,12 +104008,9 @@ void m68000_device::tas_adr32_dpm() // 4af9 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 5; - } else - m_inst_substate = 6; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 5; return; } [[fallthrough]]; case 6: @@ -104058,7 +104037,7 @@ void m68000_device::tas_adr32_dpm() // 4af9 ffff if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 7; + m_inst_substate = 5; } else m_inst_substate = 8; return; diff --git a/src/devices/cpu/m68000/m68000-sif.cpp b/src/devices/cpu/m68000/m68000-sif.cpp index f76c8c519e0..ad98805c048 100644 --- a/src/devices/cpu/m68000/m68000-sif.cpp +++ b/src/devices/cpu/m68000/m68000-sif.cpp @@ -90675,12 +90675,9 @@ void m68000_device::tas_ais_if() // 4ad0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_dcr = m_da[m_movems]; @@ -90704,7 +90701,7 @@ void m68000_device::tas_ais_if() // 4ad0 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90765,12 +90762,9 @@ void m68000_device::tas_aips_if() // 4ad8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_da[ry] = m_au; @@ -90796,7 +90790,7 @@ void m68000_device::tas_aips_if() // 4ad8 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90858,12 +90852,9 @@ void m68000_device::tas_pais_if() // 4ae0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_at = m_au; @@ -90890,7 +90881,7 @@ void m68000_device::tas_pais_if() // 4ae0 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90971,12 +90962,9 @@ void m68000_device::tas_das_if() // 4ae8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_dcr = m_da[m_movems]; @@ -91000,7 +90988,7 @@ void m68000_device::tas_das_if() // 4ae8 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91121,12 +91109,9 @@ adsw2: if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_dcr = m_da[m_movems]; @@ -91150,7 +91135,7 @@ adsw2: if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91229,12 +91214,9 @@ void m68000_device::tas_adr16_if() // 4af8 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_au = m_pc + 2; @@ -91259,7 +91241,7 @@ void m68000_device::tas_adr16_if() // 4af8 ffff if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91360,12 +91342,9 @@ void m68000_device::tas_adr32_if() // 4af9 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 5; - } else - m_inst_substate = 6; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 5; return; } m_au = m_pc + 2; @@ -91390,7 +91369,7 @@ void m68000_device::tas_adr32_if() // 4af9 ffff if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 7; + m_inst_substate = 5; } else m_inst_substate = 8; return; diff --git a/src/devices/cpu/m68000/m68000-sifm.cpp b/src/devices/cpu/m68000/m68000-sifm.cpp index 051af86f520..4799953661e 100644 --- a/src/devices/cpu/m68000/m68000-sifm.cpp +++ b/src/devices/cpu/m68000/m68000-sifm.cpp @@ -90675,12 +90675,9 @@ void m68000_device::tas_ais_ifm() // 4ad0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_dcr = m_da[m_movems]; @@ -90704,7 +90701,7 @@ void m68000_device::tas_ais_ifm() // 4ad0 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90765,12 +90762,9 @@ void m68000_device::tas_aips_ifm() // 4ad8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_da[ry] = m_au; @@ -90796,7 +90790,7 @@ void m68000_device::tas_aips_ifm() // 4ad8 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90858,12 +90852,9 @@ void m68000_device::tas_pais_ifm() // 4ae0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } m_at = m_au; @@ -90890,7 +90881,7 @@ void m68000_device::tas_pais_ifm() // 4ae0 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -90971,12 +90962,9 @@ void m68000_device::tas_das_ifm() // 4ae8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_dcr = m_da[m_movems]; @@ -91000,7 +90988,7 @@ void m68000_device::tas_das_ifm() // 4ae8 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91121,12 +91109,9 @@ adsw2: if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_dcr = m_da[m_movems]; @@ -91150,7 +91135,7 @@ adsw2: if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91229,12 +91214,9 @@ void m68000_device::tas_adr16_ifm() // 4af8 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } m_au = m_pc + 2; @@ -91259,7 +91241,7 @@ void m68000_device::tas_adr16_ifm() // 4af8 ffff if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -91360,12 +91342,9 @@ void m68000_device::tas_adr32_ifm() // 4af9 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 5; - } else - m_inst_substate = 6; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 5; return; } m_au = m_pc + 2; @@ -91390,7 +91369,7 @@ void m68000_device::tas_adr32_ifm() // 4af9 ffff if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 7; + m_inst_substate = 5; } else m_inst_substate = 8; return; diff --git a/src/devices/cpu/m68000/m68000-sip.cpp b/src/devices/cpu/m68000/m68000-sip.cpp index b46ba317e5a..43a30bdb727 100644 --- a/src/devices/cpu/m68000/m68000-sip.cpp +++ b/src/devices/cpu/m68000/m68000-sip.cpp @@ -103257,12 +103257,9 @@ void m68000_device::tas_ais_ip() // 4ad0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103288,7 +103285,7 @@ void m68000_device::tas_ais_ip() // 4ad0 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103358,12 +103355,9 @@ void m68000_device::tas_aips_ip() // 4ad8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103391,7 +103385,7 @@ void m68000_device::tas_aips_ip() // 4ad8 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103462,12 +103456,9 @@ void m68000_device::tas_pais_ip() // 4ae0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103496,7 +103487,7 @@ void m68000_device::tas_pais_ip() // 4ae0 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103589,12 +103580,9 @@ void m68000_device::tas_das_ip() // 4ae8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103620,7 +103608,7 @@ void m68000_device::tas_das_ip() // 4ae8 fff8 if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -103756,12 +103744,9 @@ adsw2: if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103787,7 +103772,7 @@ adsw2: if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -103878,12 +103863,9 @@ void m68000_device::tas_adr16_ip() // 4af8 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103910,7 +103892,7 @@ void m68000_device::tas_adr16_ip() // 4af8 ffff if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -104026,12 +104008,9 @@ void m68000_device::tas_adr32_ip() // 4af9 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= 0) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 5; - } else - m_inst_substate = 6; + if(m_icount <= 0 && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 5; return; } [[fallthrough]]; case 6: @@ -104058,7 +104037,7 @@ void m68000_device::tas_adr32_ip() // 4af9 ffff if(m_icount <= 0) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 7; + m_inst_substate = 5; } else m_inst_substate = 8; return; diff --git a/src/devices/cpu/m68000/m68000-sipm.cpp b/src/devices/cpu/m68000/m68000-sipm.cpp index 8776425c623..eb239a737ac 100644 --- a/src/devices/cpu/m68000/m68000-sipm.cpp +++ b/src/devices/cpu/m68000/m68000-sipm.cpp @@ -103257,12 +103257,9 @@ void m68000_device::tas_ais_ipm() // 4ad0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103288,7 +103285,7 @@ void m68000_device::tas_ais_ipm() // 4ad0 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103358,12 +103355,9 @@ void m68000_device::tas_aips_ipm() // 4ad8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103391,7 +103385,7 @@ void m68000_device::tas_aips_ipm() // 4ad8 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103462,12 +103456,9 @@ void m68000_device::tas_pais_ipm() // 4ae0 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 1; - } else - m_inst_substate = 2; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 1; return; } [[fallthrough]]; case 2: @@ -103496,7 +103487,7 @@ void m68000_device::tas_pais_ipm() // 4ae0 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 3; + m_inst_substate = 1; } else m_inst_substate = 4; return; @@ -103589,12 +103580,9 @@ void m68000_device::tas_das_ipm() // 4ae8 fff8 if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103620,7 +103608,7 @@ void m68000_device::tas_das_ipm() // 4ae8 fff8 if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -103756,12 +103744,9 @@ adsw2: if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103787,7 +103772,7 @@ adsw2: if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -103878,12 +103863,9 @@ void m68000_device::tas_adr16_ipm() // 4af8 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 3; - } else - m_inst_substate = 4; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 3; return; } [[fallthrough]]; case 4: @@ -103910,7 +103892,7 @@ void m68000_device::tas_adr16_ipm() // 4af8 ffff if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 5; + m_inst_substate = 3; } else m_inst_substate = 6; return; @@ -104026,12 +104008,9 @@ void m68000_device::tas_adr32_ipm() // 4af9 ffff if(!(m_aob & 1)) m_edb >>= 8; m_icount -= 4; - if(m_icount <= m_bcount) { - if(access_to_be_redone()) { - m_icount += 4; - m_inst_substate = 5; - } else - m_inst_substate = 6; + if(m_icount <= m_bcount && access_to_be_redone()) { + m_icount += 4; + m_inst_substate = 5; return; } [[fallthrough]]; case 6: @@ -104058,7 +104037,7 @@ void m68000_device::tas_adr32_ipm() // 4af9 ffff if(m_icount <= m_bcount) { if(access_to_be_redone()) { m_icount += 4; - m_inst_substate = 7; + m_inst_substate = 5; } else m_inst_substate = 8; return; diff --git a/src/devices/cpu/m68000/m68000gen.py b/src/devices/cpu/m68000/m68000gen.py index 5c3f882641b..c3282ea9789 100755 --- a/src/devices/cpu/m68000/m68000gen.py +++ b/src/devices/cpu/m68000/m68000gen.py @@ -2098,7 +2098,6 @@ def generate_source_from_code(code, gen_mode): is_interrupt_vector_lookup = not ci[4] and ci[2] == 2 if is_interrupt_vector_lookup: source.append("\tstart_interrupt_vector_lookup();") - if not (gen_mode & GEN.full): source.append("\t[[fallthrough]]; case %d:" % (ci[1])) if ci[4]: @@ -2140,14 +2139,31 @@ def generate_source_from_code(code, gen_mode): else: source.append("\tm_edb = m_mmu->read_%s(m_aob & ~1, 0xffff);" % (["program", "data"][ci[2]])) source.append("\tm_icount -= 4;") - source.append("\tif(m_icount <= %s) {" % ("m_bcount" if gen_mode & GEN.mcu else "0")) - source.append("\t\tif(access_to_be_redone()) {") - source.append("\t\t\tm_icount += 4;") - source.append("\t\t\tm_inst_substate = %d;" % ci[1]) - source.append("\t\t} else") - source.append("\t\t\tm_inst_substate = %d;" % (ci[1]+1)) - source.append("\t\treturn;") - source.append("\t}") + if ci[8]: + if ci[4]: + source.append("\tif(m_icount <= %s) {" % ("m_bcount" if gen_mode & GEN.mcu else "0")) + source.append("\t\tif(access_to_be_redone()) {") + source.append("\t\t\tm_icount += 4;") + source.append("\t\t\tm_inst_substate = %d;" % (ci[1]-2)) + source.append("\t\t} else") + source.append("\t\t\tm_inst_substate = %d;" % (ci[1]+1)) + source.append("\t\treturn;") + source.append("\t}") + else: + source.append("\tif(m_icount <= %s && access_to_be_redone()) {" % ("m_bcount" if gen_mode & GEN.mcu else "0")) + source.append("\t\tm_icount += 4;") + source.append("\t\tm_inst_substate = %d;" % ci[1]) + source.append("\t\treturn;") + source.append("\t}") + else: + source.append("\tif(m_icount <= %s) {" % ("m_bcount" if gen_mode & GEN.mcu else "0")) + source.append("\t\tif(access_to_be_redone()) {") + source.append("\t\t\tm_icount += 4;") + source.append("\t\t\tm_inst_substate = %d;" % ci[1]) + source.append("\t\t} else") + source.append("\t\t\tm_inst_substate = %d;" % (ci[1]+1)) + source.append("\t\treturn;") + source.append("\t}") if not (gen_mode & GEN.full): source.append("\t[[fallthrough]]; case %d:" % (ci[1]+1)) if is_interrupt_vector_lookup: -- cgit v1.2.3