Previous 199869 Revisions Next

r19602 Sunday 16th December, 2012 at 21:46:45 UTC by Nathan Woods
Minor optimizations to schedule.c (nw)
[src/emu]schedule.c

trunk/src/emu/schedule.c
r19601r19602
301301//  period
302302//-------------------------------------------------
303303
304void emu_timer::schedule_next_period()
304inline void emu_timer::schedule_next_period()
305305{
306306   // advance by one period
307307   m_start = m_expire;
r19601r19602
400400{
401401   // if any live temporary timers exit, fail
402402   for (emu_timer *timer = m_timer_list; timer != NULL; timer = timer->next())
403      if (timer->m_temporary && timer->expire() != attotime::never)
403      if (timer->m_temporary && timer->expire().is_never())
404404      {
405405         logerror("Failed save state attempt due to anonymous timers:\n");
406406         dump_timers();
r19601r19602
679679      emu_timer &timer = *m_timer_list;
680680
681681      // temporary timers go away entirely (except our special never-expiring one)
682      if (timer.m_temporary && timer.expire() != attotime::never)
682      if (timer.m_temporary && timer.expire().is_never())
683683         m_timer_allocator.reclaim(timer.release());
684684
685685      // permanent ones get added to our private list
r19601r19602
756756      attotime min_quantum = machine().config().m_minimum_quantum;
757757
758758      // if none specified default to 60Hz
759      if (min_quantum == attotime::zero)
759      if (min_quantum.is_zero())
760760         min_quantum = attotime::from_hz(60);
761761
762762      // if the configuration specifies a device to make perfect, pick that as the minimum
r19601r19602
879879//  scheduling quanta
880880//-------------------------------------------------
881881
882void device_scheduler::execute_timers()
882inline void device_scheduler::execute_timers()
883883{
884884   // if the current quantum has expired, find a new one
885885   while (m_basetime >= m_quantum_list.first()->m_expire)
r19601r19602
893893      // if this is a one-shot timer, disable it now
894894      emu_timer &timer = *m_timer_list;
895895      bool was_enabled = timer.m_enabled;
896      if (timer.m_period == attotime::zero || timer.m_period == attotime::never)
896      if (timer.m_period.is_zero() || timer.m_period.is_never())
897897         timer.m_enabled = false;
898898
899899      // set the global state of which callback we're in

Previous 199869 Revisions Next


© 1997-2024 The MAME Team