21 #include "sidplayfp/component.h"
22 #include "sidplayfp/event.h"
35 static const int_least32_t CIAT_CR_START = 0x01;
36 static const int_least32_t CIAT_STEP = 0x04;
37 static const int_least32_t CIAT_CR_ONESHOT = 0x08;
38 static const int_least32_t CIAT_CR_FLOAD = 0x10;
39 static const int_least32_t CIAT_PHI2IN = 0x20;
40 static const int_least32_t CIAT_CR_MASK = CIAT_CR_START | CIAT_CR_ONESHOT | CIAT_CR_FLOAD | CIAT_PHI2IN;
42 static const int_least32_t CIAT_COUNT2 = 0x100;
43 static const int_least32_t CIAT_COUNT3 = 0x200;
45 static const int_least32_t CIAT_ONESHOT0 = 0x08 << 8;
46 static const int_least32_t CIAT_ONESHOT = 0x08 << 16;
47 static const int_least32_t CIAT_LOAD1 = 0x10 << 8;
48 static const int_least32_t CIAT_LOAD = 0x10 << 16;
50 static const int_least32_t CIAT_OUT = 0x80000000;
66 event_clock_t ciaEventPauseTime;
86 uint8_t lastControlValue;
105 void cycleSkippingEvent(
void);
117 inline void reschedule();
127 virtual void underFlow() =0;
132 virtual void serialPort() {};
144 event_context(*context),
149 m_cycleSkippingEvent(
"Skip CIA clock decrement cycles", *this, &
Timer::cycleSkippingEvent),
187 void latchLo(
const uint8_t data);
195 void latchHi(
const uint8_t data);
217 inline uint_least16_t
getTimer()
const {
return timer; }
225 inline bool getPb(
const uint8_t reg)
const {
return (reg & 0x04) ? pbToggle : (
state & CIAT_OUT); }
248 Timer(
"CIA Timer A", context, parent) {}
266 Timer(
"CIA Timer B", context, parent) {}
298 static const char *credit;
307 uint8_t &pra, &prb, &ddra, &ddrb;
334 uint8_t m_todclock[4], m_todalarm[4], m_todlatch[4];
335 event_clock_t m_todCycles, m_todPeriod;
392 void trigger(
const uint8_t interruptMask);
412 virtual void portA() {}
413 virtual void portB() {}
419 virtual void reset(
void);
427 uint8_t
read(uint_least8_t addr);
437 void write(uint_least8_t addr, uint8_t data);