openMSX
CPUClock.cc
Go to the documentation of this file.
1#include "CPUClock.hh"
2#include "serialize.hh"
3
4namespace openmsx {
5
6CPUClock::CPUClock(EmuTime::param time, Scheduler& scheduler_)
7 : clock(time)
8 , scheduler(scheduler_)
9 , remaining(-1), limit(-1), limitEnabled(false)
10{
11}
12
13void CPUClock::advanceTime(EmuTime::param time)
14{
15 remaining = limit;
16 clock.advance(time);
17 setLimit(scheduler.getNext());
18}
19
20template<typename Archive>
21void CPUClock::serialize(Archive& ar, unsigned /*version*/)
22{
23 sync();
24 ar.serialize("clock", clock);
25}
27
28} // namespace openmsx
CPUClock(EmuTime::param time, Scheduler &scheduler)
Definition: CPUClock.cc:6
void serialize(Archive &ar, unsigned version)
Definition: CPUClock.cc:21
void advanceTime(EmuTime::param time)
Definition: CPUClock.cc:13
void sync() const
Definition: CPUClock.hh:28
void setLimit(EmuTime::param time)
Definition: CPUClock.hh:92
void advance(EmuTime::param e)
Advance this clock in time until the last tick which is not past the given time.
EmuTime::param getNext() const
TODO.
Definition: Scheduler.hh:53
This file implemented 3 utility functions:
Definition: Autofire.cc:9
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
Definition: serialize.hh:1009