openMSX

Represents a clock with a fixed frequency. More...
#include <Clock.hh>
Public Member Functions  
constexpr  Clock (EmuTime::param e) 
Create a new clock, which starts ticking at the given time. More...  
constexpr EmuTime::param  getTime () const 
Gets the time at which the last clock tick occurred. More...  
constexpr bool  before (EmuTime::param e) const 
Checks whether this clock's last tick is or is not before the given time stamp. More...  
constexpr unsigned  getTicksTill (EmuTime::param e) const 
Calculate the number of ticks for this clock until the given time. More...  
constexpr unsigned  getTicksTill_fast (EmuTime::param e) const 
Same as above, only faster, Though the time interval may not be too large. More...  
constexpr uint64_t  getTicksTillUp (EmuTime::param e) const 
Calculate the number of ticks this clock has to tick to reach or go past the given time. More...  
constexpr EmuTime  operator+ (uint64_t n) const 
Calculate the time at which this clock will have ticked the given number of times (counted from its last tick). More...  
constexpr EmuTime  getFastAdd (unsigned n) const 
Like operator+() but faster, though the step can't be too big (max a little over 1 second). More...  
constexpr void  reset (EmuTime::param e) 
Reset the clock to start ticking at the given time. More...  
constexpr void  advance (EmuTime::param e) 
Advance this clock in time until the last tick which is not past the given time. More...  
constexpr void  advance_fast (EmuTime::param e) 
Same as above, only faster, Though the time interval may not be too large. More...  
constexpr void  operator+= (unsigned n) 
Advance this clock by the given number of ticks. More...  
constexpr void  fastAdd (unsigned n) 
Advance this clock by the given number of ticks. More...  
template<typename Archive >  
void  serialize (Archive &ar, unsigned) 
Static Public Member Functions  
static constexpr EmuDuration  duration (unsigned ticks) 
Calculates the duration of the given number of ticks at this clock's frequency. More...  
Represents a clock with a fixed frequency.
The frequency is in Hertz, so every tick is 1/frequency second. A clock has a current time, which can be increased by an integer number of ticks.

inlineexplicit 

inline 
Advance this clock in time until the last tick which is not past the given time.
It is not allowed to advance a clock to a time in the past.
Definition at line 110 of file Clock.hh.
Referenced by openmsx::RealDrive::getMotor(), openmsx::Y8950Adpcm::sync(), openmsx::MSXHiResTimer::writeIO(), openmsx::VDPIODelay::writeIO(), openmsx::MSXTurboRPCM::writeIO(), openmsx::MSXE6Timer::writeIO(), and openmsx::SCC::writeMem().

inline 

inline 

inlinestatic 

inline 
Advance this clock by the given number of ticks.
This method is similar to operator+=, but it's optimized for speed. OTOH the amount of ticks should not be too large, otherwise an overflow occurs. Use operator+() when the duration of the ticks approaches 1 second.

inline 
Like operator+() but faster, though the step can't be too big (max a little over 1 second).
Definition at line 93 of file Clock.hh.
Referenced by openmsx::VDPAccessSlots::Calculator::getTime().

inline 
Calculate the number of ticks for this clock until the given time.
It is not allowed to call this method for a time in the past.
Definition at line 58 of file Clock.hh.
Referenced by openmsx::MSXHiResTimer::peekIO(), openmsx::MSXTurboRPCM::peekIO(), openmsx::MSXE6Timer::peekIO(), openmsx::SCC::peekMem(), openmsx::PioneerLDControl::peekMem(), openmsx::MSXHiResTimer::readIO(), openmsx::Y8950Adpcm::sync(), and openmsx::DebugDevice::writeIO().

inline 
Same as above, only faster, Though the time interval may not be too large.
Definition at line 70 of file Clock.hh.
Referenced by openmsx::VDPAccessSlots::Calculator::Calculator(), openmsx::VDPAccessSlots::getAccessSlot(), openmsx::V9990::getColorMode(), and openmsx::V9990::getUCTicksThisFrame().

inline 
Calculate the number of ticks this clock has to tick to reach or go past the given time.
It is not allowed to call this method for a time in the past.
Definition at line 79 of file Clock.hh.
Referenced by openmsx::RealDrive::getMotor().

inline 
Gets the time at which the last clock tick occurred.
Definition at line 46 of file Clock.hh.
Referenced by openmsx::CasImage::getEndTime(), openmsx::VDPIODelay::readIO(), openmsx::SCC::serialize(), openmsx::Y8950Adpcm::sync(), openmsx::VDPIODelay::writeIO(), openmsx::MSXMatsushita::writeIO(), and openmsx::VDP::~VDP().

inline 

inline 

inline 
Reset the clock to start ticking at the given time.
Definition at line 102 of file Clock.hh.
Referenced by openmsx::V9990::getPalette(), openmsx::MSXHiResTimer::reset(), openmsx::MSXTurboRPCM::reset(), openmsx::Y8950Adpcm::reset(), openmsx::MSXE6Timer::reset(), openmsx::VDP::reset(), openmsx::Y8950Adpcm::serialize(), openmsx::SpriteChecker::serialize(), and openmsx::MSXMatsushita::writeIO().

inline 