trunk/src/emu/schedule.c
| r19601 | r19602 | |
| 301 | 301 | // period |
| 302 | 302 | //------------------------------------------------- |
| 303 | 303 | |
| 304 | | void emu_timer::schedule_next_period() |
| 304 | inline void emu_timer::schedule_next_period() |
| 305 | 305 | { |
| 306 | 306 | // advance by one period |
| 307 | 307 | m_start = m_expire; |
| r19601 | r19602 | |
| 400 | 400 | { |
| 401 | 401 | // if any live temporary timers exit, fail |
| 402 | 402 | 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()) |
| 404 | 404 | { |
| 405 | 405 | logerror("Failed save state attempt due to anonymous timers:\n"); |
| 406 | 406 | dump_timers(); |
| r19601 | r19602 | |
| 679 | 679 | emu_timer &timer = *m_timer_list; |
| 680 | 680 | |
| 681 | 681 | // 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()) |
| 683 | 683 | m_timer_allocator.reclaim(timer.release()); |
| 684 | 684 | |
| 685 | 685 | // permanent ones get added to our private list |
| r19601 | r19602 | |
| 756 | 756 | attotime min_quantum = machine().config().m_minimum_quantum; |
| 757 | 757 | |
| 758 | 758 | // if none specified default to 60Hz |
| 759 | | if (min_quantum == attotime::zero) |
| 759 | if (min_quantum.is_zero()) |
| 760 | 760 | min_quantum = attotime::from_hz(60); |
| 761 | 761 | |
| 762 | 762 | // if the configuration specifies a device to make perfect, pick that as the minimum |
| r19601 | r19602 | |
| 879 | 879 | // scheduling quanta |
| 880 | 880 | //------------------------------------------------- |
| 881 | 881 | |
| 882 | | void device_scheduler::execute_timers() |
| 882 | inline void device_scheduler::execute_timers() |
| 883 | 883 | { |
| 884 | 884 | // if the current quantum has expired, find a new one |
| 885 | 885 | while (m_basetime >= m_quantum_list.first()->m_expire) |
| r19601 | r19602 | |
| 893 | 893 | // if this is a one-shot timer, disable it now |
| 894 | 894 | emu_timer &timer = *m_timer_list; |
| 895 | 895 | 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()) |
| 897 | 897 | timer.m_enabled = false; |
| 898 | 898 | |
| 899 | 899 | // set the global state of which callback we're in |