openMSX
Classes | Public Member Functions | Public Attributes | List of all members
openmsx::VDPVRAM Class Reference

Manages VRAM contents and synchronises the various users of the VRAM. More...

#include <VDPVRAM.hh>

Collaboration diagram for openmsx::VDPVRAM:
Collaboration graph
[legend]

Public Member Functions

 VDPVRAM (const VDPVRAM &)=delete
 
VDPVRAMoperator= (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)
 

Public Attributes

VRAMWindow cmdReadWindow
 
VRAMWindow cmdWriteWindow
 
VRAMWindow nameTable
 
VRAMWindow colorTable
 
VRAMWindow patternTable
 
VRAMWindow bitmapVisibleWindow
 
VRAMWindow bitmapCacheWindow
 
VRAMWindow spriteAttribTable
 
VRAMWindow spritePatternTable
 

Detailed Description

Manages VRAM contents and synchronises the various users of the VRAM.

VDPVRAM does not apply planar remapping to addresses, this is the responsibility of the caller.

Definition at line 384 of file VDPVRAM.hh.

Constructor & Destructor Documentation

◆ VDPVRAM() [1/2]

openmsx::VDPVRAM::VDPVRAM ( const VDPVRAM )
delete

◆ VDPVRAM() [2/2]

openmsx::VDPVRAM::VDPVRAM ( VDP vdp,
unsigned  size,
EmuTime::param  time 
)

Member Function Documentation

◆ change4k8kMapping()

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.

◆ clear()

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().

◆ cmdWrite()

void openmsx::VDPVRAM::cmdWrite ( unsigned  address,
byte  value,
EmuTime::param  time 
)
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 411 of file VDPVRAM.hh.

References openmsx::VDP::isInsideFrame(), and unlikely.

Referenced by openmsx::ImpOp::operator()(), openmsx::AndOp::operator()(), openmsx::OrOp::operator()(), openmsx::XorOp::operator()(), and openmsx::NotOp::operator()().

◆ cpuRead()

byte openmsx::VDPVRAM::cpuRead ( unsigned  address,
EmuTime::param  time 
)
inline

Read a byte from VRAM though the CPU interface.

Parameters
addressThe address to read.
timeThe moment in emulated time this read occurs.
Returns
The VRAM contents at the specified address.

Definition at line 472 of file VDPVRAM.hh.

References openmsx::VDP::isInsideFrame().

Referenced by openmsx::ADVram::readMem().

◆ cpuWrite()

void openmsx::VDPVRAM::cpuWrite ( unsigned  address,
byte  value,
EmuTime::param  time 
)
inline

Write a byte to VRAM through the CPU interface.

Parameters
addressThe address to write.
valueThe value to write.
timeThe moment in emulated time this write occurs.

Definition at line 436 of file VDPVRAM.hh.

References openmsx::VDP::isInsideFrame(), and unlikely.

Referenced by openmsx::ADVram::writeMem().

◆ getSize()

unsigned openmsx::VDPVRAM::getSize ( ) const
inline

Returns the size of VRAM in bytes.

Definition at line 525 of file VDPVRAM.hh.

Referenced by openmsx::ADVram::ADVram().

◆ operator=()

VDPVRAM& openmsx::VDPVRAM::operator= ( const VDPVRAM )
delete

◆ serialize()

template<typename Archive >
void openmsx::VDPVRAM::serialize ( Archive &  ar,
unsigned  version 
)

◆ setCmdEngine()

void openmsx::VDPVRAM::setCmdEngine ( VDPCmdEngine newCmdEngine)
inline

Necessary because of circular dependencies.

Definition at line 537 of file VDPVRAM.hh.

References openmsx::serialize().

◆ setRenderer()

void openmsx::VDPVRAM::setRenderer ( Renderer renderer,
EmuTime::param  time 
)

◆ setSpriteChecker()

void openmsx::VDPVRAM::setSpriteChecker ( SpriteChecker newSpriteChecker)
inline

Necessary because of circular dependencies.

Definition at line 531 of file VDPVRAM.hh.

◆ sync()

void openmsx::VDPVRAM::sync ( EmuTime::param  time)
inline

Update VRAM state to specified moment in time.

Parameters
timeMoment in emulated time to update VRAM to. TODO: Replace this method by VRAMWindow::sync().

Definition at line 400 of file VDPVRAM.hh.

References openmsx::VDP::isInsideFrame().

Referenced by openmsx::PixelRenderer::updateWindow().

◆ updateDisplayEnabled()

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.

Parameters
enabledThe new display enabled state.
timeThe 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().

◆ updateDisplayMode()

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?

Parameters
modeThe new display mode.
cmdBitAre VDP commands allowed in non-bitmap mode.
timeThe moment in emulated time this change occurs.

Definition at line 151 of file VDPVRAM.cc.

References openmsx::VDP::isInsideFrame(), openmsx::SpriteChecker::updateDisplayMode(), openmsx::VDPCmdEngine::updateDisplayMode(), and openmsx::Renderer::updateDisplayMode().

◆ updateSpritesEnabled()

void openmsx::VDPVRAM::updateSpritesEnabled ( bool  enabled,
EmuTime::param  time 
)

◆ updateVRMode()

void openmsx::VDPVRAM::updateVRMode ( bool  mode,
EmuTime::param  time 
)

Change between VR=0 and VR=1 mode.

Parameters
modefalse->VR=0 true->VR=1
timeThe moment in emulated time this change occurs.

Definition at line 203 of file VDPVRAM.cc.

Member Data Documentation

◆ bitmapCacheWindow

VRAMWindow openmsx::VDPVRAM::bitmapCacheWindow

Definition at line 670 of file VDPVRAM.hh.

Referenced by serialize(), updateSpritesEnabled(), and VDPVRAM().

◆ bitmapVisibleWindow

VRAMWindow openmsx::VDPVRAM::bitmapVisibleWindow

Definition at line 669 of file VDPVRAM.hh.

Referenced by serialize(), setRenderer(), and updateSpritesEnabled().

◆ cmdReadWindow

VRAMWindow openmsx::VDPVRAM::cmdReadWindow

◆ cmdWriteWindow

VRAMWindow openmsx::VDPVRAM::cmdWriteWindow

Definition at line 665 of file VDPVRAM.hh.

Referenced by serialize(), openmsx::VDPCmdEngine::sync2(), and updateSpritesEnabled().

◆ colorTable

VRAMWindow openmsx::VDPVRAM::colorTable

◆ nameTable

VRAMWindow openmsx::VDPVRAM::nameTable

◆ patternTable

VRAMWindow openmsx::VDPVRAM::patternTable

◆ spriteAttribTable

VRAMWindow openmsx::VDPVRAM::spriteAttribTable

◆ spritePatternTable

VRAMWindow openmsx::VDPVRAM::spritePatternTable

The documentation for this class was generated from the following files: