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_, std::span< const uint8_t, NUM_DELTAS *TICKS > tab_)
 This shouldn't be called directly, instead use getCalculator().
 
bool limitReached () const
 Has 'time' advanced to or past 'limit'?
 
EmuTime getTime () const
 Get the current time.
 
void next (Delta delta)
 Advance time to the earliest access slot that is at least 'delta' ticks later than the current time.
 

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_,
std::span< const uint8_t, NUM_DELTAS *TICKS 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(), and openmsx::VDPAccessSlots::TICKS.

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::VDPAccessSlots::TICKS, and to_underlying().


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