27 static constexpr byte MXD = 0x20;
28 static constexpr byte MXS = 0x10;
29 static constexpr byte DIY = 0x08;
30 static constexpr byte DIX = 0x04;
31 static constexpr byte EQ = 0x02;
32 static constexpr byte MAJ = 0x01;
40 void reset(EmuTime::param time);
47 inline void sync(EmuTime::param time) {
50 void sync2(EmuTime::param time);
57 if (CMD && engineTime <= time) {
60 assert(engineTime > time);
70 [[nodiscard]]
inline byte getStatus(EmuTime::param time) {
71 if (time >= statusChangeTime) {
82 [[nodiscard]]
inline byte readColor(EmuTime::param time) {
90 if (!CMD) status &= 0x7F;
101 [[nodiscard]]
inline unsigned getBorderX(EmuTime::param time) {
111 void setCmdReg(
byte index,
byte value, EmuTime::param time);
119 [[nodiscard]]
byte peekCmdReg(
byte index)
const;
138 lastSX, lastSY, lastDX, lastDY, lastNX, lastNY,
139 lastCOL, lastARG, lastCMD};
145 return (status & 1) ? std::tuple{int(ASX), int(SY), int(ADX), int(DY)}
146 : std::tuple{-1, -1, -1, -1};
151 template<
typename Archive>
152 void serialize(Archive& ar,
unsigned version);
155 void executeCommand(EmuTime::param time);
157 void setStatusChangeTime(EmuTime::param
t);
158 void calcFinishTime(
unsigned NX,
unsigned NY,
unsigned ticksPerPixel);
160 void startAbrt(EmuTime::param time);
161 void startPoint(EmuTime::param time);
162 void startPset(EmuTime::param time);
163 void startSrch(EmuTime::param time);
164 void startLine(EmuTime::param time);
165 template<
typename Mode>
void startLmmv(EmuTime::param time);
166 template<
typename Mode>
void startLmmm(EmuTime::param time);
167 template<
typename Mode>
void startLmcm(EmuTime::param time);
168 template<
typename Mode>
void startLmmc(EmuTime::param time);
169 template<
typename Mode>
void startHmmv(EmuTime::param time);
170 template<
typename Mode>
void startHmmm(EmuTime::param time);
171 template<
typename Mode>
void startYmmm(EmuTime::param time);
172 template<
typename Mode>
void startHmmc(EmuTime::param time);
174 template<
typename Mode>
void executePoint(EmuTime::param limit);
175 template<
typename Mode,
typename LogOp>
void executePset(EmuTime::param limit);
176 template<
typename Mode>
void executeSrch(EmuTime::param limit);
177 template<
typename Mode,
typename LogOp>
void executeLine(EmuTime::param limit);
178 template<
typename Mode,
typename LogOp>
void executeLmmv(EmuTime::param limit);
179 template<
typename Mode,
typename LogOp>
void executeLmmm(EmuTime::param limit);
180 template<
typename Mode>
void executeLmcm(EmuTime::param limit);
181 template<
typename Mode,
typename LogOp>
void executeLmmc(EmuTime::param limit);
182 template<
typename Mode>
void executeHmmv(EmuTime::param limit);
183 template<
typename Mode>
void executeHmmm(EmuTime::param limit);
184 template<
typename Mode>
void executeYmmm(EmuTime::param limit);
185 template<
typename Mode>
void executeHmmc(EmuTime::param limit);
188 inline EmuTime getNextAccessSlot(EmuTime::param time)
const {
191 inline void nextAccessSlot(EmuTime::param time) {
192 engineTime = getNextAccessSlot(time);
200 engineTime = getNextAccessSlot(engineTime, delta);
202 inline VDPAccessSlots::Calculator getSlotCalculator(
203 EmuTime::param limit)
const {
209 void commandDone(EmuTime::param time);
213 void reportVdpCommand()
const;
223 BooleanSetting cmdTraceSetting;
224 TclCallback cmdInProgressCallback;
226 Probe<bool> executingProbe;
231 EmuTime engineTime{EmuTime::zero()};
238 EmuTime statusChangeTime{EmuTime::infinity()};
254 unsigned SX{0}, SY{0}, DX{0}, DY{0}, NX{0}, NY{0};
255 unsigned ASX{0}, ADX{0}, ANX{0};
257 byte COL{0}, ARG{0}, CMD{0};
264 int lastSX{0}, lastSY{0}, lastDX{0}, lastDY{0}, lastNX{0}, lastNY{0};
265 byte lastCOL{0}, lastARG{0}, lastCMD{0};
283 bool transfer{
false};
287 const bool hasExtendedVRAM;