openMSX
|
Manages VRAM contents and synchronizes the various users of the VRAM. More...
#include <VDPVRAM.hh>
Public Member Functions | |
VDPVRAM (const VDPVRAM &)=delete | |
VDPVRAM & | operator= (const VDPVRAM &)=delete |
VDPVRAM (VDP &vdp, unsigned size, EmuTime::param time) | |
void | clear () |
Initialize VRAM content to power-up state. More... | |
void | sync (EmuTime::param time) |
Update VRAM state to specified moment in time. More... | |
void | cmdWrite (unsigned address, byte value, EmuTime::param time) |
Write a byte from the command engine. More... | |
void | cpuWrite (unsigned address, byte value, EmuTime::param time) |
Write a byte to VRAM through the CPU interface. More... | |
byte | cpuRead (unsigned address, EmuTime::param time) |
Read a byte from VRAM though the CPU interface. More... | |
void | updateDisplayMode (DisplayMode mode, bool cmdBit, EmuTime::param time) |
Used by the VDP to signal display mode changes. More... | |
void | updateDisplayEnabled (bool enabled, EmuTime::param time) |
Used by the VDP to signal display enabled changes. More... | |
void | updateSpritesEnabled (bool enabled, EmuTime::param time) |
Used by the VDP to signal sprites enabled changes. More... | |
void | updateVRMode (bool mode, EmuTime::param time) |
Change between VR=0 and VR=1 mode. More... | |
void | setRenderer (Renderer *renderer, EmuTime::param time) |
unsigned | getSize () const |
Returns the size of VRAM in bytes. More... | |
void | setSpriteChecker (SpriteChecker *newSpriteChecker) |
Necessary because of circular dependencies. More... | |
void | setCmdEngine (VDPCmdEngine *newCmdEngine) |
Necessary because of circular dependencies. More... | |
void | change4k8kMapping (bool mapping8k) |
TMS99x8 VRAM can be mapped in two ways. More... | |
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 386 of file VDPVRAM.hh.
|
delete |
openmsx::VDPVRAM::VDPVRAM | ( | VDP & | vdp, |
unsigned | size, | ||
EmuTime::param | time | ||
) |
Definition at line 108 of file VDPVRAM.cc.
void openmsx::VDPVRAM::change4k8kMapping | ( | bool | mapping8k | ) |
TMS99x8 VRAM can be mapped in two ways.
See implementation for more details.
Definition at line 239 of file VDPVRAM.cc.
void openmsx::VDPVRAM::clear | ( | ) |
Initialize VRAM content to power-up state.
Definition at line 138 of file VDPVRAM.cc.
References openmsx::Ram::clear(), and openmsx::Ram::getSize().
|
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 413 of file VDPVRAM.hh.
References openmsx::VDP::isInsideFrame(), and unlikely.
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 474 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 438 of file VDPVRAM.hh.
References cmdReadWindow, cmdWriteWindow, openmsx::VRAMWindow::isInside(), openmsx::VDP::isInsideFrame(), openmsx::VDPCmdEngine::stealAccessSlot(), openmsx::VDPCmdEngine::sync(), and unlikely.
Referenced by openmsx::ADVram::writeMem().
|
inline |
Returns the size of VRAM in bytes.
Definition at line 527 of file VDPVRAM.hh.
void openmsx::VDPVRAM::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 323 of file VDPVRAM.cc.
References bitmapCacheWindow, bitmapVisibleWindow, cmdReadWindow, cmdWriteWindow, colorTable, openmsx::VDP::getVRMode(), nameTable, patternTable, spriteAttribTable, and spritePatternTable.
|
inline |
Necessary because of circular dependencies.
Definition at line 539 of file VDPVRAM.hh.
void openmsx::VDPVRAM::setRenderer | ( | Renderer * | renderer, |
EmuTime::param | time | ||
) |
Definition at line 226 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 533 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 402 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 159 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 151 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 167 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 203 of file VDPVRAM.cc.
References xrange().
VRAMWindow openmsx::VDPVRAM::bitmapCacheWindow |
Definition at line 673 of file VDPVRAM.hh.
Referenced by serialize().
VRAMWindow openmsx::VDPVRAM::bitmapVisibleWindow |
Definition at line 672 of file VDPVRAM.hh.
Referenced by serialize(), and setRenderer().
VRAMWindow openmsx::VDPVRAM::cmdReadWindow |
Definition at line 667 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 668 of file VDPVRAM.hh.
Referenced by cpuRead(), cpuWrite(), and serialize().
VRAMWindow openmsx::VDPVRAM::colorTable |
Definition at line 670 of file VDPVRAM.hh.
Referenced by serialize().
VRAMWindow openmsx::VDPVRAM::nameTable |
Definition at line 669 of file VDPVRAM.hh.
Referenced by serialize().
VRAMWindow openmsx::VDPVRAM::patternTable |
Definition at line 671 of file VDPVRAM.hh.
Referenced by serialize().
VRAMWindow openmsx::VDPVRAM::spriteAttribTable |
Definition at line 674 of file VDPVRAM.hh.
Referenced by serialize(), and openmsx::SpriteChecker::SpriteChecker().
VRAMWindow openmsx::VDPVRAM::spritePatternTable |
Definition at line 675 of file VDPVRAM.hh.
Referenced by serialize(), and openmsx::SpriteChecker::SpriteChecker().