libsidplayfp 2.15.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
libsidplayfp::InterruptSource Class Referenceabstract

#include <interrupt.h>

Inheritance diagram for libsidplayfp::InterruptSource:
Inheritance graph
[legend]
Collaboration diagram for libsidplayfp::InterruptSource:
Collaboration graph
[legend]

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

EventSchedulereventScheduler
 Event scheduler.
 
event_clock_t last_clear = 0
 Clock when clear was called last.
 
event_clock_t last_set = 0
 
uint8_t icr = 0
 Interrupt control register.
 
uint8_t idr = 0
 Interrupt data register.
 
uint8_t idrTemp = 0
 
bool scheduled = false
 Have we already scheduled CIA->CPU interrupt transition?
 
bool asserted = false
 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 
)
inlineprotected

Create a new InterruptSource.

Parameters
schedulerevent scheduler
parentthe CIA chip 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.

◆ interrupt()

void libsidplayfp::InterruptSource::interrupt ( )
protected

Signal interrupt to CPU.

◆ 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.

◆ schedule()

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

Schedules an IRQ asserting state transition for next cycle.

◆ set()

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

Set interrupt control mask bits.

Parameters
interruptMaskcontrol mask bits

◆ trigger()

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

Trigger an interrupt.

Parameters
interruptMaskInterrupt flag number

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


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