openMSX
|
This class keeps track of which bytes in the Ram have been written to. More...
#include <CheckedRam.hh>
Public Member Functions | |
CheckedRam (const DeviceConfig &config, const std::string &name, static_string_view description, unsigned size) | |
~CheckedRam () | |
byte | read (unsigned addr) |
byte | peek (unsigned addr) const |
void | write (unsigned addr, byte value) |
const byte * | getReadCacheLine (unsigned addr) const |
byte * | getWriteCacheLine (unsigned addr) const |
byte * | getRWCacheLines (unsigned addr, unsigned size) const |
unsigned | getSize () const |
void | clear () |
Ram & | getUncheckedRam () |
Give access to the unchecked Ram. More... | |
This class keeps track of which bytes in the Ram have been written to.
It can be used for debugging MSX programs, because you can see if you are trying to read/execute uninitialized memory. Currently all normal RAM (MSXRam) and all normal memory mappers (MSXMemoryMappers) use CheckedRam. On the turboR, only the normal memory mapper runs via CheckedRam. The RAM accessed in DRAM mode or via the ROM mapper are unchecked! Note that there is basically no overhead for using CheckedRam over Ram, thanks to Wouter.
Definition at line 27 of file CheckedRam.hh.
openmsx::CheckedRam::CheckedRam | ( | const DeviceConfig & | config, |
const std::string & | name, | ||
static_string_view | description, | ||
unsigned | size | ||
) |
Definition at line 12 of file CheckedRam.cc.
References openmsx::Subject< T >::attach(), and openmsx::TclCallback::getSetting().
openmsx::CheckedRam::~CheckedRam | ( | ) |
Definition at line 22 of file CheckedRam.cc.
References openmsx::Subject< T >::detach(), and openmsx::TclCallback::getSetting().
void openmsx::CheckedRam::clear | ( | ) |
Definition at line 84 of file CheckedRam.cc.
References openmsx::Ram::clear().
Referenced by openmsx::MSXMemoryMapperBase::powerUp().
const byte * openmsx::CheckedRam::getReadCacheLine | ( | unsigned | addr | ) | const |
Definition at line 38 of file CheckedRam.cc.
References openmsx::CacheLine::BITS.
Referenced by openmsx::ColecoSuperGameModule::getReadCacheLine(), and openmsx::MSXMemoryMapperBase::getReadCacheLine().
byte * openmsx::CheckedRam::getRWCacheLines | ( | unsigned | addr, |
unsigned | size | ||
) | const |
Definition at line 50 of file CheckedRam.cc.
References openmsx::CacheLine::BITS, utf8::unchecked::size(), and xrange().
Referenced by openmsx::MSXMemoryMapper::writeIO(), and openmsx::PanasonicRam::writeIO().
|
inline |
Definition at line 42 of file CheckedRam.hh.
References openmsx::Ram::getSize().
Referenced by openmsx::MSXMemoryMapperBase::getSizeInBlocks(), openmsx::MSXMemoryMapperBase::peekIO(), openmsx::MSXMemoryMapperBase::segmentOffset(), and openmsx::MSXMemoryMapperBase::writeIOImpl().
|
inline |
Give access to the unchecked Ram.
No problem to use it, but there will just be no checking done! Keep in mind that you should use this consistently, so that the initialized-administration will be always up to date!
Definition at line 51 of file CheckedRam.hh.
Referenced by openmsx::PanasonicRam::PanasonicRam(), openmsx::ColecoSuperGameModule::serialize(), and openmsx::MSXMemoryMapperBase::serialize().
byte * openmsx::CheckedRam::getWriteCacheLine | ( | unsigned | addr | ) | const |
Definition at line 44 of file CheckedRam.cc.
References openmsx::CacheLine::BITS.
Referenced by openmsx::ColecoSuperGameModule::getWriteCacheLine(), openmsx::MSXMemoryMapperBase::getWriteCacheLine(), and openmsx::PanasonicRam::getWriteCacheLine().
|
inline |
Definition at line 35 of file CheckedRam.hh.
Referenced by openmsx::ColecoSuperGameModule::peekMem(), and openmsx::MSXMemoryMapperBase::peekMem().
byte openmsx::CheckedRam::read | ( | unsigned | addr | ) |
Definition at line 27 of file CheckedRam.cc.
References openmsx::CacheLine::BITS, openmsx::TclCallback::execute(), openmsx::Ram::getName(), and openmsx::CacheLine::LOW.
Referenced by openmsx::ColecoSuperGameModule::readMem(), and openmsx::MSXMemoryMapperBase::readMem().
void openmsx::CheckedRam::write | ( | unsigned | addr, |
byte | value | ||
) |
Definition at line 63 of file CheckedRam.cc.
References openmsx::CacheLine::BITS, openmsx::MSXCPU::invalidateAllSlotsRWCache(), and openmsx::CacheLine::LOW.
Referenced by openmsx::ColecoSuperGameModule::writeMem(), openmsx::MSXMemoryMapperBase::writeMem(), and openmsx::PanasonicRam::writeMem().