mirror of
https://github.com/holub/mame
synced 2025-04-20 15:32:45 +03:00
emu/diexec.cpp: Deal with the annoyances of the timer state machine
This commit is contained in:
parent
98b18d69f7
commit
08875eebfa
@ -584,13 +584,14 @@ TIMER_CALLBACK_MEMBER(device_execute_interface::trigger_periodic_interrupt)
|
||||
|
||||
void device_execute_interface::pulse_input_line(int irqline, const attotime &duration)
|
||||
{
|
||||
// treat instantaneous pulses as ASSERT+CLEAR
|
||||
const attotime expiry = m_pulse_end_timers[irqline]->expire();
|
||||
if (duration == attotime::zero)
|
||||
{
|
||||
// treat instantaneous pulses as ASSERT+CLEAR
|
||||
if (irqline != INPUT_LINE_RESET && !input_edge_triggered(irqline))
|
||||
throw emu_fatalerror("device '%s': zero-width pulse is not allowed for input line %d\n", device().tag(), irqline);
|
||||
|
||||
if (m_pulse_end_timers[irqline]->remaining() == attotime::zero)
|
||||
if (expiry.is_never() || (expiry <= m_scheduler->time()))
|
||||
{
|
||||
set_input_line(irqline, ASSERT_LINE);
|
||||
set_input_line(irqline, CLEAR_LINE);
|
||||
@ -599,7 +600,7 @@ void device_execute_interface::pulse_input_line(int irqline, const attotime &dur
|
||||
else
|
||||
{
|
||||
const attotime target_time = local_time() + duration;
|
||||
if (target_time > m_pulse_end_timers[irqline]->expire())
|
||||
if (expiry.is_never() || (target_time > expiry))
|
||||
{
|
||||
set_input_line(irqline, ASSERT_LINE);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user