openMSX
Public Member Functions | List of all members
openmsx::VDPAccessSlots::Calculator Class Reference

VDP-VRAM access slot calculator, meant to be used in the inner loops of the VDPCmdEngine commands. More...

#include <VDPAccessSlots.hh>

Public Member Functions

 Calculator (EmuTime::param frame, EmuTime::param time, EmuTime::param limit_, const uint8_t *tab_)
 This shouldn't be called directly, instead use getCalculator(). More...
 
bool limitReached () const
 Has 'time' advanced to or past 'limit'? More...
 
EmuTime getTime () const
 Get the current time. More...
 
void next (Delta delta)
 Advance time to the earliest access slot that is at least 'delta' ticks later than the current time. More...
 

Detailed Description

VDP-VRAM access slot calculator, meant to be used in the inner loops of the VDPCmdEngine commands.

Code optimized for the case that:

Definition at line 38 of file VDPAccessSlots.hh.

Constructor & Destructor Documentation

◆ Calculator()

openmsx::VDPAccessSlots::Calculator::Calculator ( EmuTime::param  frame,
EmuTime::param  time,
EmuTime::param  limit_,
const uint8_t *  tab_ 
)
inline

This shouldn't be called directly, instead use getCalculator().

Definition at line 42 of file VDPAccessSlots.hh.

References openmsx::Clock< FREQ_NUM, FREQ_DENOM >::getTicksTill_fast().

Member Function Documentation

◆ getTime()

EmuTime openmsx::VDPAccessSlots::Calculator::getTime ( ) const
inline

Get the current time.

Initially this will return the 'time' constructor parameter. Each call to next() will increase this value.

Definition at line 67 of file VDPAccessSlots.hh.

References openmsx::Clock< FREQ_NUM, FREQ_DENOM >::getFastAdd().

◆ limitReached()

bool openmsx::VDPAccessSlots::Calculator::limitReached ( ) const
inline

Has 'time' advanced to or past 'limit'?

Definition at line 60 of file VDPAccessSlots.hh.

◆ next()

void openmsx::VDPAccessSlots::Calculator::next ( Delta  delta)
inline

Advance time to the earliest access slot that is at least 'delta' ticks later than the current time.

Definition at line 73 of file VDPAccessSlots.hh.

References openmsx::EmuTime, openmsx::VDPAccessSlots::getAccessSlot(), openmsx::VDPAccessSlots::getCalculator(), and unlikely.


The documentation for this class was generated from the following file: