tms32051: add idle instruction (nw)

This commit is contained in:
Ville Linde 2015-12-12 02:48:39 +02:00
parent 799c299ade
commit c0814124b5
3 changed files with 70 additions and 37 deletions

View File

@ -1150,10 +1150,10 @@ void tms32051_device::op_rete()
UINT16 pc = POP_STACK(); UINT16 pc = POP_STACK();
CHANGE_PC(pc); CHANGE_PC(pc);
m_st0.intm = 0;
restore_interrupt_context(); restore_interrupt_context();
m_st0.intm = 0;
CYCLES(4); CYCLES(4);
} }
@ -1675,7 +1675,7 @@ void tms32051_device::op_clrc_xf()
void tms32051_device::op_idle() void tms32051_device::op_idle()
{ {
fatalerror("32051: unimplemented op idle at %08X\n", m_pc-1); m_idle = true;
} }
void tms32051_device::op_idle2() void tms32051_device::op_idle2()

View File

@ -35,7 +35,15 @@ enum
TMS32051_AR4, TMS32051_AR4,
TMS32051_AR5, TMS32051_AR5,
TMS32051_AR6, TMS32051_AR6,
TMS32051_AR7 TMS32051_AR7,
TMS32051_IFR,
TMS32051_IMR,
TMS32051_ST0_ARP,
TMS32051_ST0_INTM,
TMS32051_ST0_DP,
TMS32051_ST1_ARB,
TMS32051_TIM,
TMS32051_PSC
}; };
@ -93,7 +101,7 @@ static ADDRESS_MAP_START( tms32053_internal_data, AS_DATA, 16, tms32053_device )
AM_RANGE(0x0060, 0x007f) AM_RAM // DARAM B2 AM_RANGE(0x0060, 0x007f) AM_RAM // DARAM B2
AM_RANGE(0x0100, 0x02ff) AM_RAM AM_SHARE("daram_b0") // DARAM B0 TODO: is unconnected if CNF = 1 AM_RANGE(0x0100, 0x02ff) AM_RAM AM_SHARE("daram_b0") // DARAM B0 TODO: is unconnected if CNF = 1
AM_RANGE(0x0300, 0x04ff) AM_RAM // DARAM B1 AM_RANGE(0x0300, 0x04ff) AM_RAM // DARAM B1
AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("saram") // SARAM TODO: is off-chip if OVLY = 0 AM_RANGE(0x0800, 0x13ff) AM_RAM AM_SHARE("saram") // SARAM TODO: is off-chip if OVLY = 0
ADDRESS_MAP_END ADDRESS_MAP_END
@ -225,6 +233,15 @@ void tms32051_device::device_start()
state_add( TMS32051_AR6, "AR6", m_ar[6]).formatstr("%04X"); state_add( TMS32051_AR6, "AR6", m_ar[6]).formatstr("%04X");
state_add( TMS32051_AR7, "AR7", m_ar[7]).formatstr("%04X"); state_add( TMS32051_AR7, "AR7", m_ar[7]).formatstr("%04X");
state_add( TMS32051_IFR, "IFR", m_ifr).formatstr("%04X");
state_add( TMS32051_IMR, "IMR", m_imr).formatstr("%04X");
state_add( TMS32051_ST0_ARP, "ST0 ARP", m_st0.arp).formatstr("%1d");
state_add( TMS32051_ST0_INTM, "ST0 INTM", m_st0.intm).formatstr("%1d");
state_add( TMS32051_ST0_DP, "ST0 DP", m_st0.dp).formatstr("%04X");
state_add( TMS32051_ST1_ARB, "ST1 ARB", m_st1.arb).formatstr("%04X");
state_add( TMS32051_TIM, "TIM", m_timer.tim).formatstr("%04X");
state_add( TMS32051_PSC, "PSC", m_timer.psc).formatstr("%04X");
state_add(STATE_GENPC, "GENPC", m_pc).formatstr("%04X").noshow(); state_add(STATE_GENPC, "GENPC", m_pc).formatstr("%04X").noshow();
m_icountptr = &m_icount; m_icountptr = &m_icount;
@ -253,6 +270,8 @@ void tms32051_device::device_reset()
m_cbcr = 0; m_cbcr = 0;
m_rptc = -1; m_rptc = -1;
m_idle = false;
// simulate internal rom boot loader (can be removed when the dsp rom(s) is dumped) // simulate internal rom boot loader (can be removed when the dsp rom(s) is dumped)
m_st0.intm = 1; m_st0.intm = 1;
m_st1.cnf = 1; m_st1.cnf = 1;
@ -290,6 +309,8 @@ void tms32051_device::check_interrupts()
m_pc = (m_pmst.iptr << 11) | ((i+1) << 1); m_pc = (m_pmst.iptr << 11) | ((i+1) << 1);
m_ifr &= ~(1 << i); m_ifr &= ~(1 << i);
m_idle = false;
save_interrupt_context(); save_interrupt_context();
break; break;
} }
@ -347,6 +368,13 @@ void tms32051_device::execute_run()
{ {
UINT16 ppc; UINT16 ppc;
if (m_idle)
{
debugger_instruction_hook(this, m_pc);
CYCLES(1);
}
else
{
// handle block repeat // handle block repeat
if (m_pmst.braf) if (m_pmst.braf)
{ {
@ -384,6 +412,7 @@ void tms32051_device::execute_run()
{ {
m_rptc = 0; m_rptc = 0;
} }
}
m_timer.psc--; m_timer.psc--;
if (m_timer.psc <= 0) if (m_timer.psc <= 0)
@ -598,6 +627,8 @@ void tms32053_device::device_reset()
m_cbcr = 0; m_cbcr = 0;
m_rptc = -1; m_rptc = -1;
m_idle = false;
CHANGE_PC(0); CHANGE_PC(0);
} }

View File

@ -164,6 +164,8 @@ protected:
address_space *m_data; address_space *m_data;
int m_icount; int m_icount;
bool m_idle;
inline void CHANGE_PC(UINT16 new_pc); inline void CHANGE_PC(UINT16 new_pc);
inline UINT16 PM_READ16(UINT16 address); inline UINT16 PM_READ16(UINT16 address);
inline void PM_WRITE16(UINT16 address, UINT16 data); inline void PM_WRITE16(UINT16 address, UINT16 data);