openMSX
DynamicClock.cc
Go to the documentation of this file.
1 #include "DynamicClock.hh"
2 #include "serialize.hh"
3 
4 namespace openmsx {
5 
6 template<typename Archive>
7 void DynamicClock::serialize(Archive& ar, unsigned /*version*/)
8 {
9  ar.serialize("lastTick", lastTick);
10  unsigned freq = getFreq();
11  ar.serialize("freq", freq);
12  if (ar.isLoader()) setFreq(freq);
13 }
15 
16 } // namespace openmsx
openmsx::DynamicClock::setFreq
void setFreq(unsigned freq)
Change the frequency at which this clock ticks.
Definition: DynamicClock.hh:103
serialize.hh
openmsx::DynamicClock::getFreq
unsigned getFreq() const
Returns the frequency (in Hz) at which this clock ticks.
Definition: DynamicClock.hh:123
openmsx::DynamicClock::serialize
void serialize(Archive &ar, unsigned version)
Definition: DynamicClock.cc:7
openmsx::DynamicClock
Represents a clock with a variable frequency.
Definition: DynamicClock.hh:16
INSTANTIATE_SERIALIZE_METHODS
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
Definition: serialize.hh:981
DynamicClock.hh
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5