diff --git a/src/devices/cpu/tms32025/tms32025.cpp b/src/devices/cpu/tms32025/tms32025.cpp index 2d543fe3bc081..eace72764b688 100644 --- a/src/devices/cpu/tms32025/tms32025.cpp +++ b/src/devices/cpu/tms32025/tms32025.cpp @@ -336,7 +336,7 @@ void tms3202x_device::dxr_w(uint16_t data) if(TXM) { if(FSM) - m_waiting_for_serial_frame = 1; + m_waiting_for_serial_frame = true; else m_IFR |= 0x20; } @@ -394,12 +394,14 @@ inline void tms3202x_device::MODIFY_DP(int data) m_STR0 |= (data & DP_REG); m_STR0 |= 0x0400; } + inline void tms3202x_device::MODIFY_PM(int data) { m_STR1 &= ~PM_REG; m_STR1 |= (data & PM_REG); m_STR1 |= m_fixed_STR1; } + inline void tms3202x_device::MODIFY_ARP(int data) { m_STR1 &= ~ARB_REG; @@ -410,12 +412,11 @@ inline void tms3202x_device::MODIFY_ARP(int data) m_STR0 |= 0x0400; } -uint16_t tms3202x_device::reverse_carry_add(uint16_t arg0, uint16_t arg1 ) +uint16_t tms3202x_device::reverse_carry_add(uint16_t arg0, uint16_t arg1) { uint16_t result = 0; int carry = 0; - int count; - for (count = 0; count < 16; count++) + for (int count = 0; count < 16; count++) { int sum = (arg0 >> 15) + (arg1 >> 15) + carry; result = (result << 1) | (sum & 1); @@ -426,6 +427,7 @@ uint16_t tms3202x_device::reverse_carry_add(uint16_t arg0, uint16_t arg1 ) return result; } +template inline void tms3202x_device::MODIFY_AR_ARP() { /* modify address register referenced by ARP */ switch (m_opcode.b.l & 0x70) /* Cases ordered by predicted useage */ @@ -461,7 +463,7 @@ inline void tms3202x_device::MODIFY_AR_ARP() break; } - if (!m_mHackIgnoreARP) + if (!IgnoreARPHack) { if (m_opcode.b.l & 8) { /* bit 3 determines if new value is loaded into ARP */ @@ -508,7 +510,7 @@ inline void tms3202x_device::CALCULATE_ADD_OVERFLOW(int32_t addval) inline void tms3202x_device::CALCULATE_SUB_OVERFLOW(int32_t subval) { - if ((int32_t)((m_oldacc.d ^ subval) & (m_oldacc.d ^ m_ACC.d)) < 0) + if (int32_t((m_oldacc.d ^ subval) & (m_oldacc.d ^ m_ACC.d)) < 0) { SET0(OV_FLAG); if (OVM) @@ -521,13 +523,14 @@ inline void tms3202x_device::CALCULATE_SUB_OVERFLOW(int32_t subval) inline uint16_t tms3202x_device::POP_STACK() { uint16_t const data = m_STACK[m_stack_limit]; - for (unsigned i = m_stack_limit; 0 < i; --i) + for (unsigned i = m_stack_limit; i > 0; --i) m_STACK[i] = m_STACK[i - 1]; return data; } + inline void tms3202x_device::PUSH_STACK(uint16_t data) { - for (unsigned i = 0; m_stack_limit > i; ++i) + for (unsigned i = 0; i < m_stack_limit; ++i) m_STACK[i] = m_STACK[i + 1]; m_STACK[m_stack_limit] = data; } @@ -544,7 +547,8 @@ inline void tms3202x_device::SHIFT_Preg_TO_ALU() } } -inline void tms3202x_device::GETDATA(int shift,int signext) +template +inline void tms3202x_device::GETDATA() { if (m_opcode.b.l & 0x80) { /* indirect memory access */ @@ -555,49 +559,40 @@ inline void tms3202x_device::GETDATA(int shift,int signext) m_memaccess = DMA; } - if (m_memaccess >= 0x800) - { - m_external_mem_access = 1; /* Pause if hold pin is active */ - } - else - { - m_external_mem_access = 0; - } - m_ALU.d = (uint16_t)m_data.read_word(m_memaccess); - if (signext) m_ALU.d = (int16_t)m_ALU.d; - m_ALU.d <<= shift; /* next ARP */ - if (m_opcode.b.l & 0x80) MODIFY_AR_ARP(); + if (m_opcode.b.l & 0x80) MODIFY_AR_ARP(); +} + +inline void tms3202x_device::GETDATA(int shift, int signext) +{ + GETDATA(); + + if (signext) + m_ALU.d = (int16_t)m_ALU.d; + + m_ALU.d <<= shift; } inline void tms3202x_device::PUTDATA(uint16_t data) { if (m_opcode.b.l & 0x80) { - if (m_memaccess >= 0x800) m_external_mem_access = 1; /* Pause if hold pin is active */ - else m_external_mem_access = 0; - m_data.write_word(IND, data); MODIFY_AR_ARP(); } else { - if (m_memaccess >= 0x800) m_external_mem_access = 1; /* Pause if hold pin is active */ - else m_external_mem_access = 0; - m_data.write_word(DMA, data); } } + inline void tms3202x_device::PUTDATA_SST(uint16_t data) { if (m_opcode.b.l & 0x80) m_memaccess = IND; else m_memaccess = DMApg0; - if (m_memaccess >= 0x800) m_external_mem_access = 1; /* Pause if hold pin is active */ - else m_external_mem_access = 0; - if (m_opcode.b.l & 0x80) { m_opcode.b.l &= 0xf7; /* Stop ARP changes */ MODIFY_AR_ARP(); @@ -623,7 +618,7 @@ void tms3202x_device::illegal() void tms3202x_device::abst() { - if ( (int32_t)(m_ACC.d) < 0 ) { + if ((int32_t)m_ACC.d < 0) { m_ACC.d = -m_ACC.d; if (m_ACC.d == 0x80000000) { SET0(OV_FLAG); @@ -643,7 +638,7 @@ void tms3202x_device::add() void tms3202x_device::addc() { m_oldacc.d = m_ACC.d; - GETDATA(0, 0); + GETDATA(); if (CARRY) m_ACC.d++; m_ACC.d += m_ALU.d; CALCULATE_ADD_OVERFLOW(m_ALU.d); @@ -653,12 +648,12 @@ void tms3202x_device::addc() void tms3202x_device::addh() { m_oldacc.d = m_ACC.d; - GETDATA(0, 0); + GETDATA(); m_ACC.w.h += m_ALU.w.l; - if ( (uint16_t)(m_oldacc.w.h) > (uint16_t)(m_ACC.w.h) ) { + if ((uint16_t)m_oldacc.w.h > (uint16_t)m_ACC.w.h) { SET1(C_FLAG); /* Carry flag is not cleared, if no carry occurred */ } - if ((int16_t)((m_ACC.w.h ^ m_ALU.w.l) & (m_oldacc.w.h ^ m_ACC.w.h)) < 0) { + if (int16_t((m_ACC.w.h ^ m_ALU.w.l) & (m_oldacc.w.h ^ m_ACC.w.h)) < 0) { SET0(OV_FLAG); if (OVM) m_ACC.w.h = ((int16_t)m_oldacc.w.h < 0) ? 0x8000 : 0x7fff; } @@ -674,7 +669,7 @@ void tms3202x_device::addk() void tms3202x_device::adds() { m_oldacc.d = m_ACC.d; - GETDATA(0, 0); + GETDATA(); m_ACC.d += m_ALU.d; CALCULATE_ADD_OVERFLOW(m_ALU.d); CALCULATE_ADD_CARRY(); @@ -704,7 +699,7 @@ void tms3202x_device::adrk() } void tms3202x_device::and_() { - GETDATA(0, 0); + GETDATA(); m_ACC.d &= m_ALU.d; } void tms3202x_device::andk() @@ -758,13 +753,13 @@ void tms3202x_device::bc() } void tms3202x_device::bgez() { - if ( (int32_t)(m_ACC.d) >= 0 ) m_PC = m_cache.read_word(m_PC); + if ((int32_t)m_ACC.d >= 0) m_PC = m_cache.read_word(m_PC); else m_PC++; MODIFY_AR_ARP(); } void tms3202x_device::bgz() { - if ( (int32_t)(m_ACC.d) > 0 ) m_PC = m_cache.read_word(m_PC); + if ((int32_t)m_ACC.d > 0) m_PC = m_cache.read_word(m_PC); else m_PC++; MODIFY_AR_ARP(); } @@ -776,19 +771,19 @@ void tms3202x_device::bioz() } void tms3202x_device::bit() { - GETDATA(0, 0); + GETDATA(); if (m_ALU.d & (0x8000 >> (m_opcode.b.h & 0xf))) SET1(TC_FLAG); else CLR1(TC_FLAG); } void tms3202x_device::bitt() { - GETDATA(0, 0); + GETDATA(); if (m_ALU.d & (0x8000 >> (m_Treg & 0xf))) SET1(TC_FLAG); else CLR1(TC_FLAG); } void tms3202x_device::blez() { - if ( (int32_t)(m_ACC.d) <= 0 ) m_PC = m_cache.read_word(m_PC); + if ((int32_t)m_ACC.d <= 0) m_PC = m_cache.read_word(m_PC); else m_PC++; MODIFY_AR_ARP(); } @@ -816,7 +811,7 @@ void tms3202x_device::blkp() } void tms3202x_device::blz() { - if ( (int32_t)(m_ACC.d) < 0 ) m_PC = m_cache.read_word(m_PC); + if ((int32_t)m_ACC.d < 0) m_PC = m_cache.read_word(m_PC); else m_PC++; MODIFY_AR_ARP(); } @@ -877,19 +872,19 @@ void tms3202x_device::cmpr() switch (m_opcode.b.l & 3) { case 0: - if ( (uint16_t)(m_AR[ARP]) == (uint16_t)(m_AR[0]) ) SET1(TC_FLAG); + if (m_AR[ARP] == m_AR[0]) SET1(TC_FLAG); else CLR1(TC_FLAG); break; case 1: - if ( (uint16_t)(m_AR[ARP]) < (uint16_t)(m_AR[0]) ) SET1(TC_FLAG); + if (m_AR[ARP] < m_AR[0]) SET1(TC_FLAG); else CLR1(TC_FLAG); break; case 2: - if ( (uint16_t)(m_AR[ARP]) > (uint16_t)(m_AR[0]) ) SET1(TC_FLAG); + if (m_AR[ARP] > m_AR[0]) SET1(TC_FLAG); else CLR1(TC_FLAG); break; case 3: - if ( (uint16_t)(m_AR[ARP]) != (uint16_t)(m_AR[0]) ) SET1(TC_FLAG); + if (m_AR[ARP] != m_AR[0]) SET1(TC_FLAG); else CLR1(TC_FLAG); break; } @@ -971,7 +966,7 @@ void tms3202x_device::dint() } void tms3202x_device::dmov() /** Careful with how memory is configured !! */ { - GETDATA(0, 0); + GETDATA(); m_data.write_word(m_memaccess + 1, m_ALU.w.l); } void tms3202x_device::eint() @@ -986,7 +981,7 @@ void tms3202x_device::fort() void tms3202x_device::idle() { CLR0(INTM_FLAG); - m_idle = 1; + m_idle = true; } void tms3202x_device::in() { @@ -1015,25 +1010,16 @@ void tms3202x_device::lalk() m_ALU.d <<= (m_opcode.b.h & 0xf); m_ACC.d = m_ALU.d; } -void tms3202x_device::lar_ar0() { GETDATA(0, 0); m_AR[0] = m_ALU.w.l; } -void tms3202x_device::lar_ar1() { GETDATA(0, 0); m_AR[1] = m_ALU.w.l; } -void tms3202x_device::lar_ar2() { GETDATA(0, 0); m_AR[2] = m_ALU.w.l; } -void tms3202x_device::lar_ar3() { GETDATA(0, 0); m_AR[3] = m_ALU.w.l; } -void tms3202x_device::lar_ar4() { GETDATA(0, 0); m_AR[4] = m_ALU.w.l; } -void tms3202x_device::lar_ar5() { GETDATA(0, 0); m_AR[5] = m_ALU.w.l; } -void tms3202x_device::lar_ar6() { GETDATA(0, 0); m_AR[6] = m_ALU.w.l; } -void tms3202x_device::lar_ar7() { GETDATA(0, 0); m_AR[7] = m_ALU.w.l; } -void tms3202x_device::lark_ar0() { m_AR[0] = m_opcode.b.l; } -void tms3202x_device::lark_ar1() { m_AR[1] = m_opcode.b.l; } -void tms3202x_device::lark_ar2() { m_AR[2] = m_opcode.b.l; } -void tms3202x_device::lark_ar3() { m_AR[3] = m_opcode.b.l; } -void tms3202x_device::lark_ar4() { m_AR[4] = m_opcode.b.l; } -void tms3202x_device::lark_ar5() { m_AR[5] = m_opcode.b.l; } -void tms3202x_device::lark_ar6() { m_AR[6] = m_opcode.b.l; } -void tms3202x_device::lark_ar7() { m_AR[7] = m_opcode.b.l; } + +template +void tms3202x_device::lar_ar() { GETDATA(); m_AR[N] = m_ALU.w.l; } + +template +void tms3202x_device::lark_ar() { m_AR[N] = m_opcode.b.l; } + void tms3202x_device::ldp() { - GETDATA(0, 0); + GETDATA(); MODIFY_DP(m_ALU.d & 0x1ff); } void tms3202x_device::ldpk() @@ -1042,7 +1028,7 @@ void tms3202x_device::ldpk() } void tms3202x_device::lph() { - GETDATA(0, 0); + GETDATA(); m_Preg.w.h = m_ALU.w.l; } void tms3202x_device::lrlk() @@ -1053,9 +1039,7 @@ void tms3202x_device::lrlk() } void tms3202x_device::lst() { - m_mHackIgnoreARP = 1; - GETDATA(0, 0); - m_mHackIgnoreARP = 0; + GETDATA(); m_ALU.w.l &= (~INTM_FLAG); m_STR0 &= INTM_FLAG; @@ -1064,9 +1048,7 @@ void tms3202x_device::lst() } void tms3202x_device::lst1() { - m_mHackIgnoreARP = 1; - GETDATA(0, 0); - m_mHackIgnoreARP = 0; + GETDATA(); m_STR1 = m_ALU.w.l | m_fixed_STR1; m_STR0 &= (~ARP_REG); /* ARB also gets copied to ARP */ @@ -1074,13 +1056,13 @@ void tms3202x_device::lst1() } void tms3202x_device::lt() { - GETDATA(0, 0); + GETDATA(); m_Treg = m_ALU.w.l; } void tms3202x_device::lta() { m_oldacc.d = m_ACC.d; - GETDATA(0, 0); + GETDATA(); m_Treg = m_ALU.w.l; SHIFT_Preg_TO_ALU(); m_ACC.d += m_ALU.d; @@ -1090,7 +1072,7 @@ void tms3202x_device::lta() void tms3202x_device::ltd() /** Careful with how memory is configured !! */ { m_oldacc.d = m_ACC.d; - GETDATA(0, 0); + GETDATA(); m_Treg = m_ALU.w.l; m_data.write_word(m_memaccess+1, m_ALU.w.l); SHIFT_Preg_TO_ALU(); @@ -1101,7 +1083,7 @@ void tms3202x_device::ltd() /** Careful with how memory is configured !! */ void tms3202x_device::ltp() { m_oldacc.d = m_ACC.d; - GETDATA(0, 0); + GETDATA(); m_Treg = m_ALU.w.l; SHIFT_Preg_TO_ALU(); m_ACC.d = m_ALU.d; @@ -1109,7 +1091,7 @@ void tms3202x_device::ltp() void tms3202x_device::lts() { m_oldacc.d = m_ACC.d; - GETDATA(0, 0); + GETDATA(); m_Treg = m_ALU.w.l; SHIFT_Preg_TO_ALU(); m_ACC.d -= m_ALU.d; @@ -1127,9 +1109,9 @@ void tms3202x_device::mac() /** RAM blocks B0,B1,B2 may be important ! m_ACC.d += m_ALU.d; CALCULATE_ADD_OVERFLOW(m_ALU.d); CALCULATE_ADD_CARRY(); - GETDATA(0, 0); + GETDATA(); m_Treg = m_ALU.w.l; - m_Preg.d = ( (int16_t)m_ALU.w.l * (int16_t)m_cache.read_word(m_PFC) ); + m_Preg.d = (int16_t)m_ALU.w.l * (int16_t)m_cache.read_word(m_PFC); m_PFC++; m_tms32025_dec_cycles += (2*CLK); } @@ -1144,12 +1126,12 @@ void tms3202x_device::macd() /** RAM blocks B0,B1,B2 may be important ! m_ACC.d += m_ALU.d; CALCULATE_ADD_OVERFLOW(m_ALU.d); CALCULATE_ADD_CARRY(); - GETDATA(0, 0); - if ( (m_opcode.b.l & 0x80) || m_init_load_addr ) { /* No writing during repetition, or DMA mode */ + GETDATA(); + if ((m_opcode.b.l & 0x80) || m_init_load_addr) { /* No writing during repetition, or DMA mode */ m_data.write_word(m_memaccess+1, m_ALU.w.l); } m_Treg = m_ALU.w.l; - m_Preg.d = ( (int16_t)m_ALU.w.l * (int16_t)m_cache.read_word(m_PFC) ); + m_Preg.d = (int16_t)m_ALU.w.l * (int16_t)m_cache.read_word(m_PFC); m_PFC++; m_tms32025_dec_cycles += (2*CLK); } @@ -1159,8 +1141,8 @@ void tms3202x_device::mar() /* LARP and NOP are a subset of this instructi } void tms3202x_device::mpy() { - GETDATA(0, 0); - m_Preg.d = (int16_t)(m_ALU.w.l) * (int16_t)(m_Treg); + GETDATA(); + m_Preg.d = (int16_t)m_ALU.w.l * (int16_t)m_Treg; } void tms3202x_device::mpya() { @@ -1169,13 +1151,12 @@ void tms3202x_device::mpya() m_ACC.d += m_ALU.d; CALCULATE_ADD_OVERFLOW(m_ALU.d); CALCULATE_ADD_CARRY(); - GETDATA(0, 0); - m_Preg.d = (int16_t)(m_ALU.w.l) * (int16_t)(m_Treg); + GETDATA(); + m_Preg.d = (int16_t)m_ALU.w.l * (int16_t)m_Treg; } void tms3202x_device::mpyk() { - m_Preg.d = (int16_t)m_Treg * ((int16_t)(m_opcode.w.l << 3) >> 3); - + m_Preg.d = (int16_t)m_Treg * (int16_t(m_opcode.w.l << 3) >> 3); } void tms3202x_device::mpys() { @@ -1184,13 +1165,13 @@ void tms3202x_device::mpys() m_ACC.d -= m_ALU.d; CALCULATE_SUB_OVERFLOW(m_ALU.d); CALCULATE_SUB_CARRY(); - GETDATA(0, 0); - m_Preg.d = (int16_t)(m_ALU.w.l) * (int16_t)(m_Treg); + GETDATA(); + m_Preg.d = (int16_t)m_ALU.w.l * (int16_t)m_Treg; } void tms3202x_device::mpyu() { - GETDATA(0, 0); - m_Preg.d = (uint16_t)(m_ALU.w.l) * (uint16_t)(m_Treg); + GETDATA(); + m_Preg.d = (uint16_t)m_ALU.w.l * (uint16_t)m_Treg; } void tms3202x_device::neg() { @@ -1207,7 +1188,7 @@ void tms3202x_device::nop() { } // NOP is a subset of the MAR instruction */ void tms3202x_device::norm() { - if (m_ACC.d !=0 && (int32_t)(m_ACC.d ^ (m_ACC.d << 1)) >= 0) + if (m_ACC.d !=0 && int32_t(m_ACC.d ^ (m_ACC.d << 1)) >= 0) { CLR1(TC_FLAG); m_ACC.d <<= 1; @@ -1217,7 +1198,7 @@ void tms3202x_device::norm() } void tms3202x_device::or_() { - GETDATA(0, 0); + GETDATA(); m_ACC.w.l |= m_ALU.w.l; } void tms3202x_device::ork() @@ -1229,7 +1210,7 @@ void tms3202x_device::ork() } void tms3202x_device::out() { - GETDATA(0, 0); + GETDATA(); m_io.write_word(m_opcode.b.h & 0xf, m_ALU.w.l ); } void tms3202x_device::pac() @@ -1248,7 +1229,7 @@ void tms3202x_device::popd() } void tms3202x_device::pshd() { - GETDATA(0, 0); + GETDATA(); PUSH_STACK(m_ALU.w.l); } void tms3202x_device::push() @@ -1293,7 +1274,7 @@ void tms3202x_device::rovm() } void tms3202x_device::rpt() { - GETDATA(0, 0); + GETDATA(); m_RPTC = m_ALU.b.l; m_init_load_addr = 2; /* Initiate repeat mode */ } @@ -1329,14 +1310,9 @@ void tms3202x_device::sacl() m_ALU.d = (m_ACC.d << (m_opcode.b.h & 7)); PUTDATA(m_ALU.w.l); } -void tms3202x_device::sar_ar0() { PUTDATA(m_AR[0]); } -void tms3202x_device::sar_ar1() { PUTDATA(m_AR[1]); } -void tms3202x_device::sar_ar2() { PUTDATA(m_AR[2]); } -void tms3202x_device::sar_ar3() { PUTDATA(m_AR[3]); } -void tms3202x_device::sar_ar4() { PUTDATA(m_AR[4]); } -void tms3202x_device::sar_ar5() { PUTDATA(m_AR[5]); } -void tms3202x_device::sar_ar6() { PUTDATA(m_AR[6]); } -void tms3202x_device::sar_ar7() { PUTDATA(m_AR[7]); } + +template +void tms3202x_device::sar_ar() { PUTDATA(m_AR[N]); } void tms3202x_device::sblk() { @@ -1415,9 +1391,9 @@ void tms3202x_device::sqra() m_ACC.d += m_ALU.d; CALCULATE_ADD_OVERFLOW(m_ALU.d); CALCULATE_ADD_CARRY(); - GETDATA(0, 0); + GETDATA(); m_Treg = m_ALU.w.l; - m_Preg.d = ((int16_t)m_ALU.w.l * (int16_t)m_ALU.w.l); + m_Preg.d = (int16_t)m_ALU.w.l * (int16_t)m_ALU.w.l; } void tms3202x_device::sqrs() { @@ -1426,9 +1402,9 @@ void tms3202x_device::sqrs() m_ACC.d -= m_ALU.d; CALCULATE_SUB_OVERFLOW(m_ALU.d); CALCULATE_SUB_CARRY(); - GETDATA(0, 0); + GETDATA(); m_Treg = m_ALU.w.l; - m_Preg.d = ((int16_t)m_ALU.w.l * (int16_t)m_ALU.w.l); + m_Preg.d = (int16_t)m_ALU.w.l * (int16_t)m_ALU.w.l; } void tms3202x_device::sst() { @@ -1461,7 +1437,7 @@ void tms3202x_device::sub() void tms3202x_device::subb() { m_oldacc.d = m_ACC.d; - GETDATA(0, 0); + GETDATA(); if (CARRY == 0) m_ACC.d--; m_ACC.d -= m_ALU.d; CALCULATE_SUB_OVERFLOW(m_ALU.d); @@ -1473,7 +1449,7 @@ void tms3202x_device::subc() m_oldacc.d = m_ACC.d; GETDATA(15, SXM); m_ACC.d -= m_ALU.d; /* Temporary switch to ACC. Actual calculation is done as (ACC)-[mem] -> ALU, will be preserved later on. */ - if ((int32_t)((m_oldacc.d ^ m_ALU.d) & (m_oldacc.d ^ m_ACC.d)) < 0) { + if (int32_t((m_oldacc.d ^ m_ALU.d) & (m_oldacc.d ^ m_ACC.d)) < 0) { SET0(OV_FLAG); /* Not affected by OVM */ } CALCULATE_SUB_CARRY(); @@ -1489,12 +1465,12 @@ void tms3202x_device::subc() void tms3202x_device::subh() { m_oldacc.d = m_ACC.d; - GETDATA(0, 0); + GETDATA(); m_ACC.w.h -= m_ALU.w.l; - if ( (uint16_t)(m_oldacc.w.h) < (uint16_t)(m_ACC.w.h) ) { + if ((uint16_t)m_oldacc.w.h < (uint16_t)m_ACC.w.h) { CLR1(C_FLAG); /* Carry flag is not affected, if no borrow occurred */ } - if ((int16_t)((m_oldacc.w.h ^ m_ALU.w.l) & (m_oldacc.w.h ^ m_ACC.w.h)) < 0) { + if (int16_t((m_oldacc.w.h ^ m_ALU.w.l) & (m_oldacc.w.h ^ m_ACC.w.h)) < 0) { SET0(OV_FLAG); if (OVM) m_ACC.w.h = ((int16_t)m_oldacc.w.h < 0) ? 0x8000 : 0x7fff; } @@ -1510,7 +1486,7 @@ void tms3202x_device::subk() void tms3202x_device::subs() { m_oldacc.d = m_ACC.d; - GETDATA(0, 0); + GETDATA(); m_ACC.d -= m_ALU.w.l; CALCULATE_SUB_OVERFLOW(m_ALU.d); CALCULATE_SUB_CARRY(); @@ -1534,7 +1510,7 @@ void tms3202x_device::tblr() m_PFC = m_ACC.w.l; } m_ALU.w.l = m_cache.read_word(m_PFC); - if ( (CNF0) && ( (uint16_t)(m_PFC) >= 0xff00 ) ) {} /** TMS32025 only */ + if (CNF0 && (uint16_t)m_PFC >= 0xff00) {} /** TMS32025 only */ else m_tms32025_dec_cycles += (1*CLK); PUTDATA(m_ALU.w.l); m_PFC++; @@ -1545,8 +1521,8 @@ void tms3202x_device::tblw() m_PFC = m_ACC.w.l; } m_tms32025_dec_cycles += (1*CLK); - GETDATA(0, 0); - if (m_external_mem_access) m_tms32025_dec_cycles += (1*CLK); + GETDATA(); + if (is_mem_access_external()) m_tms32025_dec_cycles += (1*CLK); m_program.write_word(m_PFC, m_ALU.w.l); m_PFC++; } @@ -1557,7 +1533,7 @@ void tms3202x_device::trap() } void tms3202x_device::xor_() { - GETDATA(0, 0); + GETDATA(); m_ACC.w.l ^= m_ALU.w.l; } void tms3202x_device::xork() @@ -1569,19 +1545,19 @@ void tms3202x_device::xork() } void tms3202x_device::zalh() { - GETDATA(0, 0); + GETDATA(); m_ACC.w.h = m_ALU.w.l; m_ACC.w.l = 0x0000; } void tms3202x_device::zalr() { - GETDATA(0, 0); + GETDATA(); m_ACC.w.h = m_ALU.w.l; m_ACC.w.l = 0x8000; } void tms3202x_device::zals() { - GETDATA(0, 0); + GETDATA(); m_ACC.w.l = m_ALU.w.l; m_ACC.w.h = 0x0000; } @@ -1599,7 +1575,7 @@ const tms3202x_device::tms32025_opcode tms3202x_device::s_opcode_main[256]= /*18*/ {1*CLK, &tms3202x_device::sub },{1*CLK, &tms3202x_device::sub },{1*CLK, &tms3202x_device::sub },{1*CLK, &tms3202x_device::sub },{1*CLK, &tms3202x_device::sub },{1*CLK, &tms3202x_device::sub },{1*CLK, &tms3202x_device::sub },{1*CLK, &tms3202x_device::sub }, /*20*/ {1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac }, /*28*/ {1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac },{1*CLK, &tms3202x_device::lac }, -/*30*/ {1*CLK, &tms3202x_device::lar_ar0 },{1*CLK, &tms3202x_device::lar_ar1 },{1*CLK, &tms3202x_device::lar_ar2 },{1*CLK, &tms3202x_device::lar_ar3 },{1*CLK, &tms3202x_device::lar_ar4 },{1*CLK, &tms3202x_device::lar_ar5 },{1*CLK, &tms3202x_device::lar_ar6 },{1*CLK, &tms3202x_device::lar_ar7 }, +/*30*/ {1*CLK, &tms3202x_device::lar_ar<0>},{1*CLK, &tms3202x_device::lar_ar<1> },{1*CLK, &tms3202x_device::lar_ar<2> },{1*CLK, &tms3202x_device::lar_ar<3> },{1*CLK, &tms3202x_device::lar_ar<4> },{1*CLK, &tms3202x_device::lar_ar<5>},{1*CLK, &tms3202x_device::lar_ar<6> },{1*CLK, &tms3202x_device::lar_ar<7> }, /*38*/ {1*CLK, &tms3202x_device::mpy },{1*CLK, &tms3202x_device::sqra },{1*CLK, &tms3202x_device::mpya },{1*CLK, &tms3202x_device::mpys },{1*CLK, &tms3202x_device::lt },{1*CLK, &tms3202x_device::lta },{1*CLK, &tms3202x_device::ltp },{1*CLK, &tms3202x_device::ltd }, /*40*/ {1*CLK, &tms3202x_device::zalh },{1*CLK, &tms3202x_device::zals },{1*CLK, &tms3202x_device::lact },{1*CLK, &tms3202x_device::addc },{1*CLK, &tms3202x_device::subh },{1*CLK, &tms3202x_device::subs },{1*CLK, &tms3202x_device::subt },{1*CLK, &tms3202x_device::subc }, /*48*/ {1*CLK, &tms3202x_device::addh },{1*CLK, &tms3202x_device::adds },{1*CLK, &tms3202x_device::addt },{1*CLK, &tms3202x_device::rpt },{1*CLK, &tms3202x_device::xor_ },{1*CLK, &tms3202x_device::or_ },{1*CLK, &tms3202x_device::and_ },{1*CLK, &tms3202x_device::subb }, @@ -1607,7 +1583,7 @@ const tms3202x_device::tms32025_opcode tms3202x_device::s_opcode_main[256]= /*58*/ {3*CLK, &tms3202x_device::tblr },{2*CLK, &tms3202x_device::tblw },{1*CLK, &tms3202x_device::sqrs },{1*CLK, &tms3202x_device::lts },{2*CLK, &tms3202x_device::macd },{2*CLK, &tms3202x_device::mac },{2*CLK, &tms3202x_device::bc },{2*CLK, &tms3202x_device::bnc }, /*60*/ {1*CLK, &tms3202x_device::sacl },{1*CLK, &tms3202x_device::sacl },{1*CLK, &tms3202x_device::sacl },{1*CLK, &tms3202x_device::sacl },{1*CLK, &tms3202x_device::sacl },{1*CLK, &tms3202x_device::sacl },{1*CLK, &tms3202x_device::sacl },{1*CLK, &tms3202x_device::sacl }, /*68*/ {1*CLK, &tms3202x_device::sach },{1*CLK, &tms3202x_device::sach },{1*CLK, &tms3202x_device::sach },{1*CLK, &tms3202x_device::sach },{1*CLK, &tms3202x_device::sach },{1*CLK, &tms3202x_device::sach },{1*CLK, &tms3202x_device::sach },{1*CLK, &tms3202x_device::sach }, -/*70*/ {1*CLK, &tms3202x_device::sar_ar0 },{1*CLK, &tms3202x_device::sar_ar1 },{1*CLK, &tms3202x_device::sar_ar2 },{1*CLK, &tms3202x_device::sar_ar3 },{1*CLK, &tms3202x_device::sar_ar4 },{1*CLK, &tms3202x_device::sar_ar5 },{1*CLK, &tms3202x_device::sar_ar6 },{1*CLK, &tms3202x_device::sar_ar7 }, +/*70*/ {1*CLK, &tms3202x_device::sar_ar<0>},{1*CLK, &tms3202x_device::sar_ar<1> },{1*CLK, &tms3202x_device::sar_ar<2> },{1*CLK, &tms3202x_device::sar_ar<3> },{1*CLK, &tms3202x_device::sar_ar<4> },{1*CLK, &tms3202x_device::sar_ar<5> },{1*CLK, &tms3202x_device::sar_ar<6> },{1*CLK, &tms3202x_device::sar_ar<7> }, /*78*/ {1*CLK, &tms3202x_device::sst },{1*CLK, &tms3202x_device::sst1 },{1*CLK, &tms3202x_device::popd },{1*CLK, &tms3202x_device::zalr },{1*CLK, &tms3202x_device::spl },{1*CLK, &tms3202x_device::sph },{1*CLK, &tms3202x_device::adrk },{1*CLK, &tms3202x_device::sbrk_ar }, /*80*/ {2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in }, /*88*/ {2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in },{2*CLK, &tms3202x_device::in }, @@ -1617,7 +1593,7 @@ const tms3202x_device::tms32025_opcode tms3202x_device::s_opcode_main[256]= /*A8*/ {1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk }, /*B0*/ {1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk }, /*B8*/ {1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk },{1*CLK, &tms3202x_device::mpyk }, -/*C0*/ {1*CLK, &tms3202x_device::lark_ar0 },{1*CLK, &tms3202x_device::lark_ar1 },{1*CLK, &tms3202x_device::lark_ar2 },{1*CLK, &tms3202x_device::lark_ar3 },{1*CLK, &tms3202x_device::lark_ar4 },{1*CLK, &tms3202x_device::lark_ar5 },{1*CLK, &tms3202x_device::lark_ar6 },{1*CLK, &tms3202x_device::lark_ar7 }, +/*C0*/ {1*CLK, &tms3202x_device::lark_ar<0>},{1*CLK, &tms3202x_device::lark_ar<1>},{1*CLK, &tms3202x_device::lark_ar<2>},{1*CLK, &tms3202x_device::lark_ar<3>},{1*CLK, &tms3202x_device::lark_ar<4>},{1*CLK, &tms3202x_device::lark_ar<5>},{1*CLK, &tms3202x_device::lark_ar<6>},{1*CLK, &tms3202x_device::lark_ar<7>}, /*C8*/ {1*CLK, &tms3202x_device::ldpk },{1*CLK, &tms3202x_device::ldpk },{1*CLK, &tms3202x_device::lack },{1*CLK, &tms3202x_device::rptk },{1*CLK, &tms3202x_device::addk },{1*CLK, &tms3202x_device::subk },{1*CLK, &tms3202x_device::opcodes_CE},{1*CLK, &tms3202x_device::mpyu }, /*D0*/ {1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{0*CLK, &tms3202x_device::opcodes_Dx}, /*D8*/ {1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx},{1*CLK, &tms3202x_device::opcodes_Dx}, @@ -1694,12 +1670,8 @@ void tms3202x_device::device_start() m_dxr = 0; m_timerover = 0; m_opcode.d = 0; - m_external_mem_access = 0; - m_tms32025_irq_cycles = 0; - m_oldacc.d = 0; m_memaccess = 0; - m_mHackIgnoreARP = 0; - m_waiting_for_serial_frame = 0; + m_waiting_for_serial_frame = false; save_item(NAME(m_PREVPC)); save_item(NAME(m_PC)); @@ -1725,10 +1697,8 @@ void tms3202x_device::device_start() save_item(NAME(m_idle)); save_item(NAME(m_hold)); - save_item(NAME(m_external_mem_access)); save_item(NAME(m_init_load_addr)); - save_item(NAME(m_oldacc.d)); save_item(NAME(m_memaccess)); save_item(NAME(m_waiting_for_serial_frame)); @@ -1835,8 +1805,8 @@ void tms3202x_device::common_reset() m_prd = 0xffff; m_imr = 0xffc0; - m_idle = 0; - m_hold = 0; + m_idle = false; + m_hold = false; m_tms32025_dec_cycles = 0; m_init_load_addr = 1; } @@ -1867,70 +1837,68 @@ inline int tms3202x_device::process_IRQs() | XINT| RINT| TINT| INT2| INT1| INT0| */ - m_tms32025_irq_cycles = 0; - /* Dont service Interrupts if masked, or prev instruction was EINT ! */ if ( (INTM == 0) && (m_opcode.w.l != 0xce00) && (m_IFR & m_imr) ) { - m_tms32025_irq_cycles = (3*CLK); /* 3 clock cycles used due to PUSH and DINT operation ? */ + const int irq_cycles = (3*CLK); /* 3 clock cycles used due to PUSH and DINT operation ? */ PUSH_STACK(m_PC); if ((m_IFR & 0x01) && (m_imr & 0x01)) { /* IRQ line 0 */ //logerror("TMS3202x: Active INT0\n"); standard_irq_callback(0, m_PC); m_PC = 0x0002; - m_idle = 0; + m_idle = false; m_IFR &= (~0x01); SET0(INTM_FLAG); - return m_tms32025_irq_cycles; + return irq_cycles; } if ((m_IFR & 0x02) && (m_imr & 0x02)) { /* IRQ line 1 */ //logerror("TMS3202x: Active INT1\n"); standard_irq_callback(1, m_PC); m_PC = 0x0004; - m_idle = 0; + m_idle = false; m_IFR &= (~0x02); SET0(INTM_FLAG); - return m_tms32025_irq_cycles; + return irq_cycles; } if ((m_IFR & 0x04) && (m_imr & 0x04)) { /* IRQ line 2 */ //logerror("TMS3202x: Active INT2\n"); standard_irq_callback(2, m_PC); m_PC = 0x0006; - m_idle = 0; + m_idle = false; m_IFR &= (~0x04); SET0(INTM_FLAG); - return m_tms32025_irq_cycles; + return irq_cycles; } if ((m_IFR & 0x08) && (m_imr & 0x08)) { /* Timer IRQ (internal) */ -// logerror("TMS3202x: Active TINT (Timer)\n"); + //logerror("TMS3202x: Active TINT (Timer)\n"); m_PC = 0x0018; - m_idle = 0; + m_idle = false; m_IFR &= (~0x08); SET0(INTM_FLAG); - return m_tms32025_irq_cycles; + return irq_cycles; } if ((m_IFR & 0x10) && (m_imr & 0x10)) { /* Serial port receive IRQ (internal) */ -// logerror("TMS3202x: Active RINT (Serial receive)\n"); + //logerror("TMS3202x: Active RINT (Serial receive)\n"); m_drr = m_dr_in(); m_PC = 0x001A; - m_idle = 0; + m_idle = false; m_IFR &= (~0x10); SET0(INTM_FLAG); - return m_tms32025_irq_cycles; + return irq_cycles; } if ((m_IFR & 0x20) && (m_imr & 0x20)) { /* Serial port transmit IRQ (internal) */ -// logerror("TMS3202x: Active XINT (Serial transmit)\n"); + //logerror("TMS3202x: Active XINT (Serial transmit)\n"); m_dx_out(m_dxr); m_PC = 0x001C; - m_idle = 0; + m_idle = false; m_IFR &= (~0x20); SET0(INTM_FLAG); - return m_tms32025_irq_cycles; + return irq_cycles; } } - return m_tms32025_irq_cycles; + return 0; } @@ -1974,26 +1942,23 @@ inline void tms3202x_device::process_timer(int clocks) void tms3202x_device::execute_run() { /**** Respond to external hold signal */ - if (m_hold_in() == ASSERT_LINE) { - if (m_hold == 0) { - m_hold_ack_out(ASSERT_LINE); /* Hold-Ack (active low) */ - } - m_hold = 1; - if (HM) { - m_icount = 0; /* Exit */ - } - else { - if (m_external_mem_access) { + if (!m_hold_in.isunset()) { + if (m_hold_in() == ASSERT_LINE) { + if (!m_hold) { + m_hold_ack_out(ASSERT_LINE); /* Hold-Ack (active low) */ + m_hold = true; + } + + if (HM || is_mem_access_external()) { m_icount = 0; /* Exit */ + return; } } - } - else { - if (m_hold == 1) { + else if (m_hold) { m_hold_ack_out(CLEAR_LINE); /* Hold-Ack (active low) */ process_timer(3); + m_hold = false; } - m_hold = 0; } /**** If idling, update timer and/or exit execution, but test for irqs first */ @@ -2054,33 +2019,24 @@ void tms3202x_device::execute_run() m_opcode.d = m_cache.read_word(m_PC); m_PC++; - m_tms32025_dec_cycles += (1*CLK); - - do { - if (m_opcode.b.h == 0xCE) - { /* Do all 0xCExx Opcodes */ - if (m_init_load_addr) { - m_tms32025_dec_cycles += (1*CLK); - } - else { - m_tms32025_dec_cycles += (1*CLK); - } - (this->*s_opcode_CE_subset[m_opcode.b.l].function)(); - } - else - { /* Do all other opcodes */ - if (m_init_load_addr) { - m_tms32025_dec_cycles += (1*CLK); - } - else { - m_tms32025_dec_cycles += (1*CLK); - } - (this->*s_opcode_main[m_opcode.b.h].function)(); - } - m_init_load_addr = 0; + m_tms32025_dec_cycles += (m_RPTC+2) * CLK; + + opcode_func op_func; + if (m_opcode.b.h == 0xCE) + /* Do all 0xCExx Opcodes */ + op_func = s_opcode_CE_subset[m_opcode.b.l].function; + else + /* Do all other opcodes */ + op_func = s_opcode_main[m_opcode.b.h].function; + + (this->*op_func)(); + m_init_load_addr = 0; + + while (m_RPTC != 0) { + (this->*op_func)(); m_RPTC--; - } while ((int8_t)(m_RPTC) != -1); - m_RPTC = 0; + } + m_PFC = m_PC; m_init_load_addr = 1; } @@ -2094,10 +2050,11 @@ void tms3202x_device::execute_run() /**** If hold pin is active, exit if accessing external memory or if HM is set */ if (m_hold) { - if (m_external_mem_access || (HM)) { + if (is_mem_access_external() || HM) { if (m_icount > 0) { m_icount = 0; } + return; } } } @@ -2110,10 +2067,10 @@ void tms3202x_device::execute_run() ****************************************************************************/ void tms3202x_device::execute_set_input(int irqline, int state) { - if ( irqline == TMS32025_FSX ) { + if (irqline == TMS32025_FSX) { if (state != CLEAR_LINE && m_waiting_for_serial_frame) { - m_waiting_for_serial_frame = 0; + m_waiting_for_serial_frame = false; m_IFR = 0x20; } } diff --git a/src/devices/cpu/tms32025/tms32025.h b/src/devices/cpu/tms32025/tms32025.h index c35a2841c7416..c1863778ccfac 100644 --- a/src/devices/cpu/tms32025/tms32025.h +++ b/src/devices/cpu/tms32025/tms32025.h @@ -139,32 +139,30 @@ class tms3202x_device : public cpu_device uint16_t m_STR0, m_STR1; uint8_t m_IFR; uint8_t m_RPTC; - PAIR m_ACC; - PAIR m_Preg; + PAIR m_ACC; + PAIR m_Preg; uint16_t m_Treg; uint16_t m_AR[8]; // 5 for TMS32020, 8 for rest uint16_t m_STACK[8]; // 4 level for TMS32020, 8 level for rest - PAIR m_ALU; + PAIR m_ALU; uint16_t m_drr, m_dxr, m_tim, m_prd, m_imr, m_greg; - uint16_t m_fixed_STR1; + uint16_t m_fixed_STR1; uint8_t m_timerover; /********************** Status data ****************************/ PAIR m_opcode; - int m_idle; - int m_hold; - int m_external_mem_access; /** required for hold mode. Implement it ! */ + bool m_idle; + bool m_hold; int m_init_load_addr; /* 0=No, 1=Yes, 2=Once for repeat mode */ - int m_tms32025_irq_cycles; int m_tms32025_dec_cycles; - PAIR m_oldacc; + PAIR m_oldacc; uint32_t m_memaccess; - int m_icount; - int m_mHackIgnoreARP; /* special handling for lst, lst1 instructions */ - int m_waiting_for_serial_frame; + bool is_mem_access_external() { return m_memaccess >= 0x800; } + int m_icount; + bool m_waiting_for_serial_frame; uint16_t drr_r(); void drr_w(uint16_t data); @@ -186,8 +184,8 @@ class tms3202x_device : public cpu_device void MODIFY_DP(int data); void MODIFY_PM(int data); void MODIFY_ARP(int data); - uint16_t reverse_carry_add(uint16_t arg0, uint16_t arg1 ); - void MODIFY_AR_ARP(); + uint16_t reverse_carry_add(uint16_t arg0, uint16_t arg1); + template void MODIFY_AR_ARP(); void CALCULATE_ADD_CARRY(); void CALCULATE_SUB_CARRY(); void CALCULATE_ADD_OVERFLOW(int32_t addval); @@ -195,9 +193,11 @@ class tms3202x_device : public cpu_device uint16_t POP_STACK(); void PUSH_STACK(uint16_t data); void SHIFT_Preg_TO_ALU(); - void GETDATA(int shift,int signext); + template void GETDATA(); + void GETDATA(int shift, int signext); void PUTDATA(uint16_t data); void PUTDATA_SST(uint16_t data); + void opcodes_CE(); void opcodes_Dx(); void illegal(); @@ -250,22 +250,8 @@ class tms3202x_device : public cpu_device void lack(); void lact(); void lalk(); - void lar_ar0(); - void lar_ar1(); - void lar_ar2(); - void lar_ar3(); - void lar_ar4(); - void lar_ar5(); - void lar_ar6(); - void lar_ar7(); - void lark_ar0(); - void lark_ar1(); - void lark_ar2(); - void lark_ar3(); - void lark_ar4(); - void lark_ar5(); - void lark_ar6(); - void lark_ar7(); + template void lar_ar(); + template void lark_ar(); void ldp(); void ldpk(); void lph(); @@ -310,14 +296,7 @@ class tms3202x_device : public cpu_device void rxf(); void sach(); void sacl(); - void sar_ar0(); - void sar_ar1(); - void sar_ar2(); - void sar_ar3(); - void sar_ar4(); - void sar_ar5(); - void sar_ar6(); - void sar_ar7(); + template void sar_ar(); void sblk(); void sbrk_ar(); void sc(); @@ -353,6 +332,7 @@ class tms3202x_device : public cpu_device void zalh(); void zalr(); void zals(); + int process_IRQs(); void process_timer(int clocks); }; diff --git a/src/mame/misc/coolpool.cpp b/src/mame/misc/coolpool.cpp index 02dee00a83e73..c28c85606d7c1 100644 --- a/src/mame/misc/coolpool.cpp +++ b/src/mame/misc/coolpool.cpp @@ -174,7 +174,6 @@ class _9ballsht_state : public coolpool_base_state void misc_w(uint16_t data); uint16_t dsp_bio_line_r(); - uint16_t dsp_hold_line_r(); TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline); @@ -628,12 +627,6 @@ uint16_t _9ballsht_state::dsp_bio_line_r() } -uint16_t _9ballsht_state::dsp_hold_line_r() -{ - return CLEAR_LINE; // ??? -} - - /************************************* * * IOP ROM and DAC access @@ -985,8 +978,8 @@ void _9ballsht_state::_9ballsht(machine_config &config) dsp.set_addrmap(AS_PROGRAM, &_9ballsht_state::dsp_pgm_map); dsp.set_addrmap(AS_IO, &_9ballsht_state::nballsht_dsp_io_map); dsp.bio_in_cb().set(FUNC(_9ballsht_state::dsp_bio_line_r)); - dsp.hold_in_cb().set(FUNC(_9ballsht_state::dsp_hold_line_r)); -// dsp.hold_ack_out_cb().set(FUNC(_9ballsht_state::dsp_HOLDA_signal_w)); + //dsp.hold_in_cb().set(FUNC(_9ballsht_state::dsp_hold_line_r)); + //dsp.hold_ack_out_cb().set(FUNC(_9ballsht_state::dsp_HOLDA_signal_w)); GENERIC_LATCH_16(config, m_main2dsp); // ??? I have no idea who should generate this! diff --git a/src/mame/namco/namcos21_dsp.cpp b/src/mame/namco/namcos21_dsp.cpp index ee27c48743f70..031aff3078ee9 100644 --- a/src/mame/namco/namcos21_dsp.cpp +++ b/src/mame/namco/namcos21_dsp.cpp @@ -264,7 +264,7 @@ void namcos21_dsp_device::device_add_mconfig(machine_config &config) dsp.set_addrmap(AS_DATA, &namcos21_dsp_device::winrun_dsp_data); dsp.set_addrmap(AS_IO, &namcos21_dsp_device::winrun_dsp_io); dsp.bio_in_cb().set(FUNC(namcos21_dsp_device::winrun_poly_reset_r)); - dsp.hold_in_cb().set_constant(0); + //dsp.hold_in_cb().set_constant(0); dsp.hold_ack_out_cb().set_nop(); dsp.xf_out_cb().set_nop(); } diff --git a/src/mame/namco/namcos21_dsp_c67.cpp b/src/mame/namco/namcos21_dsp_c67.cpp index 6e4b5567f62e3..e7e55cbb45eba 100644 --- a/src/mame/namco/namcos21_dsp_c67.cpp +++ b/src/mame/namco/namcos21_dsp_c67.cpp @@ -129,7 +129,7 @@ void namcos21_dsp_c67_device::device_add_mconfig(machine_config &config) dspmaster.set_addrmap(AS_PROGRAM, &namcos21_dsp_c67_device::master_dsp_program); dspmaster.set_addrmap(AS_DATA, &namcos21_dsp_c67_device::master_dsp_data); dspmaster.set_addrmap(AS_IO, &namcos21_dsp_c67_device::master_dsp_io); - dspmaster.hold_in_cb().set_constant(0); + //dspmaster.hold_in_cb().set_constant(0); dspmaster.hold_ack_out_cb().set_nop(); dspmaster.xf_out_cb().set(FUNC(namcos21_dsp_c67_device::dsp_xf_w)); diff --git a/src/mame/namco/namcos22.cpp b/src/mame/namco/namcos22.cpp index 53d54edc1aa02..05910f0ee82e8 100644 --- a/src/mame/namco/namcos22.cpp +++ b/src/mame/namco/namcos22.cpp @@ -2241,22 +2241,6 @@ void namcos22_state::pdp_handle_commands(u16 offs) } } -u16 namcos22_state::dsp_hold_signal_r() -{ - /* STUB */ - return 0; -} - -void namcos22_state::dsp_hold_ack_w(u16 data) -{ - /* STUB */ -} - -void namcos22_state::dsp_xf_output_w(u16 data) -{ - /* STUB */ -} - void namcos22_state::dsp_unk2_w(u16 data) { /** @@ -3749,9 +3733,9 @@ void namcos22_state::namcos22(machine_config &config) master.set_addrmap(AS_DATA, &namcos22_state::master_dsp_data); master.set_addrmap(AS_IO, &namcos22_state::master_dsp_io); master.bio_in_cb().set(FUNC(namcos22_state::pdp_status_r)); - master.hold_in_cb().set(FUNC(namcos22_state::dsp_hold_signal_r)); - master.hold_ack_out_cb().set(FUNC(namcos22_state::dsp_hold_ack_w)); - master.xf_out_cb().set(FUNC(namcos22_state::dsp_xf_output_w)); + //master.hold_in_cb().set(FUNC(namcos22_state::dsp_hold_signal_r)); + //master.hold_ack_out_cb().set(FUNC(namcos22_state::dsp_hold_ack_w)); + //master.xf_out_cb().set(FUNC(namcos22_state::dsp_xf_output_w)); master.dr_in_cb().set(FUNC(namcos22_state::master_serial_io_r)); master.set_vblank_int("screen", FUNC(namcos22_state::dsp_vblank_irq)); TIMER(config, "dsp_serial").configure_periodic(FUNC(namcos22_state::dsp_serial_pulse), attotime::from_hz(SERIAL_IO_PERIOD)); @@ -3761,9 +3745,9 @@ void namcos22_state::namcos22(machine_config &config) slave.set_addrmap(AS_DATA, &namcos22_state::slave_dsp_data); slave.set_addrmap(AS_IO, &namcos22_state::slave_dsp_io); slave.bio_in_cb().set(FUNC(namcos22_state::dsp_slave_bioz_r)); - slave.hold_in_cb().set(FUNC(namcos22_state::dsp_hold_signal_r)); - slave.hold_ack_out_cb().set(FUNC(namcos22_state::dsp_hold_ack_w)); - slave.xf_out_cb().set(FUNC(namcos22_state::dsp_xf_output_w)); + //slave.hold_in_cb().set(FUNC(namcos22_state::dsp_hold_signal_r)); + //slave.hold_ack_out_cb().set(FUNC(namcos22_state::dsp_hold_ack_w)); + //slave.xf_out_cb().set(FUNC(namcos22_state::dsp_xf_output_w)); slave.dx_out_cb().set(FUNC(namcos22_state::slave_serial_io_w)); NAMCO_C74(config, m_mcu, 49.152_MHz_XTAL/3); // C74 on the CPU board has no periodic interrupts, it runs entirely off Timer A0 diff --git a/src/mame/namco/namcos22.h b/src/mame/namco/namcos22.h index 2e2be7c4a1a01..73f51c42f734d 100644 --- a/src/mame/namco/namcos22.h +++ b/src/mame/namco/namcos22.h @@ -288,9 +288,6 @@ class namcos22_state : public driver_device void namcos22_dspram16_w(offs_t offset, u16 data, u16 mem_mask = ~0); u16 pdp_status_r(); u16 pdp_begin_r(); - u16 dsp_hold_signal_r(); - void dsp_hold_ack_w(u16 data); - void dsp_xf_output_w(u16 data); void point_address_w(u16 data); void point_loword_iw(u16 data); void point_hiword_w(u16 data);