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{
10}
11
12void CPUClock::advanceTime(EmuTime::param time)
13{
14 remaining = limit;
15 clock.advance(time);
16 setLimit(scheduler.getNext());
17}
18
19template<typename Archive>
20void CPUClock::serialize(Archive& ar, unsigned /*version*/)
21{
22 sync();
23 ar.serialize("clock", clock);
24}
26
27} // namespace openmsx
CPUClock(EmuTime::param time, Scheduler &scheduler)
Definition CPUClock.cc:6
void serialize(Archive &ar, unsigned version)
Definition CPUClock.cc:20
void advanceTime(EmuTime::param time)
Definition CPUClock.cc:12
void sync() const
Definition CPUClock.hh:29
void setLimit(EmuTime::param time)
Definition CPUClock.hh:93
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:11
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)