libsidplayfp  0.3.5
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Timer Class Reference
Inheritance diagram for Timer:
Event TimerA TimerB

Public Member Functions

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

Protected Member Functions

 Timer (const char *name, EventContext *context, MOS6526 *parent)

Protected Attributes

MOS6526parent
int_least32_t state

Static Protected Attributes

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

Additional Inherited Members

- Private Member Functions inherited from Event
 Event (const char *const name)
virtual void event (void)=0
bool pending () const
SID_DEPRECATED void cancel ()
SID_DEPRECATED void schedule (EventContext &context, event_clock_t cycles, event_phase_t phase)

Constructor & Destructor Documentation

Timer::Timer ( const char *  name,
EventContext context,
MOS6526 parent 
)
inlineprotected

Create a new timer.

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

Member Function Documentation

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

Get PB6/PB7 Flipflop state.

Parameters
regvalue of the control register
Returns
PB6/PB7 flipflop state
int_least32_t Timer::getState ( ) const
inline

Get current state value.

Returns
current state value
uint_least16_t Timer::getTimer ( ) const
inline

Get current timer value.

Returns
current timer value
void Timer::latchHi ( const uint8_t  data)

Set high byte of Timer start value (Latch).

Parameters
datahigh byte of latch
void Timer::latchLo ( const uint8_t  data)

Set low byte of Timer start value (Latch).

Parameters
datalow byte of latch
void Timer::reset ( void  )

Reset timer.

void Timer::setControlRegister ( const uint8_t  cr)

Set CRA/CRB control register.

Parameters
crcontrol register value
void Timer::setPbToggle ( const bool  state)
inline

Set PB6/PB7 Flipflop state.

Parameters
statePB6/PB7 flipflop state
void Timer::syncWithCpu ( )

Perform cycle skipping manually.

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

void Timer::wakeUpAfterSyncWithCpu ( )

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

Member Data Documentation

MOS6526* Timer::parent
protected

Pointer to the MOS6526 which this Timer belongs to.

int_least32_t Timer::state
protected

CRA/CRB control register / state.


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