openMSX
|
Implementation of the Yamaha V9990 VDP as used in the GFX9000 cartridge by Sunrise. More...
#include <V9990.hh>
Classes | |
struct | GetPaletteResult |
Get palette entry. More... | |
Public Member Functions | |
V9990 (const DeviceConfig &config) | |
~V9990 () 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... | |
PostProcessor * | getPostProcessor () const |
Used by Video9000 to be able to couple the VDP and V9990 output. More... | |
V9990VRAM & | getVRAM () |
Obtain a reference to the V9990's VRAM. More... | |
bool | isInterlaced () const |
Get interlace status. More... | |
bool | isEvenOddEnabled () const |
Get even/odd page alternation status. More... | |
bool | getEvenOdd () const |
Is the even or odd field being displayed? More... | |
bool | isDisplayEnabled () const |
Is the display enabled? Note this is simpler than the V99x8 version. More... | |
bool | spritesEnabled () const |
Are sprites (cursors) enabled? More... | |
byte | getPaletteOffset () const |
Get palette offset. More... | |
GetPaletteResult | getPalette (int index) const |
int | getUCTicksThisFrame (EmuTime::param time) const |
Get the number of elapsed UC ticks in this frame. More... | |
bool | isPalTiming () const |
Is PAL timing active? This setting is fixed at start of frame. More... | |
bool | isOverScan () const |
Returns true iff in overscan mode. More... | |
bool | isSuperimposing () const |
Should this frame be superimposed? This is a combination of bit 5 (YSE) in R#8 and the presence of an external video source (see setExternalVideoSource()). More... | |
void | setExternalVideoSource (bool enable) |
Is there an external video source available to superimpose on. More... | |
unsigned | getCursorYOffset () const |
In overscan mode the cursor position is still specified with 'normal' (non-overscan) y-coordinates. More... | |
V9990DisplayMode | getDisplayMode () const |
Return the current display mode. More... | |
V9990ColorMode | getColorMode () const |
Return the current color mode. More... | |
unsigned | getColorDepth () const |
Return the amount of bits per pixels. More... | |
byte | getBackDropColor () const |
Return the current back drop color. More... | |
unsigned | getScrollAX () const |
Returns the X scroll offset for screen A of P1 and other modes. More... | |
unsigned | getScrollAY () const |
Returns the Y scroll offset for screen A of P1 and other modes. More... | |
unsigned | getScrollBX () const |
Returns the X scroll offset for screen B of P1 mode. More... | |
unsigned | getScrollBY () const |
Returns the Y scroll offset for screen B of P1 mode. More... | |
unsigned | getRollMask (unsigned maxMask) const |
Returns the vertical roll mask. More... | |
unsigned | getImageWidth () const |
Return the image width. More... | |
unsigned | getLineWidth () const |
Return the display width. More... | |
void | cmdReady () |
Command execution ready. More... | |
int | getSpritePatternAddress (V9990DisplayMode m) const |
Return the sprite pattern table base address. More... | |
byte | getSpritePaletteOffset () const |
return sprite palette offset More... | |
const V9990DisplayPeriod & | getHorizontalTiming () const |
Get horizontal display timings. More... | |
int | getLeftBorder () const |
Get the number of VDP clock-ticks between the start of the line and the end of the left border. More... | |
int | getRightBorder () const |
Get the number of VDP clock-ticks between the start of the line and the end of the right border. More... | |
const V9990DisplayPeriod & | getVerticalTiming () const |
Get vertical display timings. More... | |
int | getTopBorder () const |
int | getBottomBorder () const |
unsigned | getPriorityControlX () const |
unsigned | getPriorityControlY () const |
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 |
CliComm & | 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 Member Functions | |
static int | UCtoX (int ticks, V9990DisplayMode mode) |
Convert UC ticks to V9990 pixel position on a line. More... | |
Additional Inherited Members | |
![]() | |
using | Devices = std::vector< MSXDevice * > |
![]() | |
static std::array< byte, 0x10000 > | unmappedRead |
static std::array< byte, 0x10000 > | unmappedWrite |
![]() | |
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 |
|
explicit |
|
override |
Definition at line 105 of file V9990.cc.
References openmsx::Display::detach().
|
inline |
|
inline |
|
inline |
Definition at line 342 of file V9990.hh.
References openmsx::V9990DisplayPeriod::display, and getTopBorder().
Referenced by peekIO().
|
inline |
V9990ColorMode openmsx::V9990::getColorMode | ( | ) | const |
Return the current color mode.
Definition at line 802 of file V9990.cc.
References getColorMode().
Referenced by getColorMode(), and openmsx::V9990PixelRenderer::reset().
|
inline |
In overscan mode the cursor position is still specified with 'normal' (non-overscan) y-coordinates.
This method returns the offset between those two coord-systems.
Definition at line 159 of file V9990.hh.
References openmsx::V9990DisplayTiming::displayNTSC_MCLK, openmsx::V9990DisplayTiming::displayPAL_MCLK, isOverScan(), and isPalTiming().
|
inline |
Return the current display mode.
Definition at line 195 of file V9990.hh.
Referenced by openmsx::V9990PixelRenderer::frameStart(), getLineWidth(), and openmsx::V9990PixelRenderer::reset().
|
inline |
Is the even or odd field being displayed?
Definition at line 76 of file V9990.hh.
Referenced by openmsx::V9990PixelRenderer::frameStart().
|
inline |
|
inline |
|
inline |
Get the number of VDP clock-ticks between the start of the line and the end of the left border.
Definition at line 321 of file V9990.hh.
References openmsx::V9990DisplayPeriod::blank, and openmsx::V9990DisplayPeriod::border1.
Referenced by getRightBorder(), and peekIO().
|
inline |
Return the display width.
Definition at line 273 of file V9990.hh.
References openmsx::B0, openmsx::B1, openmsx::B2, openmsx::B3, openmsx::B4, openmsx::B5, openmsx::B6, openmsx::B7, getDisplayMode(), openmsx::P1, openmsx::P2, and UNREACHABLE.
V9990::GetPaletteResult openmsx::V9990::getPalette | ( | int | index | ) | const |
Definition at line 685 of file V9990.cc.
References g, and isSuperimposing().
|
inline |
PostProcessor * openmsx::V9990::getPostProcessor | ( | ) | const |
|
inline |
|
inline |
|
inline |
Get the number of VDP clock-ticks between the start of the line and the end of the right border.
Definition at line 328 of file V9990.hh.
References openmsx::V9990DisplayPeriod::display, and getLeftBorder().
Referenced by peekIO().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
return sprite palette offset
Definition at line 308 of file V9990.hh.
Referenced by openmsx::CursorInfo::CursorInfo().
|
inline |
Return the sprite pattern table base address.
Definition at line 295 of file V9990.hh.
References openmsx::P1, and openmsx::P2.
|
inline |
Definition at line 338 of file V9990.hh.
References openmsx::V9990DisplayPeriod::blank, and openmsx::V9990DisplayPeriod::border1.
Referenced by openmsx::V9990PixelRenderer::frameStart(), getBottomBorder(), and peekIO().
|
inline |
Get the number of elapsed UC ticks in this frame.
time | Point in emulated time. |
Definition at line 122 of file V9990.hh.
References openmsx::Clock< FREQ_NUM, FREQ_DENOM >::getTicksTill_fast().
Referenced by peekIO().
|
inline |
|
inline |
|
inline |
Is the display enabled? Note this is simpler than the V99x8 version.
Probably ok because V9990 doesn't have the same overscan trick (?)
Definition at line 85 of file V9990.hh.
Referenced by openmsx::V9990PixelRenderer::reset().
|
inline |
Get even/odd page alternation status.
Definition at line 69 of file V9990.hh.
Referenced by openmsx::V9990PixelRenderer::frameEnd(), and openmsx::V9990PixelRenderer::frameStart().
|
inline |
Get interlace status.
Definition at line 62 of file V9990.hh.
Referenced by openmsx::CursorInfo::CursorInfo(), openmsx::V9990PixelRenderer::frameEnd(), and openmsx::V9990PixelRenderer::frameStart().
|
inline |
Returns true iff in overscan mode.
Definition at line 136 of file V9990.hh.
References openmsx::B0, openmsx::B2, and openmsx::B4.
Referenced by getCursorYOffset().
|
inline |
Is PAL timing active? This setting is fixed at start of frame.
Definition at line 130 of file V9990.hh.
Referenced by getCursorYOffset().
|
inline |
Should this frame be superimposed? This is a combination of bit 5 (YSE) in R#8 and the presence of an external video source (see setExternalVideoSource()).
Though because this property only changes once per frame we can't directly calculate it like that.
Definition at line 146 of file V9990.hh.
Referenced by getPalette().
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 222 of file V9990.cc.
References getBottomBorder(), getLeftBorder(), getRightBorder(), openmsx::V9990CmdEngine::getStatus(), getTopBorder(), getUCTicksThisFrame(), openmsx::V9990CmdEngine::peekCmdData(), and openmsx::V9990DisplayTiming::UC_TICKS_PER_LINE.
Referenced by readIO().
|
overridevirtual |
This method is called when MSX is powered up.
The default implementation calls reset(), this is usually ok.
time | The moment in time the power up occurs. |
Reimplemented from openmsx::MSXDevice.
Definition at line 119 of file V9990.cc.
References openmsx::V9990VRAM::clear(), and reset().
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 161 of file V9990.cc.
References openmsx::V9990CmdEngine::getCmdData(), peekIO(), and openmsx::V9990VRAM::readVRAMCPU().
|
overridevirtual |
This method is called on reset.
Default implementation does nothing.
Reimplemented from openmsx::MSXDevice.
Definition at line 125 of file V9990.cc.
References ranges::fill(), openmsx::V9990CmdEngine::reset(), openmsx::V9990CmdEngine::sync(), and writeIO().
Referenced by powerUp().
void openmsx::V9990::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 888 of file V9990.cc.
References openmsx::MSXDevice::getCurrentTime(), openmsx::V9990VRAM::readVRAMCPU(), and openmsx::Schedulable::restoreOld().
|
inline |
|
inline |
|
inlinestatic |
Convert UC ticks to V9990 pixel position on a line.
ticks | Nr of UC Ticks |
mode | Display mode |
Definition at line 174 of file V9990.hh.
References openmsx::B0, openmsx::B1, openmsx::B2, openmsx::B3, openmsx::B4, openmsx::B5, openmsx::B6, openmsx::B7, openmsx::P1, openmsx::P2, and openmsx::V9990DisplayTiming::UC_TICKS_PER_LINE.
Referenced by openmsx::V9990SDLRasterizer< Pixel >::drawBorder(), and openmsx::V9990SDLRasterizer< Pixel >::drawDisplay().
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 275 of file V9990.cc.
References openmsx::IntHelper< SOURCE >::reset(), openmsx::V9990CmdEngine::setCmdData(), writeIO(), openmsx::V9990VRAM::writeVRAMCPU(), and xrange().