libsidplayfp::InterruptSource Class Referenceabstract

`#include <interrupt.h>`

Inheritance diagram for libsidplayfp::InterruptSource:

## Public Types

enum | { INTERRUPT_NONE = 0 , INTERRUPT_UNDERFLOW_A = 1 << 0 , INTERRUPT_UNDERFLOW_B = 1 << 1 , INTERRUPT_ALARM = 1 << 2 , INTERRUPT_SP = 1 << 3 , INTERRUPT_FLAG = 1 << 4 , INTERRUPT_REQUEST = 1 << 7 }

## Public Member Functions

virtual void | trigger (uint8_t interruptMask)=0
virtual uint8_t | clear ()
virtual void | reset ()
void | set (uint8_t interruptMask)

## Protected Member Functions

bool | interruptTriggered () const
bool | interruptMasked (uint8_t interruptMask) const
virtual void | triggerInterrupt ()=0
bool | ack0 () const
bool | write0 () const
void | interrupt ()
void | updateIdr ()
void | setIrq ()
void | clearIrq ()
| InterruptSource (EventScheduler &scheduler, MOS652X &parent)
void | schedule (int delay)
void | scheduleIrq ()
bool | isTriggered (uint8_t interruptMask)

## Protected Attributes

EventScheduler & | eventScheduler
| Event scheduler.
event_clock_t | last_clear
| Clock when clear was called last.
event_clock_t | last_set
uint8_t | icr
| Interrupt control register.
uint8_t | idr
| Interrupt data register.
uint8_t | idrTemp
bool | scheduled
| Have we already scheduled CIA->CPU interrupt transition?
bool | asserted
| is the irq pin asserted?

## Detailed Description

This is the base class for the MOS6526 interrupt sources. Based on Denise emu code.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
INTERRUPT_NONE | no interrupt
INTERRUPT_UNDERFLOW_A | underflow Timer A
INTERRUPT_UNDERFLOW_B | underflow Timer B
INTERRUPT_ALARM | alarm clock
INTERRUPT_SP | serial port
INTERRUPT_FLAG | external flag
INTERRUPT_REQUEST | control bit

## Constructor & Destructor Documentation

## InterruptSource()

libsidplayfp::InterruptSource::InterruptSource | ( | EventScheduler & | scheduler,
|  | MOS652X & | parent
| ) |  |

inline protected

Create a new InterruptSource.

Parameters

  scheduler | event scheduler
  parent | the MOS6526 which this Interrupt belongs to

## Member Function Documentation

## ack0()

bool libsidplayfp::InterruptSource::ack0 | ( |  | ) | const

inline protected

Check if interrupts were ackowledged during previous cycle.

## clear()

uint8_t libsidplayfp::InterruptSource::clear | ( |  | ) |

virtual

Clear interrupt state.

Returns
  old interrupt state

Reimplemented in libsidplayfp::InterruptSource6526.

## interrupt()

void libsidplayfp::InterruptSource::interrupt | ( |  | ) |

protected

Signal interrupt to CPU.

## reset()

virtual void libsidplayfp::InterruptSource::reset | ( |  | ) |

inline virtual

Clear pending interrupts, but do not signal to CPU we lost them. It is assumed that all components get reset() calls in synchronous manner.

## schedule()

void libsidplayfp::InterruptSource::schedule | ( | int | delay | ) |

inline protected

Schedules an IRQ asserting state transition for next cycle.

## set()

void libsidplayfp::InterruptSource::set | ( | uint8_t | interruptMask | ) |

Set interrupt control mask bits.

Parameters

  interruptMask | control mask bits

## trigger()

virtual void libsidplayfp::InterruptSource::trigger | ( | uint8_t | interruptMask | ) |

pure virtual

Trigger an interrupt.

Parameters

  interruptMask | Interrupt flag number

Implemented in libsidplayfp::InterruptSource6526, and libsidplayfp::InterruptSource8521.

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

- interrupt.h
- interrupt.cpp