Tweak to s2650 IRQ cycle handling to fix gcc codegen bug.

Added asserts to catch other unexpected situations.
This commit is contained in:
Aaron Giles 2010-06-09 15:32:01 +00:00
parent d4e1e8c266
commit ebdc4525f9
3 changed files with 8 additions and 1 deletions

View File

@ -890,7 +890,8 @@ static CPU_EXECUTE( s2650 )
s2650c->icount = cycles;
/* check for external irqs */
s2650c->icount -= check_irq_line(s2650c);
int irqcycles = check_irq_line(s2650c);
s2650c->icount -= irqcycles;
do
{

View File

@ -312,6 +312,8 @@ void cpu_device::device_start()
// get our icount pointer
m_icount = reinterpret_cast<int *>(get_legacy_runtime_ptr(CPUINFO_PTR_INSTRUCTION_COUNTER));
assert(m_icount != 0);
*m_icount = 0;
}

View File

@ -476,6 +476,7 @@ attotime device_execute_interface::local_time() const
attotime result = m_localtime;
if (is_executing())
{
assert(m_cycles_running >= *m_icount);
int cycles = m_cycles_running - *m_icount;
result = attotime_add(result, m_device.clocks_to_attotime(cycles));
}
@ -491,7 +492,10 @@ attotime device_execute_interface::local_time() const
UINT64 device_execute_interface::total_cycles() const
{
if (is_executing())
{
assert(m_cycles_running >= *m_icount);
return m_totalcycles + m_cycles_running - *m_icount;
}
else
return m_totalcycles;
}