trunk/src/emu/schedule.c
| r19588 | r19589 | |
| 885 | 885 | while (m_basetime >= m_quantum_list.first()->m_expire) |
| 886 | 886 | m_quantum_allocator.reclaim(m_quantum_list.detach_head()); |
| 887 | 887 | |
| 888 | | LOG(("timer_set_global_time: new=%s head->expire=%s\n", m_basetime.as_string(), m_timer_list->m_expire.as_string())); |
| 888 | LOG(("execute_timers: new=%s head->expire=%s\n", m_basetime.as_string(), m_timer_list->m_expire.as_string())); |
| 889 | 889 | |
| 890 | 890 | // now process any timers that are overdue |
| 891 | 891 | while (m_timer_list->m_expire <= m_basetime) |
| r19588 | r19589 | |
| 907 | 907 | g_profiler.start(PROFILER_TIMER_CALLBACK); |
| 908 | 908 | |
| 909 | 909 | if (timer.m_device != NULL) |
| 910 | { |
| 911 | LOG(("execute_timers: timer device %s timer %d\n", timer.m_device->name(), timer.m_id)); |
| 910 | 912 | timer.m_device->timer_expired(timer, timer.m_id, timer.m_param, timer.m_ptr); |
| 913 | } |
| 911 | 914 | else if (!timer.m_callback.isnull()) |
| 915 | { |
| 916 | LOG(("execute_timers: timer callback %s\n", timer.m_callback.name())); |
| 912 | 917 | timer.m_callback(timer.m_ptr, timer.m_param); |
| 918 | } |
| 913 | 919 | |
| 914 | 920 | g_profiler.stop(); |
| 915 | 921 | } |