Previous 199869 Revisions Next

r31186 Friday 4th July, 2014 at 07:20:10 UTC by Oliver Stöneberg
and a final batch of passing attotime as const reference (nw)
[src/emu]debugger.h schedule.c schedule.h video.c video.h

trunk/src/emu/video.c
r31185r31186
983983//  if we did not skip a frame
984984//-------------------------------------------------
985985
986void video_manager::recompute_speed(attotime emutime)
986void video_manager::recompute_speed(const attotime &emutime)
987987{
988988   // if we don't have a starting time yet, or if we're paused, reset our starting point
989989   if (m_speed_last_realtime == 0 || machine().paused())
trunk/src/emu/video.h
r31185r31186
111111   osd_ticks_t throttle_until_ticks(osd_ticks_t target_ticks);
112112   void update_frameskip();
113113   void update_refresh_speed();
114   void recompute_speed(attotime emutime);
114   void recompute_speed(const attotime &emutime);
115115
116116   // snapshot/movie helpers
117117   void create_snapshot_bitmap(screen_device *screen);
trunk/src/emu/schedule.c
r31185r31186
174174//  firings
175175//-------------------------------------------------
176176
177void emu_timer::adjust(attotime start_delay, INT32 param, attotime period)
177void emu_timer::adjust(attotime start_delay, INT32 param, const attotime &period)
178178{
179179   // if this is the callback timer, mark it modified
180180   device_scheduler &scheduler = machine().scheduler();
r31185r31186
532532//  trigger - generate a global trigger
533533//-------------------------------------------------
534534
535void device_scheduler::trigger(int trigid, attotime after)
535void device_scheduler::trigger(int trigid, const attotime &after)
536536{
537537   // ensure we have a list of executing devices
538538   if (m_execute_list == NULL)
r31185r31186
554554//  interleave factor
555555//-------------------------------------------------
556556
557void device_scheduler::boost_interleave(attotime timeslice_time, attotime boost_duration)
557void device_scheduler::boost_interleave(const attotime &timeslice_time, const attotime &boost_duration)
558558{
559559   // ignore timeslices > 1 second
560560   if (timeslice_time.seconds > 0)
r31185r31186
580580//  amount of time
581581//-------------------------------------------------
582582
583void device_scheduler::timer_set(attotime duration, timer_expired_delegate callback, int param, void *ptr)
583void device_scheduler::timer_set(const attotime &duration, timer_expired_delegate callback, int param, void *ptr)
584584{
585585   m_timer_allocator.alloc()->init(machine(), callback, ptr, true).adjust(duration, param);
586586}
r31185r31186
592592//  frequency
593593//-------------------------------------------------
594594
595void device_scheduler::timer_pulse(attotime period, timer_expired_delegate callback, int param, void *ptr)
595void device_scheduler::timer_pulse(const attotime &period, timer_expired_delegate callback, int param, void *ptr)
596596{
597597   m_timer_allocator.alloc()->init(machine(), callback, ptr, false).adjust(period, param, period);
598598}
r31185r31186
615615//  time
616616//-------------------------------------------------
617617
618void device_scheduler::timer_set(attotime duration, device_t &device, device_timer_id id, int param, void *ptr)
618void device_scheduler::timer_set(const attotime &duration, device_t &device, device_timer_id id, int param, void *ptr)
619619{
620620   m_timer_allocator.alloc()->init(device, id, ptr, true).adjust(duration, param);
621621}
r31185r31186
931931//  that is in use
932932//-------------------------------------------------
933933
934void device_scheduler::add_scheduling_quantum(attotime quantum, attotime duration)
934void device_scheduler::add_scheduling_quantum(const attotime &quantum, const attotime &duration)
935935{
936936   assert(quantum.seconds == 0);
937937
trunk/src/emu/schedule.h
r31185r31186
7979   void set_ptr(void *ptr) { m_ptr = ptr; }
8080
8181   // control
82   void reset(attotime duration = attotime::never) { adjust(duration, m_param, m_period); }
83   void adjust(attotime duration, INT32 param = 0, attotime periodicity = attotime::never);
82   void reset(const attotime &duration = attotime::never) { adjust(duration, m_param, m_period); }
83   void adjust(attotime start_delay, INT32 param = 0, const attotime &periodicity = attotime::never);
8484
8585   // timing queries
8686   attotime elapsed() const;
r31185r31186
133133   // execution
134134   void timeslice();
135135   void abort_timeslice();
136   void trigger(int trigid, attotime after = attotime::zero);
137   void boost_interleave(attotime timeslice_time, attotime boost_duration);
136   void trigger(int trigid, const attotime &after = attotime::zero);
137   void boost_interleave(const attotime &timeslice_time, const attotime &boost_duration);
138138   void suspend_resume_changed() { m_suspend_changes_pending = true; }
139139
140140   // timers, specified by callback/name
141141   emu_timer *timer_alloc(timer_expired_delegate callback, void *ptr = NULL);
142   void timer_set(attotime duration, timer_expired_delegate callback, int param = 0, void *ptr = NULL);
143   void timer_pulse(attotime period, timer_expired_delegate callback, int param = 0, void *ptr = NULL);
142   void timer_set(const attotime &duration, timer_expired_delegate callback, int param = 0, void *ptr = NULL);
143   void timer_pulse(const attotime &period, timer_expired_delegate callback, int param = 0, void *ptr = NULL);
144144   void synchronize(timer_expired_delegate callback = timer_expired_delegate(), int param = 0, void *ptr = NULL) { timer_set(attotime::zero, callback, param, ptr); }
145145
146146   // timers with old-skool callbacks
147147   emu_timer *timer_alloc(timer_expired_func callback, const char *name, void *ptr = NULL) { return timer_alloc(timer_expired_delegate(callback, name, &machine()), ptr); }
148   void timer_set(attotime duration, timer_expired_func callback, const char *name, int param = 0, void *ptr = NULL) { timer_set(duration, timer_expired_delegate(callback, name, &machine()), param, ptr); }
149   void timer_pulse(attotime period, timer_expired_func callback, const char *name, int param = 0, void *ptr = NULL) { timer_pulse(period, timer_expired_delegate(callback, name, &machine()), param, ptr); }
148   void timer_set(const attotime &duration, timer_expired_func callback, const char *name, int param = 0, void *ptr = NULL) { timer_set(duration, timer_expired_delegate(callback, name, &machine()), param, ptr); }
149   void timer_pulse(const attotime &period, timer_expired_func callback, const char *name, int param = 0, void *ptr = NULL) { timer_pulse(period, timer_expired_delegate(callback, name, &machine()), param, ptr); }
150150   void synchronize(timer_expired_func callback, const char *name = NULL, int param = 0, void *ptr = NULL) { timer_set(attotime::zero, callback, name, param, ptr); }
151151
152152   // timers, specified by device/id; generally devices should use the device_t methods instead
153153   emu_timer *timer_alloc(device_t &device, device_timer_id id = 0, void *ptr = NULL);
154   void timer_set(attotime duration, device_t &device, device_timer_id id = 0, int param = 0, void *ptr = NULL);
154   void timer_set(const attotime &duration, device_t &device, device_timer_id id = 0, int param = 0, void *ptr = NULL);
155155
156156   // debugging
157157   void dump_timers() const;
r31185r31186
169169   void compute_perfect_interleave();
170170   void rebuild_execute_list();
171171   void apply_suspend_changes();
172   void add_scheduling_quantum(attotime quantum, attotime duration);
172   void add_scheduling_quantum(const attotime &quantum, const attotime &duration);
173173
174174   // timer helpers
175175   emu_timer &timer_list_insert(emu_timer &timer);
trunk/src/emu/debugger.h
r31185r31186
7575    execution for the given CPU
7676-------------------------------------------------*/
7777
78INLINE void debugger_start_cpu_hook(device_t *device, attotime endtime)
78INLINE void debugger_start_cpu_hook(device_t *device, const attotime &endtime)
7979{
8080   if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
8181      device->debug()->start_hook(endtime);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team