openMSX

Represents a clock with a fixed frequency. More...
#include <Clock.hh>
Public Member Functions  
Clock (EmuTime::param e)  
Create a new clock, which starts ticking at the given time. More...  
EmuTime::param  getTime () const 
Gets the time at which the last clock tick occurred. More...  
bool  before (EmuTime::param e) const 
Checks whether this clock's last tick is or is not before the given time stamp. More...  
unsigned  getTicksTill (EmuTime::param e) const 
Calculate the number of ticks for this clock until the given time. More...  
unsigned  getTicksTill_fast (EmuTime::param e) const 
Same as above, only faster, Though the time interval may not be too large. More...  
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...  
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...  
EmuTime  getFastAdd (unsigned n) const 
Like operator+() but faster, though the step can't be too big (max a little over 1 second). More...  
void  reset (EmuTime::param e) 
Reset the clock to start ticking at the given time. More...  
void  advance (EmuTime::param e) 
Advance this clock in time until the last tick which is not past the given time. More...  
void  advance_fast (EmuTime::param e) 
Same as above, only faster, Though the time interval may not be too large. More...  
void  operator+= (unsigned n) 
Advance this clock by the given number of ticks. More...  
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 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 
Calculates the duration of the given number of ticks at this clock's frequency.
Definition at line 35 of file Clock.hh.
Referenced by openmsx::Touchpad::~Touchpad().

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::CasImage::getSampleAt(), openmsx::MSXHiResTimer::peekIO(), openmsx::MSXTurboRPCM::peekIO(), openmsx::MSXE6Timer::peekIO(), openmsx::PioneerLDControl::peekMem(), openmsx::SCC::peekMem(), openmsx::MSXHiResTimer::readIO(), openmsx::Y8950Adpcm::sync(), openmsx::DebugDevice::writeIO(), and openmsx::NowindInterface::writeMem().

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 