diff options
Diffstat (limited to 'src/emu/schedule.c')
-rw-r--r-- | src/emu/schedule.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/emu/schedule.c b/src/emu/schedule.c index 1695936fa26..f94b2919b5d 100644 --- a/src/emu/schedule.c +++ b/src/emu/schedule.c @@ -11,6 +11,13 @@ #include "emu.h" #include "debugger.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + //************************************************************************** // DEBUGGING @@ -187,7 +194,7 @@ void emu_timer::adjust(attotime start_delay, INT32 param, const attotime &period m_enabled = true; // clamp negative times to 0 - if (start_delay.seconds < 0) + if (start_delay.seconds() < 0) start_delay = attotime::zero; // set the start and expire times @@ -427,7 +434,7 @@ void device_scheduler::timeslice() while (m_basetime < m_timer_list->m_expire) { // by default, assume our target is the end of the next quantum - attotime target = m_basetime + attotime(0, m_quantum_list.first()->m_actual); + attotime target(m_basetime + attotime(0, m_quantum_list.first()->m_actual)); // however, if the next timer is going to fire before then, override if (m_timer_list->m_expire < target) @@ -445,11 +452,11 @@ void device_scheduler::timeslice() { // only process if this CPU is executing or truly halted (not yielding) // and if our target is later than the CPU's current time (coarse check) - if (EXPECTED((exec->m_suspend == 0 || exec->m_eatcycles) && target.seconds >= exec->m_localtime.seconds)) + if (EXPECTED((exec->m_suspend == 0 || exec->m_eatcycles) && target.seconds() >= exec->m_localtime.seconds())) { // compute how many attoseconds to execute this CPU - attoseconds_t delta = target.attoseconds - exec->m_localtime.attoseconds; - if (delta < 0 && target.seconds > exec->m_localtime.seconds) + attoseconds_t delta = target.attoseconds() - exec->m_localtime.attoseconds(); + if (delta < 0 && target.seconds() > exec->m_localtime.seconds()) delta += ATTOSECONDS_PER_SECOND; assert(delta == (target - exec->m_localtime).as_attoseconds()); @@ -557,7 +564,7 @@ void device_scheduler::trigger(int trigid, const attotime &after) void device_scheduler::boost_interleave(const attotime ×lice_time, const attotime &boost_duration) { // ignore timeslices > 1 second - if (timeslice_time.seconds > 0) + if (timeslice_time.seconds() > 0) return; add_scheduling_quantum(timeslice_time, boost_duration); } @@ -934,10 +941,11 @@ inline void device_scheduler::execute_timers() void device_scheduler::add_scheduling_quantum(const attotime &quantum, const attotime &duration) { - assert(quantum.seconds == 0); + assert(quantum.seconds() == 0); attotime curtime = time(); attotime expire = curtime + duration; + const attoseconds_t quantum_attos = quantum.attoseconds(); // figure out where to insert ourselves, expiring any quanta that are out-of-date quantum_slot *insert_after = NULL; @@ -950,20 +958,20 @@ void device_scheduler::add_scheduling_quantum(const attotime &quantum, const att m_quantum_allocator.reclaim(m_quantum_list.detach(*quant)); // if this quantum is shorter than us, we need to be inserted afterwards - else if (quant->m_requested <= quantum.attoseconds) + else if (quant->m_requested <= quantum_attos) insert_after = quant; } // if we found an exact match, just take the maximum expiry time - if (insert_after != NULL && insert_after->m_requested == quantum.attoseconds) + if (insert_after != NULL && insert_after->m_requested == quantum_attos) insert_after->m_expire = max(insert_after->m_expire, expire); // otherwise, allocate a new quantum and insert it after the one we picked else { quantum_slot &quant = *m_quantum_allocator.alloc(); - quant.m_requested = quantum.attoseconds; - quant.m_actual = MAX(quantum.attoseconds, m_quantum_minimum); + quant.m_requested = quantum_attos; + quant.m_actual = MAX(quantum_attos, m_quantum_minimum); quant.m_expire = expire; m_quantum_list.insert_after(quant, insert_after); } @@ -982,3 +990,7 @@ void device_scheduler::dump_timers() const timer->dump(); logerror("=============================================\n"); } + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif |