openMSX
|
Manages VRAM contents and synchronizes the various users of the VRAM. More...
#include <VDPVRAM.hh>
Public Member Functions | |
VDPVRAM (const VDPVRAM &)=delete | |
VDPVRAM (VDPVRAM &&)=delete | |
VDPVRAM & | operator= (const VDPVRAM &)=delete |
VDPVRAM & | operator= (VDPVRAM &&)=delete |
VDPVRAM (VDP &vdp, unsigned size, EmuTime::param time) | |
void | clear () |
Initialize VRAM content to power-up state. | |
void | sync (EmuTime::param time) |
Update VRAM state to specified moment in time. | |
void | cmdWrite (unsigned address, byte value, EmuTime::param time) |
Write a byte from the command engine. | |
void | cpuWrite (unsigned address, byte value, EmuTime::param time) |
Write a byte to VRAM through the CPU interface. | |
byte | cpuRead (unsigned address, EmuTime::param time) |
Read a byte from VRAM though the CPU interface. | |
void | updateDisplayMode (DisplayMode mode, bool cmdBit, EmuTime::param time) |
Used by the VDP to signal display mode changes. | |
void | updateDisplayEnabled (bool enabled, EmuTime::param time) |
Used by the VDP to signal display enabled changes. | |
void | updateSpritesEnabled (bool enabled, EmuTime::param time) |
Used by the VDP to signal sprites enabled changes. | |
void | updateVRMode (bool mode, EmuTime::param time) |
Change between VR=0 and VR=1 mode. | |
void | setRenderer (Renderer *renderer, EmuTime::param time) |
unsigned | getSize () const |
Returns the size of VRAM in bytes. | |
void | setSpriteChecker (SpriteChecker *newSpriteChecker) |
Necessary because of circular dependencies. | |
void | setCmdEngine (VDPCmdEngine *newCmdEngine) |
Necessary because of circular dependencies. | |
void | change4k8kMapping (bool mapping8k) |
TMS99x8 VRAM can be mapped in two ways. | |
std::span< const uint8_t > | getData () const |
Only used by debugger. | |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Manages VRAM contents and synchronizes the various users of the VRAM.
VDPVRAM does not apply planar remapping to addresses, this is the responsibility of the caller.
Definition at line 398 of file VDPVRAM.hh.
|
delete |
|
delete |
openmsx::VDPVRAM::VDPVRAM | ( | VDP & | vdp, |
unsigned | size, | ||
EmuTime::param | time | ||
) |
Definition at line 103 of file VDPVRAM.cc.
References bitmapCacheWindow, and openmsx::VRAMWindow::setMask().
void openmsx::VDPVRAM::change4k8kMapping | ( | bool | mapping8k | ) |
TMS99x8 VRAM can be mapped in two ways.
See implementation for more details.
Definition at line 231 of file VDPVRAM.cc.
References openmsx::Ram::begin(), ranges::copy(), and openmsx::Ram::end().
void openmsx::VDPVRAM::clear | ( | ) |
Initialize VRAM content to power-up state.
Definition at line 128 of file VDPVRAM.cc.
References openmsx::Ram::clear(), ranges::fill(), openmsx::Ram::size(), and subspan().
|
inline |
Write a byte from the command engine.
Synchronisation with reads by the command engine is skipped. TODO: Replace by "cmdSync ; VRAMWindow::write". Note: "cmdSync", because it checks against read windows, unlike the other sync which checks against the cmd write window.
Definition at line 427 of file VDPVRAM.hh.
References openmsx::VDP::isInsideFrame().
Referenced by openmsx::ImpOp::operator()(), openmsx::AndOp::operator()(), openmsx::NotOp::operator()(), openmsx::OrOp::operator()(), and openmsx::XorOp::operator()().
|
inline |
Read a byte from VRAM though the CPU interface.
address | The address to read. |
time | The moment in emulated time this read occurs. |
Definition at line 488 of file VDPVRAM.hh.
References cmdWriteWindow, openmsx::VRAMWindow::isInside(), openmsx::VDP::isInsideFrame(), openmsx::VDPCmdEngine::stealAccessSlot(), and openmsx::VDPCmdEngine::sync().
Referenced by openmsx::ADVram::readMem().
|
inline |
Write a byte to VRAM through the CPU interface.
address | The address to write. |
value | The value to write. |
time | The moment in emulated time this write occurs. |
Definition at line 452 of file VDPVRAM.hh.
References cmdReadWindow, cmdWriteWindow, openmsx::VRAMWindow::isInside(), openmsx::VDP::isInsideFrame(), openmsx::VDPCmdEngine::stealAccessSlot(), and openmsx::VDPCmdEngine::sync().
Referenced by openmsx::ADVram::writeMem().
|
inline |
Only used by debugger.
Definition at line 564 of file VDPVRAM.hh.
References openmsx::Ram::data(), and openmsx::Ram::size().
|
inline |
Returns the size of VRAM in bytes.
Definition at line 541 of file VDPVRAM.hh.
void openmsx::VDPVRAM::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 314 of file VDPVRAM.cc.
References bitmapCacheWindow, bitmapVisibleWindow, cmdReadWindow, cmdWriteWindow, colorTable, openmsx::Ram::data(), openmsx::VDP::getVRMode(), nameTable, patternTable, spriteAttribTable, and spritePatternTable.
|
inline |
Necessary because of circular dependencies.
Definition at line 553 of file VDPVRAM.hh.
void openmsx::VDPVRAM::setRenderer | ( | Renderer * | renderer, |
EmuTime::param | time | ||
) |
Definition at line 218 of file VDPVRAM.cc.
References bitmapVisibleWindow, openmsx::VRAMWindow::resetObserver(), openmsx::VRAMWindow::setMask(), and openmsx::VRAMWindow::setObserver().
|
inline |
Necessary because of circular dependencies.
Definition at line 547 of file VDPVRAM.hh.
|
inline |
Update VRAM state to specified moment in time.
time | Moment in emulated time to update VRAM to. TODO: Replace this method by VRAMWindow::sync(). |
Definition at line 416 of file VDPVRAM.hh.
References openmsx::VDP::isInsideFrame(), and openmsx::VDPCmdEngine::sync().
Referenced by openmsx::SpriteChecker::sync().
void openmsx::VDPVRAM::updateDisplayEnabled | ( | bool | enabled, |
EmuTime::param | time | ||
) |
Used by the VDP to signal display enabled changes.
Both the regular border start/end and forced blanking by clearing the display enable bit are considered display enabled changes.
enabled | The new display enabled state. |
time | The moment in emulated time this change occurs. |
Definition at line 149 of file VDPVRAM.cc.
References openmsx::VDP::isInsideFrame(), openmsx::VDPCmdEngine::sync(), openmsx::SpriteChecker::updateDisplayEnabled(), and openmsx::Renderer::updateDisplayEnabled().
void openmsx::VDPVRAM::updateDisplayMode | ( | DisplayMode | mode, |
bool | cmdBit, | ||
EmuTime::param | time | ||
) |
Used by the VDP to signal display mode changes.
VDPVRAM will inform the Renderer, command engine and the sprite checker of this change. TODO: Does this belong in VDPVRAM?
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 141 of file VDPVRAM.cc.
References openmsx::VDP::isInsideFrame(), openmsx::VDPCmdEngine::updateDisplayMode(), openmsx::SpriteChecker::updateDisplayMode(), and openmsx::Renderer::updateDisplayMode().
void openmsx::VDPVRAM::updateSpritesEnabled | ( | bool | enabled, |
EmuTime::param | time | ||
) |
Used by the VDP to signal sprites enabled changes.
enabled | The new sprites enabled state. |
time | The moment in emulated time this change occurs. |
Definition at line 157 of file VDPVRAM.cc.
References openmsx::VDP::isInsideFrame(), openmsx::VDPCmdEngine::sync(), openmsx::SpriteChecker::updateSpritesEnabled(), and openmsx::Renderer::updateSpritesEnabled().
void openmsx::VDPVRAM::updateVRMode | ( | bool | mode, |
EmuTime::param | time | ||
) |
Change between VR=0 and VR=1 mode.
mode | false->VR=0 true->VR=1 |
time | The moment in emulated time this change occurs. |
Definition at line 195 of file VDPVRAM.cc.
References xrange().
VRAMWindow openmsx::VDPVRAM::bitmapCacheWindow |
Definition at line 693 of file VDPVRAM.hh.
Referenced by serialize(), and VDPVRAM().
VRAMWindow openmsx::VDPVRAM::bitmapVisibleWindow |
Definition at line 692 of file VDPVRAM.hh.
Referenced by serialize(), and setRenderer().
VRAMWindow openmsx::VDPVRAM::cmdReadWindow |
Definition at line 687 of file VDPVRAM.hh.
Referenced by cpuWrite(), openmsx::Graphic4Mode::point(), openmsx::Graphic5Mode::point(), openmsx::Graphic6Mode::point(), openmsx::Graphic7Mode::point(), openmsx::NonBitmapMode::point(), and serialize().
VRAMWindow openmsx::VDPVRAM::cmdWriteWindow |
Definition at line 688 of file VDPVRAM.hh.
Referenced by cpuRead(), cpuWrite(), and serialize().
VRAMWindow openmsx::VDPVRAM::colorTable |
Definition at line 690 of file VDPVRAM.hh.
Referenced by serialize().
VRAMWindow openmsx::VDPVRAM::nameTable |
Definition at line 689 of file VDPVRAM.hh.
Referenced by openmsx::SDLRasterizer::drawDisplay(), and serialize().
VRAMWindow openmsx::VDPVRAM::patternTable |
Definition at line 691 of file VDPVRAM.hh.
Referenced by serialize().
VRAMWindow openmsx::VDPVRAM::spriteAttribTable |
Definition at line 694 of file VDPVRAM.hh.
Referenced by serialize(), and openmsx::SpriteChecker::SpriteChecker().
VRAMWindow openmsx::VDPVRAM::spritePatternTable |
Definition at line 695 of file VDPVRAM.hh.
Referenced by serialize(), and openmsx::SpriteChecker::SpriteChecker().