openMSX
|
Unified implementation of MSX Video Display Processors (VDPs). More...
#include <VDP.hh>
Classes | |
struct | BlinkStateCount |
Calculates what 'blinkState' and 'blinkCount' would be at a specific line. More... | |
Public Types | |
using | VDPClock = Clock< TICKS_PER_SECOND > |
![]() | |
using | Devices = std::vector< MSXDevice * > |
Public Member Functions | |
VDP (const DeviceConfig &config) | |
~VDP () override | |
void | powerUp (EmuTime::param time) override |
This method is called when MSX is powered up. More... | |
void | reset (EmuTime::param time) override |
This method is called on reset. More... | |
byte | readIO (word port, EmuTime::param time) override |
Read a byte from an IO port at a certain time from this device. More... | |
byte | peekIO (word port, EmuTime::param time) const override |
Read a byte from a given IO port. More... | |
void | writeIO (word port, byte value, EmuTime::param time) override |
Write a byte to a given IO port at a certain time to this device. More... | |
void | getExtraDeviceInfo (TclObject &result) const override |
PostProcessor * | getPostProcessor () const |
Used by Video9000 to be able to couple the VDP and V9990 output. More... | |
bool | isMSX1VDP () const |
Is this an MSX1 VDP? More... | |
bool | isVDPwithPALonly () const |
Is this a VDP only capable of PAL? More... | |
bool | vdpLacksMirroring () const |
Is this a VDP that lacks mirroring? More... | |
bool | vdpHasPatColMirroring () const |
Is this a VDP that has pattern/color table mirroring? More... | |
bool | isVDPwithVRAMremapping () const |
Does this VDP have VRAM remapping when switching from 4k to 8/16k mode? More... | |
bool | hasYJK () const |
Does this VDP support YJK display? More... | |
std::array< std::array< uint8_t, 3 >, 16 > | getMSX1Palette () const |
Get the (fixed) palette for this MSX1 VDP. More... | |
DisplayMode | getDisplayMode () const |
Get the display mode the VDP is in. More... | |
VDPVRAM & | getVRAM () |
Get the VRAM object for this VDP. More... | |
const RawFrame * | isSuperimposing () const |
Are we currently superimposing? In case of superimpose, returns a pointer to the to-be-superimposed frame. More... | |
SpriteChecker & | getSpriteChecker () |
Get the sprite checker for this VDP. More... | |
bool | getTransparency () const |
Gets the current transparency setting. More... | |
bool | canSpriteColor0Collide () const |
Can a sprite which has color=0 collide with some other sprite? More... | |
int | getForegroundColor () const |
Gets the current foreground color. More... | |
byte | getBackgroundColor () const |
Gets the current background color. More... | |
int | getBlinkForegroundColor () const |
Gets the current blinking color for blinking text. More... | |
int | getBlinkBackgroundColor () const |
Gets the current blinking color for blinking text. More... | |
bool | getBlinkState () const |
Gets the current blink state. More... | |
word | getPalette (unsigned index) const |
Gets a palette entry. More... | |
bool | isDisplayEnabled () const |
Is the display enabled? Both the regular border and forced blanking by clearing the display enable bit are considered disabled display. More... | |
bool | spritesEnabled () const |
Are sprites enabled? More... | |
bool | spritesEnabledFast () const |
Same as spritesEnabled(), but may only be called in sprite mode 1 or 2. More... | |
bool | spritesEnabledRegister () const |
Still faster variant (just looks at the sprite-enabled-bit). More... | |
byte | getVerticalScroll () const |
Gets the current vertical scroll (line displayed at Y=0). More... | |
byte | getHorizontalScrollLow () const |
Gets the current horizontal scroll lower bits. More... | |
byte | getHorizontalScrollHigh () const |
Gets the current horizontal scroll higher bits. More... | |
bool | isBorderMasked () const |
Gets the current border mask setting. More... | |
bool | isMultiPageScrolling () const |
Is multi page scrolling enabled? It is considered enabled if both the multi page scrolling flag is enabled and the current page is odd. More... | |
int | getLineZero () const |
Get the absolute line number of display line zero. More... | |
bool | isPalTiming () const |
Is PAL timing active? This setting is fixed at start of frame. More... | |
bool | isInterlaced () const |
Get interlace status. More... | |
bool | isFastBlinkEnabled () const |
Get 'fast-blink' status. More... | |
bool | isEvenOddEnabled () const |
Get even/odd page alternation status. More... | |
bool | getEvenOdd () const |
Is the even or odd field being displayed? More... | |
unsigned | getEvenOddMask () const |
Expresses the state of even/odd page interchange in a mask on the line number. More... | |
unsigned | getEvenOddMask (int line) const |
Similar to the above getEvenOddMask() method, but can also be called when 'isFastBlinkEnabled() == true'. More... | |
BlinkStateCount | calculateLineBlinkState (unsigned line) const |
int | getTicksThisFrame (EmuTime::param time) const |
Gets the number of VDP clock ticks (21MHz) elapsed between a given time and the start of this frame. More... | |
EmuTime::param | getFrameStartTime () const |
int | getSpriteSize () const |
Gets the sprite size in pixels (8/16). More... | |
bool | isSpriteMag () const |
Are sprites magnified? More... | |
bool | getCmdBit () const |
Are commands possible in non Graphic modes? (V9958 only) More... | |
int | getLinesPerFrame () const |
Gets the number of lines per frame. More... | |
int | getTicksPerFrame () const |
Gets the number of VDP clock ticks (21MHz) per frame. More... | |
bool | isInsideFrame (EmuTime::param time) const |
Is the given timestamp inside the current frame? Mainly useful for debugging, because relevant timestamps should always be inside the current frame. More... | |
int | getHorizontalAdjust () const |
This is a combination of the (horizontal) set adjust register and the YJK-mode bit. More... | |
int | getLeftSprites () const |
Gets the number of VDP clock ticks between start of line and the start of the sprite plane. More... | |
int | getLeftBorder () const |
Gets the number of VDP clock ticks between start of line and the end of the left border. More... | |
int | getRightBorder () const |
Gets the number of VDP clock ticks between start of line and the start of the right border. More... | |
int | getLeftBackground () const |
Gets the number of VDP clock ticks between start of line and the time when the background pixel with X coordinate 0 would be drawn. More... | |
byte | getStatusReg0 () const |
Should only be used by SpriteChecker. More... | |
void | setSpriteStatus (byte value) |
Should only be used by SpriteChecker. More... | |
bool | getVRMode () const |
Returns current VR mode. More... | |
void | setExternalVideoSource (const RawFrame *externalSource) |
Enable superimposing. More... | |
bool | getBrokenCmdTiming () const |
Value of the cmdTiming setting, true means commands have infinite speed. More... | |
EmuTime | getAccessSlot (EmuTime::param time, VDPAccessSlots::Delta delta) const |
Get the earliest access slot that is at least 'delta' cycles in the future. More... | |
VDPAccessSlots::Calculator | getAccessSlotCalculator (EmuTime::param time, EmuTime::param limit) const |
Same as getAccessSlot(), but it can be much faster for repeated calls, e.g. More... | |
void | scheduleCmdSync (EmuTime t) |
Only used when there are commandExecuting-probe listeners. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
![]() | |
MSXDevice (const MSXDevice &)=delete | |
MSXDevice & | operator= (const MSXDevice &)=delete |
virtual | ~MSXDevice ()=0 |
const HardwareConfig & | getHardwareConfig () const |
Returns the hardwareconfig this device belongs to. More... | |
void | testRemove (std::span< const std::unique_ptr< MSXDevice > > removed) const |
Checks whether this device can be removed (no other device has a reference to it). More... | |
virtual void | reset (EmuTime::param time) |
This method is called on reset. More... | |
virtual byte | readIRQVector () |
Gets IRQ vector used in IM2. More... | |
virtual void | powerDown (EmuTime::param time) |
This method is called when MSX is powered down. More... | |
virtual void | powerUp (EmuTime::param time) |
This method is called when MSX is powered up. More... | |
virtual const std::string & | getName () const |
Returns a human-readable name for this device. More... | |
virtual void | getNameList (TclObject &result) const |
Returns list of name(s) of this device. More... | |
void | getDeviceInfo (TclObject &result) const |
Get device info. More... | |
void | getVisibleMemRegion (unsigned &base, unsigned &size) const |
Returns the range where this device is visible in memory. More... | |
virtual byte | readIO (word port, EmuTime::param time) |
Read a byte from an IO port at a certain time from this device. More... | |
virtual void | writeIO (word port, byte value, EmuTime::param time) |
Write a byte to a given IO port at a certain time to this device. More... | |
virtual byte | peekIO (word port, EmuTime::param time) const |
Read a byte from a given IO port. More... | |
virtual byte | readMem (word address, EmuTime::param time) |
Read a byte from a location at a certain time from this device. More... | |
virtual void | writeMem (word address, byte value, EmuTime::param time) |
Write a given byte to a given location at a certain time to this device. More... | |
virtual const byte * | getReadCacheLine (word start) const |
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading. More... | |
virtual byte * | getWriteCacheLine (word start) const |
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing. More... | |
virtual byte | peekMem (word address, EmuTime::param time) const |
Read a byte from a given memory location. More... | |
virtual void | globalWrite (word address, byte value, EmuTime::param time) |
Global writes. More... | |
virtual void | globalRead (word address, EmuTime::param time) |
Global reads. More... | |
void | invalidateDeviceRWCache () |
Calls MSXCPUInterface::invalidateXXCache() for the specific (part of) the slot that this device is located in. More... | |
void | invalidateDeviceRCache () |
void | invalidateDeviceWCache () |
void | invalidateDeviceRWCache (unsigned start, unsigned size) |
void | invalidateDeviceRCache (unsigned start, unsigned size) |
void | invalidateDeviceWCache (unsigned start, unsigned size) |
void | fillDeviceRWCache (unsigned start, unsigned size, byte *rwData) |
Calls MSXCPUInterface::fillXXCache() for the specific (part of) the slot that this device is located in. More... | |
void | fillDeviceRWCache (unsigned start, unsigned size, const byte *rData, byte *wData) |
void | fillDeviceRCache (unsigned start, unsigned size, const byte *rData) |
void | fillDeviceWCache (unsigned start, unsigned size, byte *wData) |
MSXMotherBoard & | getMotherBoard () const |
Get the mother board this device belongs to. More... | |
const XMLElement & | getDeviceConfig () const |
Get the configuration section for this device. More... | |
const DeviceConfig & | getDeviceConfig2 () const |
const Devices & | getReferences () const |
Get the device references that are specified for this device. More... | |
EmuTime::param | getCurrentTime () const |
MSXCPU & | getCPU () const |
MSXCPUInterface & | getCPUInterface () const |
Scheduler & | getScheduler () const |
MSXCliComm & | getCliComm () const |
Reactor & | getReactor () const |
CommandController & | getCommandController () const |
PluggingController & | getPluggingController () const |
LedStatus & | getLedStatus () const |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Static Public Attributes | |
static constexpr int | TICKS_PER_SECOND = 3579545 * 6 |
Number of VDP clock ticks per second. More... | |
static constexpr int | TICKS_PER_LINE = 1368 |
Number of VDP clock ticks per line. More... | |
![]() | |
static std::array< byte, 0x10000 > | unmappedRead |
static std::array< byte, 0x10000 > | unmappedWrite |
Additional Inherited Members | |
![]() | |
MSXDevice (const DeviceConfig &config, std::string_view name) | |
Every MSXDevice has a config entry; this constructor gets some device properties from that config entry. More... | |
MSXDevice (const DeviceConfig &config) | |
virtual void | init () |
virtual unsigned | getBaseSizeAlignment () const |
The 'base' and 'size' attribute values need to be at least aligned to CacheLine::SIZE. More... | |
virtual bool | allowUnaligned () const |
By default we don't allow unaligned <mem> specifications in the config file. More... | |
virtual void | getExtraDeviceInfo (TclObject &result) const |
byte | getPrimarySlot () const |
![]() | |
std::string | deviceName |
Unified implementation of MSX Video Display Processors (VDPs).
MSX1 VDP is Texas Instruments TMS9918A or TMS9928A. MSX2 VDP is Yamaha V9938. MSX2+ and turbo R VDP is Yamaha V9958.
Current implementation is written by Maarten ter Huurne, with some contributions from other openMSX developers. The first implementation was based on Sean Young's code from MESS, which was in turn based on code by Mike Balfour. Integration of MESS code into openMSX was done by David Heremans.
All undocumented features as described in the following file should be emulated: http://www.msxnet.org/tech/tms9918a.txt
This class is the VDP core, it uses a separate Renderer to convert the VRAM contents into pixels on the host machine. Communicates with the Renderer through a pull variant of the Observer pattern: a VDP object fires events when its state changes, the Renderer can retrieve the new state if necessary by calling methods on the VDP object.
A note about timing: the start of a frame or line is defined as the starting time of the corresponding sync (vsync, hsync).
using openmsx::VDP::VDPClock = Clock<TICKS_PER_SECOND> |
|
explicit |
Definition at line 62 of file VDP.cc.
References openmsx::Subject< T >::attach(), openmsx::Display::attach(), openmsx::DeviceConfig::findChild(), openmsx::DeviceConfig::getChildData(), openmsx::DeviceConfig::getChildDataAsInt(), openmsx::MSXDevice::getCommandController(), openmsx::MSXDevice::getCurrentTime(), openmsx::Display::getRenderSettings(), isMSX1VDP(), and powerUp().
|
override |
Definition at line 211 of file VDP.cc.
References openmsx::Subject< T >::detach(), and openmsx::Display::detach().
|
inline |
Definition at line 430 of file VDP.hh.
References isFastBlinkEnabled(), and std::swap().
Referenced by getEvenOddMask().
|
inline |
Can a sprite which has color=0 collide with some other sprite?
Definition at line 183 of file VDP.hh.
References getTransparency(), and isMSX1VDP().
EmuTime openmsx::VDP::getAccessSlot | ( | EmuTime::param | time, |
VDPAccessSlots::Delta | delta | ||
) | const |
Get the earliest access slot that is at least 'delta' cycles in the future.
Definition at line 876 of file VDP.cc.
References openmsx::VDPAccessSlots::getAccessSlot(), and getFrameStartTime().
VDPAccessSlots::Calculator openmsx::VDP::getAccessSlotCalculator | ( | EmuTime::param | time, |
EmuTime::param | limit | ||
) | const |
Same as getAccessSlot(), but it can be much faster for repeated calls, e.g.
in the implementation of VDP commands. However it does have some limitations:
Definition at line 882 of file VDP.cc.
References openmsx::VDPAccessSlots::getCalculator(), and getFrameStartTime().
|
inline |
Gets the current background color.
Definition at line 207 of file VDP.hh.
References openmsx::DisplayMode::getByte(), and openmsx::DisplayMode::GRAPHIC7.
Referenced by openmsx::PixelRenderer::updatePalette().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Are commands possible in non Graphic modes? (V9958 only)
Definition at line 492 of file VDP.hh.
Referenced by openmsx::VDPCmdEngine::reset().
|
inline |
Get the display mode the VDP is in.
Definition at line 144 of file VDP.hh.
Referenced by openmsx::VDPCmdEngine::reset(), openmsx::SpriteChecker::serialize(), openmsx::PixelRenderer::updateDisplayMode(), and openmsx::PixelRenderer::updatePalette().
|
inline |
Is the even or odd field being displayed?
Definition at line 384 of file VDP.hh.
Referenced by openmsx::PixelRenderer::frameStart().
|
inline |
Expresses the state of even/odd page interchange in a mask on the line number.
If even/odd interchange is active, for some frames lines 256..511 (page 1) are replaced by 0..255 (page 0) and 768..1023 (page 3, if applicable) by 512..767 (page 2). Together with the interlace setting this can be used to create an interlaced display. Even/odd interchange can also happen because of the 'blink' feature in bitmap modes.
Definition at line 399 of file VDP.hh.
References isFastBlinkEnabled().
Referenced by getEvenOddMask().
|
inline |
Similar to the above getEvenOddMask() method, but can also be called when 'isFastBlinkEnabled() == true'.
In the latter case the timing is based on lines instead of frames. This means the result is no longer fixed per frame, and thus this method takes an additional line parameter.
Definition at line 412 of file VDP.hh.
References calculateLineBlinkState(), getEvenOddMask(), and isFastBlinkEnabled().
|
overridevirtual |
Reimplemented from openmsx::MSXDevice.
Definition at line 737 of file VDP.cc.
References openmsx::TclObject::addDictKeyValues(), openmsx::XMLElement::findChild(), and openmsx::MSXDevice::getDeviceConfig().
|
inline |
|
inline |
Definition at line 473 of file VDP.hh.
References openmsx::Clock< FREQ_NUM, FREQ_DENOM >::getTime().
Referenced by getAccessSlot(), getAccessSlotCalculator(), and openmsx::SpriteChecker::serialize().
|
inline |
|
inline |
|
inline |
Gets the current horizontal scroll lower bits.
Rather than actually scrolling the screen, this setting shifts the screen 0..7 bytes to the right.
Definition at line 292 of file VDP.hh.
Referenced by getLeftBackground().
|
inline |
Gets the number of VDP clock ticks between start of line and the time when the background pixel with X coordinate 0 would be drawn.
This includes extra pixels of horizontal scroll low, but disregards border mask.
Definition at line 564 of file VDP.hh.
References getHorizontalScrollLow(), and getLeftSprites().
|
inline |
Gets the number of VDP clock ticks between start of line and the end of the left border.
Does not include extra pixels of horizontal scroll low, since those are not actually border pixels (sprites appear in front of them).
Definition at line 547 of file VDP.hh.
References getLeftSprites(), and isBorderMasked().
|
inline |
Gets the number of VDP clock ticks between start of line and the start of the sprite plane.
The location of the sprite plane is not influenced by horizontal scroll or border mask. TODO: Leave out the text mode case, since there are no sprites in text mode?
Definition at line 536 of file VDP.hh.
References openmsx::DisplayMode::isTextMode().
Referenced by getLeftBackground(), getLeftBorder(), and getRightBorder().
|
inline |
Gets the number of lines per frame.
Definition at line 498 of file VDP.hh.
Referenced by getTicksPerFrame().
|
inline |
Get the absolute line number of display line zero.
Usually this is equal to the height of the top border, but not so during overscan.
Definition at line 328 of file VDP.hh.
References TICKS_PER_LINE.
std::array< std::array< uint8_t, 3 >, 16 > openmsx::VDP::getMSX1Palette | ( | ) | const |
Get the (fixed) palette for this MSX1 VDP.
Don't use this if it's not an MSX1 VDP!
Definition at line 1533 of file VDP.cc.
References openmsx::B, Math::clipIntToByte(), openmsx::MSXDevice::getDeviceConfig(), isMSX1VDP(), and xrange().
|
inline |
PostProcessor * openmsx::VDP::getPostProcessor | ( | ) | const |
|
inline |
Gets the number of VDP clock ticks between start of line and the start of the right border.
Definition at line 554 of file VDP.hh.
References getLeftSprites(), and openmsx::DisplayMode::isTextMode().
|
inline |
|
inline |
|
inline |
Should only be used by SpriteChecker.
Returns the current value of status register 0 (both the F-flag and the sprite related bits).
Definition at line 571 of file VDP.hh.
Referenced by openmsx::SpriteChecker::resetStatus().
|
inline |
Gets the number of VDP clock ticks (21MHz) per frame.
Definition at line 504 of file VDP.hh.
References getLinesPerFrame(), and TICKS_PER_LINE.
Referenced by isInsideFrame().
|
inline |
Gets the number of VDP clock ticks (21MHz) elapsed between a given time and the start of this frame.
Definition at line 469 of file VDP.hh.
References openmsx::Clock< FREQ_NUM, FREQ_DENOM >::getTicksTill_fast().
Referenced by isInsideFrame().
|
inline |
Gets the current transparency setting.
Definition at line 177 of file VDP.hh.
Referenced by canSpriteColor0Collide().
|
inline |
|
inline |
|
inline |
Returns current VR mode.
false -> VR=0, true -> VR=1
Definition at line 589 of file VDP.hh.
Referenced by openmsx::VDPVRAM::serialize().
|
inline |
|
inline |
Gets the current border mask setting.
Border mask extends the left border by 8 pixels if enabled. This is a V9958 feature, on older VDPs it always returns false.
Definition at line 310 of file VDP.hh.
Referenced by getLeftBorder().
|
inline |
Is the display enabled? Both the regular border and forced blanking by clearing the display enable bit are considered disabled display.
Definition at line 251 of file VDP.hh.
Referenced by openmsx::PixelRenderer::reInit().
|
inline |
Get even/odd page alternation status.
Interlace means the odd fields are displayed half a line lower than the even fields. Together with even/odd page alternation this can be used to create an interlaced display. This setting is NOT fixed at start of frame. TODO: Find out how real VDP does it. If it fixes it at start of frame, so should we. If it handles it dynamically (my guess), then an update method should be added on the Renderer interface.
Definition at line 376 of file VDP.hh.
References isFastBlinkEnabled().
Referenced by openmsx::PixelRenderer::frameEnd(), and openmsx::PixelRenderer::frameStart().
|
inline |
Get 'fast-blink' status.
Normally blinking timing (alternating between pages) is based on frames. Though the V99x8 has an undocumented feature which changes this timing to lines. Sometimes this is called the "Cadari" feature after Luciano Cadari who discovered it.
See ticket#1091: "Support for undocumented V99x8 register 1 bit 2" https://github.com/openMSX/openMSX/issues/1091 for test cases and links to more information.
Definition at line 361 of file VDP.hh.
Referenced by calculateLineBlinkState(), getEvenOddMask(), and isEvenOddEnabled().
|
inline |
Is the given timestamp inside the current frame? Mainly useful for debugging, because relevant timestamps should always be inside the current frame.
The end time of a frame is still considered inside, to support the case when the given timestamp is exclusive itself: a typically "limit" variable.
time | Timestamp to check. |
Definition at line 517 of file VDP.hh.
References getTicksPerFrame(), getTicksThisFrame(), and openmsx::Clock< FREQ_NUM, FREQ_DENOM >::getTime().
Referenced by openmsx::VDPVRAM::cmdWrite(), openmsx::VDPVRAM::cpuRead(), openmsx::VDPVRAM::cpuWrite(), readIO(), openmsx::VDPVRAM::sync(), openmsx::VDPVRAM::updateDisplayEnabled(), openmsx::VDPVRAM::updateDisplayMode(), openmsx::VDPVRAM::updateSpritesEnabled(), and writeIO().
|
inline |
Get interlace status.
Interlace means the odd fields are displayed half a line lower than the even fields. Together with even/odd page alternation this can be used to create an interlaced display. This setting is fixed at start of frame.
Definition at line 347 of file VDP.hh.
Referenced by openmsx::PixelRenderer::frameEnd(), and openmsx::PixelRenderer::frameStart().
|
inline |
Is this an MSX1 VDP?
Definition at line 96 of file VDP.hh.
Referenced by canSpriteColor0Collide(), getMSX1Palette(), readIO(), openmsx::SDLRasterizer< Pixel >::SDLRasterizer(), spritesEnabled(), spritesEnabledFast(), VDP(), and writeIO().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Read a byte from a given IO port.
Reading via this method has no side effects (doesn't change the device status). If safe reading is not possible this method returns 0xFF. This method is not used by the emulation. It can however be used by a debugger. The default implementation just returns 0xFF.
Reimplemented from openmsx::MSXDevice.
Definition at line 991 of file VDP.cc.
Referenced by openmsx::MSXMatsushita::peekIO().
|
overridevirtual |
Read a byte from an IO port at a certain time from this device.
The default implementation returns 255.
Reimplemented from openmsx::MSXDevice.
Definition at line 971 of file VDP.cc.
References isInsideFrame(), isMSX1VDP(), and UNREACHABLE.
Referenced by openmsx::MSXMatsushita::readIO().
|
overridevirtual |
This method is called on reset.
Default implementation does nothing.
Reimplemented from openmsx::MSXDevice.
Definition at line 315 of file VDP.cc.
Referenced by powerUp().
|
inline |
Only used when there are commandExecuting-probe listeners.
Call to announce a (lower-bound) estimate for when the VDP command will finish executing. In response the VDP will schedule a synchronization point to sync with VDPCmdEngine emulation.
Normally it's not required to pro-actively sync with the end of a VDP command. Instead these sync happen reactively on VDP status reads (e.g. polling the CE bit) or on VRAM reads (rendering or CPU VRAM read). This is in contrast with the V9990 where we DO need an active sync because the V9990 can generate an IRQ on command end.
Though when the VDP.commandExecuting probe is in use we do want a reasonably timing accurate reaction of that probe. So (only) then we do add the extra syncs (thus with extra emulation overhead when you use that probe).
Definition at line 638 of file VDP.hh.
References openmsx::Clock< TICKS_PER_SECOND >::duration(), openmsx::MSXDevice::getCurrentTime(), and t.
void openmsx::VDP::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 1903 of file VDP.cc.
References openmsx::DisplayMode::getByte(), openmsx::Schedulable::restoreOld(), and openmsx::DisplayMode::setByte().
|
inline |
|
inline |
Should only be used by SpriteChecker.
Change the sprite related bits of status register 0 (leaves the F-flag unchanged). Bit 6 (5S) is set when more than 4 (sprite mode 1) or 8 (sprite mode 2) sprites occur on the same line. Bit 5 (C) is set when sprites collide. Bit 4..0 (5th sprite number) contains the number of the first sprite to exceed the limit per line.
Definition at line 581 of file VDP.hh.
Referenced by openmsx::SpriteChecker::reset(), and openmsx::SpriteChecker::resetStatus().
|
inline |
Are sprites enabled?
Definition at line 259 of file VDP.hh.
References openmsx::DisplayMode::getSpriteMode(), and isMSX1VDP().
|
inline |
Same as spritesEnabled(), but may only be called in sprite mode 1 or 2.
Is a tiny bit faster.
Definition at line 268 of file VDP.hh.
References openmsx::DisplayMode::getSpriteMode(), and isMSX1VDP().
|
inline |
|
inline |
|
inline |
Write a byte to a given IO port at a certain time to this device.
The default implementation ignores the write (does nothing)
Reimplemented from openmsx::MSXDevice.
Definition at line 647 of file VDP.cc.
References isInsideFrame(), isMSX1VDP(), and openmsx::MSXCPU::waitCyclesZ80().
Referenced by openmsx::MSXMatsushita::writeIO().
|
staticconstexpr |
Number of VDP clock ticks per line.
Definition at line 73 of file VDP.hh.
Referenced by openmsx::SpriteChecker::checkUntil(), openmsx::SDLRasterizer< Pixel >::drawBorder(), getLineZero(), getTicksPerFrame(), and openmsx::SpriteChecker::updateDisplayMode().
|
staticconstexpr |