libsidplayfp::MOS652X Class Referenceabstract

`#include <mos652x.h>`

Inheritance diagram for libsidplayfp::MOS652X:

## Public Types

enum class | model_t { MOS6526 = 0 , MOS8521 , MOS6526W4485 }

## Public Member Functions

void | setModel (model_t model)
virtual void | reset ()
void | setDayOfTimeRate (unsigned int clock)

## Static Public Member Functions

static const char * | credits ()

## Protected Member Functions

| MOS652X (EventScheduler &scheduler)
virtual void | interrupt (bool state)=0
virtual void | portA ()
virtual void | portB ()
uint8_t | adjustDataPort (uint8_t data)
uint8_t | read (uint_least8_t addr)
void | write (uint_least8_t addr, uint8_t data)

## Protected Attributes

EventScheduler & | eventScheduler
| Event context.
uint8_t & | pra
| Ports.
uint8_t & | prb
uint8_t & | ddra
uint8_t & | ddrb
uint8_t | regs [0x10]
| These are all CIA registers.
TimerA | timerA
| Timers A and B.
TimerB | timerB
std::unique_ptr< InterruptSource > | interruptSource
| Interrupt Source.
Tod | tod
| TOD.
SerialPort | serialPort
| Serial Data Registers.
EventCallback< MOS652X > | bTickEvent
| Events.

## Friends

class | InterruptSource
class | SerialPort
class | TimerA
class | TimerB
class | Tod

## Detailed Description

This class is heavily based on the ciacore/ciatimer source code from VICE. The CIA state machine is lifted as-is. Big thanks to VICE project! The Serial Port emulation is based on Denise emu code.

## Member Enumeration Documentation

## model_t

enum class libsidplayfp::MOS652X::model_t

strong

Enumerator
MOS6526 | Old CIA model, interrupts are delayed by 1 clock.
MOS8521 | New CIA model.
MOS6526W4485 | A batch of old CIA model with unique serial port behavior.

## Constructor & Destructor Documentation

## MOS652X()

libsidplayfp::MOS652X::MOS652X | ( | EventScheduler & | scheduler | ) |

protected

Create a new CIA.

Parameters

  context | the event context

## Member Function Documentation

## adjustDataPort()

uint8_t libsidplayfp::MOS652X::adjustDataPort | ( | uint8_t | data | ) |

protected

Timers can appear on the port.

## credits()

const char * libsidplayfp::MOS652X::credits | ( |  | ) |

static

Get the credits.

Returns
  the credits

## interrupt()

virtual void libsidplayfp::MOS652X::interrupt | ( | bool | state | ) |

protected pure virtual

Signal interrupt.

Parameters

  state | interrupt state

Implemented in libsidplayfp::c64cia1, and libsidplayfp::c64cia2.

## read()

uint8_t libsidplayfp::MOS652X::read | ( | uint_least8_t | addr | ) |

protected

Read CIA register.

Parameters

  addr | register address to read (lowest 4 bits)

## reset()

void libsidplayfp::MOS652X::reset | ( |  | ) |

virtual

Reset CIA.

Reimplemented in libsidplayfp::c64cia1.

## setDayOfTimeRate()

void libsidplayfp::MOS652X::setDayOfTimeRate | ( | unsigned int | clock | ) |

inline

Set day-of-time event occurence of rate.

Parameters

  clock |

## setModel()

void libsidplayfp::MOS652X::setModel | ( | model_t | model | ) |

Select chip model.

Parameters

  model |

## write()

void libsidplayfp::MOS652X::write | ( | uint_least8_t | addr,
|  | uint8_t | data )

protected

Write CIA register.

Parameters

  addr | register address to write (lowest 4 bits)
  data | value to write

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

- mos652x.h
- mos652x.cpp