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, size_t size) | |
~CheckedRam () | |
byte | read (size_t addr) |
byte | peek (size_t addr) const |
void | write (size_t addr, byte value) |
const byte * | getReadCacheLine (size_t addr) const |
byte * | getWriteCacheLine (size_t addr) |
byte * | getRWCacheLines (size_t addr, size_t size) |
size_t | size () const |
void | clear () |
Ram & | getUncheckedRam () |
Give access to the unchecked Ram. | |
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, | ||
size_t | size | ||
) |
Definition at line 13 of file CheckedRam.cc.
References openmsx::Subject< T >::attach(), and openmsx::TclCallback::getSetting().
openmsx::CheckedRam::~CheckedRam | ( | ) |
Definition at line 23 of file CheckedRam.cc.
References openmsx::Subject< T >::detach(), and openmsx::TclCallback::getSetting().
void openmsx::CheckedRam::clear | ( | ) |
Definition at line 85 of file CheckedRam.cc.
References openmsx::Ram::clear().
Referenced by openmsx::MSXMemoryMapperBase::powerUp().
const byte * openmsx::CheckedRam::getReadCacheLine | ( | size_t | addr | ) | const |
Definition at line 39 of file CheckedRam.cc.
References openmsx::CacheLine::BITS.
Referenced by openmsx::ColecoSuperGameModule::getReadCacheLine(), and openmsx::MSXMemoryMapperBase::getReadCacheLine().
byte * openmsx::CheckedRam::getRWCacheLines | ( | size_t | addr, |
size_t | size | ||
) |
Definition at line 51 of file CheckedRam.cc.
References openmsx::CacheLine::BITS, size(), and xrange().
Referenced by openmsx::MSXMemoryMapper::writeIO(), and openmsx::PanasonicRam::writeIO().
|
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 | ( | size_t | addr | ) |
Definition at line 45 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 | ( | size_t | addr | ) |
Definition at line 28 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().
|
inline |
Definition at line 42 of file CheckedRam.hh.
References openmsx::Ram::size().
Referenced by getRWCacheLines(), openmsx::MSXMemoryMapperBase::getSizeInBlocks(), openmsx::MSXMemoryMapperBase::peekIO(), openmsx::MSXMemoryMapperBase::segmentOffset(), and openmsx::MSXMemoryMapperBase::writeIOImpl().
void openmsx::CheckedRam::write | ( | size_t | addr, |
byte | value | ||
) |
Definition at line 64 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().