|
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. | |
| EmuTime::param | getTime () const |
| Gets the time at which the last clock tick occurred. | |
| bool | before (EmuTime::param e) const |
| Checks whether this clock's last tick is or is not before the given time stamp. | |
| unsigned | getTicksTill (EmuTime::param e) const |
| Calculate the number of ticks for this clock until the given time. | |
| unsigned | getTicksTill_fast (EmuTime::param e) const |
| Same as above, only faster, Though the time interval may not be too large. | |
| 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. | |
| const 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). | |
| void | reset (EmuTime::param e) |
| Reset the clock to start ticking at the given time. | |
| void | advance (EmuTime::param e) |
| Advance this clock in time until the last tick which is not past the given time. | |
| void | advance_fast (EmuTime::param e) |
| Same as above, only faster, Though the time interval may not be too large. | |
| void | operator+= (unsigned n) |
| Advance this clock by the given number of ticks. | |
| void | fastAdd (unsigned n) |
| Advance this clock by the given number of ticks. | |
| template<typename Archive > | |
| void | serialize (Archive &ar, unsigned) |
Static Public Member Functions | |
| static const EmuDuration | duration (unsigned ticks) |
| Calculates the duration of the given number of ticks at this clock's frequency. | |
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 104 of file Clock.hh.
Referenced by openmsx::RealDrive::setHeadLoaded(), openmsx::Y8950Adpcm::sync(), openmsx::MSXTurboRPCM::writeIO(), and openmsx::MSXE6Timer::writeIO().
|
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 |
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::RealDrive::headLoaded(), openmsx::MSXTurboRPCM::peekIO(), openmsx::MSXE6Timer::peekIO(), openmsx::PioneerLDControl::peekMem(), openmsx::Y8950Adpcm::sync(), 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::SpriteChecker::checkUntil(), openmsx::VDP::getTicksThisFrame(), openmsx::V9990::getUCTicksThisFrame(), openmsx::R800TYPE::R800Refresh(), openmsx::R800TYPE::R800RefreshSlow(), and openmsx::SpriteChecker::updateDisplayMode().
|
inline |
|
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::VDP::getFrameStartTime(), openmsx::VDP::isInsideFrame(), openmsx::VDPIODelay::readIO(), openmsx::SCC::serialize(), and openmsx::VDPIODelay::writeIO().
|
inline |
|
inline |
|
inline |
Reset the clock to start ticking at the given time.
Definition at line 96 of file Clock.hh.
Referenced by openmsx::SpriteChecker::frameStart(), openmsx::MSXTurboRPCM::reset(), openmsx::MSXE6Timer::reset(), openmsx::Y8950Adpcm::reset(), openmsx::Y8950Adpcm::serialize(), openmsx::SpriteChecker::serialize(), and openmsx::R800TYPE::setTime().
|
inline |
1.8.1.2