26 #include "sidplayfp/component.h"
27 #include "sidplayfp/EventScheduler.h"
45 unsigned int rasterLines;
46 event_clock_t (
MOS656X::*clock)();
50 static const char *credit;
52 static const model_data_t modelData[];
56 static const int IRQ_RASTER = 1 << 0;
59 static const int IRQ_LIGHTPEN = 1 << 3;
69 event_clock_t (
MOS656X::*clock)();
71 event_clock_t rasterClk;
79 uint_least16_t maxRasters;
81 uint_least16_t raster_irq;
125 event_clock_t clockPAL();
126 event_clock_t clockNTSC();
127 event_clock_t clockOldNTSC();
130 void handleIrqState();
135 void badLineStateChange() { setBA(!
isBadLine); }
141 void activateIRQFlag(
int flag)
152 bool readDEN()
const {
return (
regs[0x11] & 0x10) != 0; }
154 bool evaluateIsBadLine()
const
168 inline void checkVblank()
171 if (
rasterY == (maxRasters - 1))
178 activateIRQFlag(IRQ_RASTER);
198 activateIRQFlag(IRQ_RASTER);
202 inline void updateMc()
207 for (
unsigned int i=0; i<8; i++, mask<<=1)
214 inline void updateMcBase()
217 for (
unsigned int i=0; i<8; i++, mask<<=1)
227 inline void checkSpriteDmaExp()
229 const uint8_t y =
rasterY & 0xff;
231 for (
unsigned int i=0; i<8; i++, mask<<=1)
243 inline void checkSpriteDma()
245 const uint8_t y =
rasterY & 0xff;
247 for (
unsigned int i=0; i<8; i++, mask<<=1)
257 inline void checkSpriteDisplay()
259 for (
unsigned int i=0; i<8; i++)
267 inline void startDma()
282 inline void startBadline()
293 virtual void interrupt (
bool state) = 0;
294 virtual void setBA (
bool state) = 0;
302 uint8_t
read(uint_least8_t addr);
312 void write(uint_least8_t addr, uint8_t data);
317 void chip(model_t model);
323 const char *credits()
const {
return credit; }
325 uint_least16_t getCyclesPerLine()
const {
return cyclesPerLine; }
327 uint_least16_t getRasterLines()
const {
return maxRasters; }
334 inline void MOS656X::startDma<0>()
336 setBA(!(sprite_dma & 0x01));
341 inline void MOS656X::endDma<7>()