openMSX
|
VDP command engine by Alex Wulms. More...
#include <VDPCmdEngine.hh>
Public Member Functions | |
VDPCmdEngine (VDP &vdp, CommandController &commandController) | |
void | reset (EmuTime::param time) |
Reinitialise Renderer state. More... | |
void | sync (EmuTime::param time) |
Synchronises the command engine with the VDP. More... | |
void | sync2 (EmuTime::param time) |
void | stealAccessSlot (EmuTime::param time) |
Steal a VRAM access slot from the CmdEngine. More... | |
byte | getStatus (EmuTime::param time) |
Gets the command engine status (part of S#2). More... | |
byte | readColor (EmuTime::param time) |
Use this method to transfer pixel(s) from VDP to CPU. More... | |
void | resetColor () |
unsigned | getBorderX (EmuTime::param time) |
Gets the X coordinate of a border detected by SRCH (intended behaviour, as documented in the V9938 technical data book). More... | |
void | setCmdReg (byte index, byte value, EmuTime::param time) |
Writes to a command register. More... | |
byte | peekCmdReg (byte index) |
Read the content of a command register. More... | |
void | updateDisplayMode (DisplayMode mode, bool cmdBit, EmuTime::param time) |
Informs the command engine of a VDP display mode change. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Interface for logical operations. More... | |
VDP command engine by Alex Wulms.
Implements command execution unit of V9938/58.
Definition at line 22 of file VDPCmdEngine.hh.
openmsx::VDPCmdEngine::VDPCmdEngine | ( | VDP & | vdp, |
CommandController & | commandController | ||
) |
Definition at line 1740 of file VDPCmdEngine.cc.
|
inline |
Gets the X coordinate of a border detected by SRCH (intended behaviour, as documented in the V9938 technical data book).
However, real VDP simply returns the current value of the ASX 'temporary source X' counter, regardless of the command that is being executed or was executed most recently
time | The moment in emulated time this get occurs. |
Definition at line 90 of file VDPCmdEngine.hh.
References openmsx::VDPAccessSlots::DELTA_0, openmsx::VDP::getAccessSlot(), openmsx::VDP::getAccessSlotCalculator(), peekCmdReg(), serialize(), openmsx::SERIALIZE_CLASS_VERSION(), setCmdReg(), sync(), t, and updateDisplayMode().
|
inline |
Gets the command engine status (part of S#2).
Bit 7 (TR) is set when the command engine is ready for a pixel transfer. Bit 4 (BD) is set when the boundary color is detected. Bit 0 (CE) is set when a command is in progress.
Definition at line 59 of file VDPCmdEngine.hh.
References sync().
Read the content of a command register.
This method is meant to be used by the debugger, there is no strict guarantee that the returned value is the correct value at exactly this moment in time (IOW this method does not sync the complete CmdEngine)
index | The register [0..14] to read from. |
Definition at line 1849 of file VDPCmdEngine.cc.
References UNREACHABLE.
Referenced by getBorderX().
|
inline |
Use this method to transfer pixel(s) from VDP to CPU.
This method implements V9938 S#7.
time | The moment in emulated time this read occurs. |
Definition at line 71 of file VDPCmdEngine.hh.
References sync().
void openmsx::VDPCmdEngine::reset | ( | EmuTime::param | time | ) |
Reinitialise Renderer state.
time | The moment in time the reset occurs. |
Definition at line 1770 of file VDPCmdEngine.cc.
References openmsx::VDP::getCmdBit(), openmsx::VDP::getDisplayMode(), setCmdReg(), and updateDisplayMode().
|
inline |
Definition at line 75 of file VDPCmdEngine.hh.
void openmsx::VDPCmdEngine::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Interface for logical operations.
Definition at line 2596 of file VDPCmdEngine.cc.
Referenced by getBorderX().
Writes to a command register.
index | The register [0..14] to write to. |
value | The new value for the specified register. |
time | The moment in emulated time this write occurs. |
Definition at line 1781 of file VDPCmdEngine.cc.
References openmsx::TclCallback::execute(), sync(), and UNREACHABLE.
Referenced by getBorderX(), and reset().
|
inline |
Steal a VRAM access slot from the CmdEngine.
Used when the CPU reads/writes VRAM.
time | The moment in time the CPU read/write is performed. |
Definition at line 46 of file VDPCmdEngine.hh.
References openmsx::VDPAccessSlots::DELTA_1.
|
inline |
Synchronises the command engine with the VDP.
Ideally this would be a private method, but the current design doesn't allow that.
time | The moment in emulated time to sync to. |
Definition at line 37 of file VDPCmdEngine.hh.
References sync2().
Referenced by getBorderX(), getStatus(), readColor(), setCmdReg(), openmsx::VDPVRAM::updateDisplayEnabled(), updateDisplayMode(), and openmsx::VDPVRAM::updateSpritesEnabled().
void openmsx::VDPCmdEngine::sync2 | ( | EmuTime::param | time | ) |
Definition at line 2001 of file VDPCmdEngine.cc.
References openmsx::VDPVRAM::cmdReadWindow, openmsx::VDPVRAM::cmdWriteWindow, openmsx::VRAMWindow::disable(), and UNREACHABLE.
Referenced by sync().
void openmsx::VDPCmdEngine::updateDisplayMode | ( | DisplayMode | mode, |
bool | cmdBit, | ||
EmuTime::param | time | ||
) |
Informs the command engine of a VDP display mode change.
mode | The new display mode. |
cmdBit | Are VDP commands allowed in non-bitmap mode. |
time | The moment in emulated time this change occurs. |
Definition at line 1874 of file VDPCmdEngine.cc.
References openmsx::DisplayMode::getBase(), openmsx::BooleanSetting::getBoolean(), openmsx::DisplayMode::GRAPHIC4, openmsx::DisplayMode::GRAPHIC5, openmsx::DisplayMode::GRAPHIC6, openmsx::DisplayMode::GRAPHIC7, sync(), and UNREACHABLE.
Referenced by getBorderX(), reset(), and openmsx::VDPVRAM::updateDisplayMode().