libsidplayfp 2.12.0
libsidplayfp::Timer Class Referenceabstract

#include <timer.h>

Inheritance diagram for libsidplayfp::Timer:
Collaboration diagram for libsidplayfp::Timer:

Public Member Functions

void setControlRegister (uint8_t cr)
void syncWithCpu ()
void wakeUpAfterSyncWithCpu ()
void reset ()
void latchLo (uint8_t data)
void latchHi (uint8_t data)
void setPbToggle (bool state)
int_least32_t getState () const
uint_least16_t getTimer () const
bool getPb (uint8_t reg) const

Protected Member Functions

 Timer (const char *name, EventScheduler &scheduler, MOS652X &parent)

Protected Attributes

MOS652Xparent
 Pointer to the MOS6526 which this Timer belongs to.
int_least32_t state = 0
 CRA/CRB control register / state.

Static Protected Attributes

static constexpr int_least32_t CIAT_CR_START = 0x01
static constexpr int_least32_t CIAT_STEP = 0x04
static constexpr int_least32_t CIAT_CR_ONESHOT = 0x08
static constexpr int_least32_t CIAT_CR_FLOAD = 0x10
static constexpr int_least32_t CIAT_PHI2IN = 0x20
static constexpr int_least32_t CIAT_CR_MASK = CIAT_CR_START | CIAT_CR_ONESHOT | CIAT_CR_FLOAD | CIAT_PHI2IN
static constexpr int_least32_t CIAT_COUNT2 = 0x100
static constexpr int_least32_t CIAT_COUNT3 = 0x200
static constexpr int_least32_t CIAT_ONESHOT0 = 0x08 << 8
static constexpr int_least32_t CIAT_ONESHOT = 0x08 << 16
static constexpr int_least32_t CIAT_LOAD1 = 0x10 << 8
static constexpr int_least32_t CIAT_LOAD = 0x10 << 16
static constexpr int_least32_t CIAT_OUT = 0x80000000

Detailed Description

This is the base class for the MOS6526 timers.

Constructor & Destructor Documentation

◆ Timer()

libsidplayfp::Timer::Timer ( const char * name,
EventScheduler & scheduler,
MOS652X & parent )
inlineprotected

Create a new timer.

Parameters
namecomponent name
contextevent context
parentthe MOS6526 which this Timer belongs to

Member Function Documentation

◆ getPb()

bool libsidplayfp::Timer::getPb ( uint8_t reg) const
inline

Get PB6/PB7 Flipflop state.

Parameters
regvalue of the control register
Returns
PB6/PB7 flipflop state

◆ getState()

int_least32_t libsidplayfp::Timer::getState ( ) const
inline

Get current state value.

Returns
current state value

◆ getTimer()

uint_least16_t libsidplayfp::Timer::getTimer ( ) const
inline

Get current timer value.

Returns
current timer value

◆ latchHi()

void libsidplayfp::Timer::latchHi ( uint8_t data)

Set high byte of Timer start value (Latch).

Parameters
datahigh byte of latch

◆ latchLo()

void libsidplayfp::Timer::latchLo ( uint8_t data)

Set low byte of Timer start value (Latch).

Parameters
datalow byte of latch

◆ reset()

void libsidplayfp::Timer::reset ( )

Reset timer.

◆ setControlRegister()

void libsidplayfp::Timer::setControlRegister ( uint8_t cr)

Set CRA/CRB control register.

Parameters
crcontrol register value

◆ setPbToggle()

void libsidplayfp::Timer::setPbToggle ( bool state)
inline

Set PB6/PB7 Flipflop state.

Parameters
statePB6/PB7 flipflop state

◆ syncWithCpu()

void libsidplayfp::Timer::syncWithCpu ( )

Perform cycle skipping manually.

Clocks the CIA up to the state it should be in, and stops all events.

◆ wakeUpAfterSyncWithCpu()

void libsidplayfp::Timer::wakeUpAfterSyncWithCpu ( )

Counterpart of syncWithCpu(), starts the event ticking if it is needed. No clock() call or anything such is permissible here!


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