openMSX
|
#include <V9990CmdEngine.hh>
Public Member Functions | |
V9990CmdEngine (V9990 &vdp, EmuTime::param time, RenderSettings &settings) | |
Constructor. | |
~V9990CmdEngine () | |
void | reset (EmuTime::param time) |
Re-initialise the command engine's state. | |
void | sync (EmuTime::param time) |
Synchronizes the command engine with the V9990. | |
void | sync2 (EmuTime::param time) |
void | setCmdReg (byte reg, byte val, EmuTime::param time) |
Set a value to one of the command registers. | |
void | setCmdData (byte value, EmuTime::param time) |
set the data byte | |
byte | getCmdData (EmuTime::param time) |
read the command data byte | |
byte | peekCmdData (EmuTime::param time) const |
read the command data byte (without side-effects) | |
byte | getStatus (EmuTime::param time) const |
Get command engine related status bits. | |
word | getBorderX (EmuTime::param time) const |
EmuTime | estimateCmdEnd () const |
Calculate an (under-)estimation for when the command will finish. | |
const V9990 & | getVDP () const |
bool | getBrokenTiming () const |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Static Public Attributes | |
static constexpr byte | TR = 0x80 |
static constexpr byte | BD = 0x10 |
static constexpr byte | CE = 0x01 |
Command engine.
Definition at line 19 of file V9990CmdEngine.hh.
openmsx::V9990CmdEngine::V9990CmdEngine | ( | V9990 & | vdp, |
EmuTime::param | time, | ||
RenderSettings & | settings | ||
) |
Constructor.
Definition at line 706 of file V9990CmdEngine.cc.
References openmsx::Subject< T >::attach(), openmsx::RenderSettings::getCmdTimingSetting(), openmsx::MSXDevice::getCommandController(), openmsx::MSXDevice::getMotherBoard(), openmsx::MSXMotherBoard::getSharedStuff(), and reset().
openmsx::V9990CmdEngine::~V9990CmdEngine | ( | ) |
Definition at line 730 of file V9990CmdEngine.cc.
References openmsx::Subject< T >::detach(), and openmsx::RenderSettings::getCmdTimingSetting().
EmuTime openmsx::V9990CmdEngine::estimateCmdEnd | ( | ) | const |
Calculate an (under-)estimation for when the command will finish.
The main purpose of this function is to insert extra sync points so that the Command-End (CE) interrupt properly synchronizes with CPU emulation. This estimation:
Definition at line 1795 of file V9990CmdEngine.cc.
References UNREACHABLE, and openmsx::EmuDuration::zero().
|
inline |
Definition at line 71 of file V9990CmdEngine.hh.
References sync().
|
inline |
Definition at line 91 of file V9990CmdEngine.hh.
byte openmsx::V9990CmdEngine::getCmdData | ( | EmuTime::param | time | ) |
read the command data byte
Definition at line 1766 of file V9990CmdEngine.cc.
Referenced by openmsx::V9990::readIO().
|
inline |
Get command engine related status bits.
Definition at line 65 of file V9990CmdEngine.hh.
References sync().
Referenced by openmsx::V9990::peekIO().
|
inline |
Definition at line 90 of file V9990CmdEngine.hh.
byte openmsx::V9990CmdEngine::peekCmdData | ( | EmuTime::param | time | ) | const |
read the command data byte (without side-effects)
Definition at line 1782 of file V9990CmdEngine.cc.
Referenced by openmsx::V9990::peekIO().
void openmsx::V9990CmdEngine::reset | ( | EmuTime::param | time | ) |
Re-initialise the command engine's state.
time | Moment in emulated time the reset occurs |
Definition at line 735 of file V9990CmdEngine.cc.
Referenced by openmsx::V9990::reset(), and V9990CmdEngine().
void openmsx::V9990CmdEngine::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 1864 of file V9990CmdEngine.cc.
References openmsx::EmuDuration::serialize().
void openmsx::V9990CmdEngine::setCmdData | ( | byte | value, |
EmuTime::param | time | ||
) |
set the data byte
Definition at line 1759 of file V9990CmdEngine.cc.
References sync().
Referenced by openmsx::V9990::writeIO().
Set a value to one of the command registers.
Definition at line 743 of file V9990CmdEngine.cc.
References CE, sync(), and UNREACHABLE.
|
inline |
Synchronizes the command engine with the V9990.
time | The moment in emulated time to sync to. |
Definition at line 39 of file V9990CmdEngine.hh.
References sync2().
Referenced by getBorderX(), getCmdData(), getStatus(), peekCmdData(), openmsx::V9990::reset(), setCmdData(), setCmdReg(), and openmsx::V9990VRAM::sync().
void openmsx::V9990CmdEngine::sync2 | ( | EmuTime::param | time | ) |
|
staticconstexpr |
Definition at line 24 of file V9990CmdEngine.hh.
|
staticconstexpr |
Definition at line 25 of file V9990CmdEngine.hh.
Referenced by setCmdReg().
|
staticconstexpr |
Definition at line 23 of file V9990CmdEngine.hh.
Referenced by getCmdData(), and peekCmdData().