28 #include "sidplayfp/event.h"
29 #include "sidplayfp/component.h"
30 #include "sidplayfp/EventScheduler.h"
47 unsigned int rasterLines;
49 event_clock_t (
MOS656X::*clock)();
53 static const char *credit;
55 static const model_data_t modelData[];
59 static const int IRQ_RASTER = 1 << 0;
62 static const int IRQ_LIGHTPEN = 1 << 3;
72 event_clock_t (
MOS656X::*clock)();
74 event_clock_t rasterClk;
82 unsigned int maxRasters;
128 event_clock_t clockPAL();
129 event_clock_t clockNTSC();
130 event_clock_t clockOldNTSC();
133 void handleIrqState();
138 void badLineStateChange() { setBA(!
isBadLine); }
144 void activateIRQFlag(
int flag)
155 bool readDEN()
const {
return (
regs[0x11] & 0x10) != 0; }
157 bool evaluateIsBadLine()
const
171 inline void checkVblank()
174 if (
rasterY == (maxRasters - 1))
181 activateIRQFlag(IRQ_RASTER);
201 activateIRQFlag(IRQ_RASTER);
205 inline void updateMc()
210 for (
unsigned int i=0; i<8; i++, mask<<=1)
217 inline void updateMcBase()
220 for (
unsigned int i=0; i<8; i++, mask<<=1)
230 inline void checkSpriteDmaExp()
232 const uint8_t y =
rasterY & 0xff;
234 for (
unsigned int i=0; i<8; i++, mask<<=1)
246 inline void checkSpriteDma()
248 const uint8_t y =
rasterY & 0xff;
250 for (
unsigned int i=0; i<8; i++, mask<<=1)
260 inline void checkSpriteDisplay()
262 for (
unsigned int i=0; i<8; i++)
270 inline void startDma()
285 inline void startBadline()
296 virtual void interrupt (
bool state) = 0;
297 virtual void setBA (
bool state) = 0;
305 uint8_t
read(uint_least8_t addr);
315 void write(uint_least8_t addr, uint8_t data);
320 void chip(model_t model);
326 const char *credits()
const {
return credit; }
330 int getRasterLines()
const {
return maxRasters; }
337 inline void MOS656X::startDma<0>()
339 setBA(!(sprite_dma & 0x01));
344 inline void MOS656X::endDma<7>()
uint8_t sprite_mc[8]
Definition: mos656x.h:121
bool vblanking
Definition: mos656x.h:102
bool areBadLinesEnabled
Definition: mos656x.h:96
bool isBadLine
Definition: mos656x.h:99
void event()
Definition: mos656x.cpp:214
unsigned int yscroll
Definition: mos656x.h:91
unsigned int lineCycle
Definition: mos656x.h:85
unsigned int cyclesPerLine
Definition: mos656x.h:80
Definition: component.h:28
uint8_t & sprite_y_expansion
Definition: mos656x.h:118
static const unsigned int LAST_DMA_LINE
Definition: mos656x.h:69
uint8_t read(uint_least8_t addr)
Definition: mos656x.cpp:91
uint8_t sprite_mc_base[8]
Definition: mos656x.h:120
uint8_t lpx
Definition: mos656x.h:114
uint8_t irqMask
Definition: mos656x.h:111
uint8_t regs[0x40]
Definition: mos656x.h:125
void write(uint_least8_t addr, uint8_t data)
Definition: mos656x.cpp:127
static const unsigned int FIRST_DMA_LINE
Definition: mos656x.h:66
uint8_t irqFlags
Definition: mos656x.h:108
uint8_t sprite_dma
Definition: mos656x.h:119
EventContext & event_context
Definition: mos656x.h:77
unsigned int rasterY
Definition: mos656x.h:88
bool lp_triggered
Definition: mos656x.h:105
virtual void cancel(Event &event)=0
uint8_t & sprite_enable
Definition: mos656x.h:118