libsidplayfp  2.2.2
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
libsidplayfp::InterruptSource Class Reference

#include <interrupt.h>

Inheritance diagram for libsidplayfp::InterruptSource:
libsidplayfp::Event libsidplayfp::InterruptSource6526 libsidplayfp::InterruptSource8521

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)
 
virtual uint8_t clear ()
 
virtual void reset ()
 
void set (uint8_t interruptMask)
 
void event () override
 

Protected Member Functions

bool interruptMasked () const
 
bool interruptTriggered () const
 
void triggerInterrupt ()
 
bool ack0 () const
 
 InterruptSource (EventScheduler &scheduler, MOS652X &parent)
 
void schedule ()
 
void interrupt (bool state)
 
 Event (const char *const name)
 

Protected Attributes

EventSchedulereventScheduler
 Event scheduler.
 
event_clock_t last_clear
 Clock when clear was called last.
 
uint8_t icr
 Interrupt control register.
 
uint8_t idr
 Interrupt data register.
 

Detailed Description

This is the base class for the MOS6526 interrupt sources.

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 
)
inlineprotected

Create a new InterruptSource.

Parameters
schedulerevent scheduler
parentthe MOS6526 which this Interrupt belongs to

Member Function Documentation

◆ ack0()

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

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.

◆ event()

void libsidplayfp::InterruptSource::event ( )
overridevirtual

Signal interrupt to CPU.

Implements libsidplayfp::Event.

◆ reset()

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

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

Reimplemented in libsidplayfp::InterruptSource6526.

◆ schedule()

void libsidplayfp::InterruptSource::schedule ( )
inlineprotected

Schedules an IRQ asserting state transition for next cycle.

◆ set()

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

Set interrupt control mask bits.

Parameters
interruptMaskcontrol mask bits

◆ trigger()

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

Trigger an interrupt.

Parameters
interruptMaskInterrupt flag number

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


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