mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
Tweak to s2650 IRQ cycle handling to fix gcc codegen bug.
Added asserts to catch other unexpected situations.
This commit is contained in:
parent
d4e1e8c266
commit
ebdc4525f9
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user