16class CommandController;
30 void reset(EmuTime::param time);
37 inline void sync(EmuTime::param time) {
40 void sync2(EmuTime::param time);
47 if (CMD && engineTime <= time) {
50 assert(engineTime > time);
60 [[nodiscard]]
inline byte getStatus(EmuTime::param time) {
61 if (time >= statusChangeTime) {
72 [[nodiscard]]
inline byte readColor(EmuTime::param time) {
80 if (!CMD) status &= 0x7F;
91 [[nodiscard]]
inline unsigned getBorderX(EmuTime::param time) {
101 void setCmdReg(
byte index,
byte value, EmuTime::param time);
109 [[nodiscard]]
byte peekCmdReg(
byte index)
const;
120 template<
typename Archive>
121 void serialize(Archive& ar,
unsigned version);
124 void executeCommand(EmuTime::param time);
126 void setStatusChangeTime(EmuTime::param
t);
127 void calcFinishTime(
unsigned NX,
unsigned NY,
unsigned ticksPerPixel);
129 void startAbrt(EmuTime::param time);
130 void startPoint(EmuTime::param time);
131 void startPset(EmuTime::param time);
132 void startSrch(EmuTime::param time);
133 void startLine(EmuTime::param time);
134 template<
typename Mode>
void startLmmv(EmuTime::param time);
135 template<
typename Mode>
void startLmmm(EmuTime::param time);
136 template<
typename Mode>
void startLmcm(EmuTime::param time);
137 template<
typename Mode>
void startLmmc(EmuTime::param time);
138 template<
typename Mode>
void startHmmv(EmuTime::param time);
139 template<
typename Mode>
void startHmmm(EmuTime::param time);
140 template<
typename Mode>
void startYmmm(EmuTime::param time);
141 template<
typename Mode>
void startHmmc(EmuTime::param time);
143 template<
typename Mode>
void executePoint(EmuTime::param limit);
144 template<
typename Mode,
typename LogOp>
void executePset(EmuTime::param limit);
145 template<
typename Mode>
void executeSrch(EmuTime::param limit);
146 template<
typename Mode,
typename LogOp>
void executeLine(EmuTime::param limit);
147 template<
typename Mode,
typename LogOp>
void executeLmmv(EmuTime::param limit);
148 template<
typename Mode,
typename LogOp>
void executeLmmm(EmuTime::param limit);
149 template<
typename Mode>
void executeLmcm(EmuTime::param limit);
150 template<
typename Mode,
typename LogOp>
void executeLmmc(EmuTime::param limit);
151 template<
typename Mode>
void executeHmmv(EmuTime::param limit);
152 template<
typename Mode>
void executeHmmm(EmuTime::param limit);
153 template<
typename Mode>
void executeYmmm(EmuTime::param limit);
154 template<
typename Mode>
void executeHmmc(EmuTime::param limit);
157 inline EmuTime getNextAccessSlot(EmuTime::param time) {
160 inline void nextAccessSlot(EmuTime::param time) {
161 engineTime = getNextAccessSlot(time);
169 engineTime = getNextAccessSlot(engineTime, delta);
171 inline VDPAccessSlots::Calculator getSlotCalculator(
172 EmuTime::param limit)
const {
178 void commandDone(EmuTime::param time);
182 void reportVdpCommand()
const;
192 BooleanSetting cmdTraceSetting;
193 TclCallback cmdInProgressCallback;
195 Probe<bool> executingProbe;
200 EmuTime engineTime{EmuTime::zero()};
207 EmuTime statusChangeTime{EmuTime::infinity()};
223 unsigned SX{0}, SY{0}, DX{0}, DY{0}, NX{0}, NY{0};
224 unsigned ASX{0}, ADX{0}, ANX{0};
226 byte COL{0}, ARG{0}, CMD{0};
244 bool transfer{
false};
248 const bool hasExtendedVRAM;
Represents a VDP display mode.
VDP command engine by Alex Wulms.
void updateDisplayMode(DisplayMode mode, bool cmdBit, EmuTime::param time)
Informs the command engine of a VDP display mode change.
void serialize(Archive &ar, unsigned version)
Interface for logical operations.
void reset(EmuTime::param time)
Reinitialize Renderer state.
unsigned getBorderX(EmuTime::param time)
Gets the X coordinate of a border detected by SRCH (intended behaviour, as documented in the V9938 te...
byte readColor(EmuTime::param time)
Use this method to transfer pixel(s) from VDP to CPU.
void stealAccessSlot(EmuTime::param time)
Steal a VRAM access slot from the CmdEngine.
VDPCmdEngine(VDP &vdp, CommandController &commandController)
void sync2(EmuTime::param time)
byte peekCmdReg(byte index) const
Read the content of a command register.
void sync(EmuTime::param time)
Synchronizes the command engine with the VDP.
void setCmdReg(byte index, byte value, EmuTime::param time)
Writes to a command register.
byte getStatus(EmuTime::param time)
Gets the command engine status (part of S#2).
Unified implementation of MSX Video Display Processors (VDPs).
VDPAccessSlots::Calculator getAccessSlotCalculator(EmuTime::param time, EmuTime::param limit) const
Same as getAccessSlot(), but it can be much faster for repeated calls, e.g.
EmuTime getAccessSlot(EmuTime::param time, VDPAccessSlots::Delta delta) const
Get the earliest access slot that is at least 'delta' cycles in the future.
This file implemented 3 utility functions:
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)