openMSX
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
openmsx::MSXCPUInterface Class Reference

#include <MSXCPUInterface.hh>

Inheritance diagram for openmsx::MSXCPUInterface:
Inheritance graph
[legend]
Collaboration diagram for openmsx::MSXCPUInterface:
Collaboration graph
[legend]

Classes

struct  GlobalWriteInfo

Public Types

typedef std::multimap< word,
std::shared_ptr< BreakPoint > > 
BreakPoints
typedef std::vector
< std::shared_ptr< WatchPoint > > 
WatchPoints
typedef std::vector
< std::shared_ptr
< DebugCondition > > 
Conditions

Public Member Functions

 MSXCPUInterface (MSXMotherBoard &motherBoard)
 ~MSXCPUInterface ()
void register_IO_In (byte port, MSXDevice *device)
 Devices can register their In ports.
void unregister_IO_In (byte port, MSXDevice *device)
void register_IO_Out (byte port, MSXDevice *device)
 Devices can register their Out ports.
void unregister_IO_Out (byte port, MSXDevice *device)
void registerMemDevice (MSXDevice &device, int primSl, int secSL, int base, int size)
 Devices can register themself in the MSX slotstructure.
void unregisterMemDevice (MSXDevice &device, int primSl, int secSL, int base, int size)
void registerGlobalWrite (MSXDevice &device, word address)
 (Un)register global writes.
void unregisterGlobalWrite (MSXDevice &device, word address)
void reset ()
 Reset (the slot state)
byte readMem (word address, EmuTime::param time)
 This reads a byte from the currently selected device.
void writeMem (word address, byte value, EmuTime::param time)
 This writes a byte to the currently selected device.
byte readIO (word port, EmuTime::param time)
 This read a byte from the given IO-port.
void writeIO (word port, byte value, EmuTime::param time)
 This writes a byte to the given IO-port.
const bytegetReadCacheLine (word start) const
 Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
bytegetWriteCacheLine (word start) const
 Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
byte readIRQVector ()
 CPU uses this method to read 'extra' data from the databus used in interrupt routines.
void setPrimarySlots (byte value)
byte peekMem (word address, EmuTime::param time) const
 Peek memory location.
byte peekSlottedMem (unsigned address, EmuTime::param time) const
byte readSlottedMem (unsigned address, EmuTime::param time)
void writeSlottedMem (unsigned address, byte value, EmuTime::param time)
void setExpanded (int ps)
void unsetExpanded (int ps)
void testUnsetExpanded (int ps, std::vector< MSXDevice * > allowed) const
bool isExpanded (int ps) const
void changeExpanded (bool isExpanded)
DummyDevicegetDummyDevice ()
void setWatchPoint (const std::shared_ptr< WatchPoint > &watchPoint)
void removeWatchPoint (std::shared_ptr< WatchPoint > watchPoint)
const WatchPointsgetWatchPoints () const
void doBreak ()
void doStep ()
void doContinue ()
void setFastForward (bool fastForward_)
bool isFastForward () const
template<typename Archive >
void serialize (Archive &ar, unsigned version)

Static Public Member Functions

static void insertBreakPoint (const std::shared_ptr< BreakPoint > &bp)
static void removeBreakPoint (const BreakPoint &bp)
static const BreakPointsgetBreakPoints ()
static void setCondition (const std::shared_ptr< DebugCondition > &cond)
static void removeCondition (const DebugCondition &cond)
static const ConditionsgetConditions ()
static bool isBreaked ()
static bool isStep ()
static void setStep (bool x)
static bool isContinue ()
static void setContinue (bool x)
static bool anyBreakPoints ()
static bool checkBreakPoints (unsigned pc)
static void cleanup ()

Friends

class SlotInfo
class IODebug
class IOInfo

Additional Inherited Members

Detailed Description

Definition at line 32 of file MSXCPUInterface.hh.

Member Typedef Documentation

typedef std::multimap<word, std::shared_ptr<BreakPoint> > openmsx::MSXCPUInterface::BreakPoints

Definition at line 184 of file MSXCPUInterface.hh.

typedef std::vector<std::shared_ptr<DebugCondition> > openmsx::MSXCPUInterface::Conditions

Definition at line 196 of file MSXCPUInterface.hh.

typedef std::vector<std::shared_ptr<WatchPoint> > openmsx::MSXCPUInterface::WatchPoints

Definition at line 190 of file MSXCPUInterface.hh.

Constructor & Destructor Documentation

openmsx::MSXCPUInterface::MSXCPUInterface ( MSXMotherBoard motherBoard)
explicit
openmsx::MSXCPUInterface::~MSXCPUInterface ( )

Member Function Documentation

static bool openmsx::MSXCPUInterface::anyBreakPoints ( )
inlinestatic

Definition at line 211 of file MSXCPUInterface.hh.

void openmsx::MSXCPUInterface::changeExpanded ( bool  isExpanded)
static bool openmsx::MSXCPUInterface::checkBreakPoints ( unsigned  pc)
inlinestatic

Definition at line 215 of file MSXCPUInterface.hh.

References isBreaked().

void openmsx::MSXCPUInterface::cleanup ( )
static

Definition at line 1041 of file MSXCPUInterface.cc.

Referenced by openmsx::Interpreter::~Interpreter().

void openmsx::MSXCPUInterface::doBreak ( )
void openmsx::MSXCPUInterface::doContinue ( )

Definition at line 1023 of file MSXCPUInterface.cc.

References isFastForward().

Referenced by openmsx::DebugCmd::execute().

void openmsx::MSXCPUInterface::doStep ( )

Definition at line 1014 of file MSXCPUInterface.cc.

References isFastForward().

Referenced by openmsx::DebugCmd::execute().

const MSXCPUInterface::BreakPoints & openmsx::MSXCPUInterface::getBreakPoints ( )
static

Definition at line 804 of file MSXCPUInterface.cc.

const MSXCPUInterface::Conditions & openmsx::MSXCPUInterface::getConditions ( )
static

Definition at line 897 of file MSXCPUInterface.cc.

DummyDevice & openmsx::MSXCPUInterface::getDummyDevice ( )

Definition at line 782 of file MSXCPUInterface.cc.

Referenced by openmsx::VDPIODelay::VDPIODelay().

const byte* openmsx::MSXCPUInterface::getReadCacheLine ( word  start) const
inline

Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.

If it is, a pointer to a buffer containing this interval must be returned. If not, a null pointer must be returned. Cacheable for reading means the data may be read directly from the buffer, thus bypassing the readMem() method, and thus also ignoring EmuTime. The default implementation always returns a null pointer. An interval will never cross a 16KB border. An interval will never contain the address 0xffff.

Definition at line 124 of file MSXCPUInterface.hh.

References openmsx::MSXDevice::getReadCacheLine(), and unlikely.

const MSXCPUInterface::WatchPoints & openmsx::MSXCPUInterface::getWatchPoints ( ) const

Definition at line 876 of file MSXCPUInterface.cc.

Referenced by openmsx::Debugger::transfer().

byte* openmsx::MSXCPUInterface::getWriteCacheLine ( word  start) const
inline

Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.

If it is, a pointer to a buffer containing this interval must be returned. If not, a null pointer must be returned. Cacheable for writing means the data may be written directly to the buffer, thus bypassing the writeMem() method, and thus also ignoring EmuTime. The default implementation always returns a null pointer. An interval will never cross a 16KB border. An interval will never contain the address 0xffff.

Definition at line 143 of file MSXCPUInterface.hh.

References openmsx::MSXDevice::getWriteCacheLine(), and unlikely.

void openmsx::MSXCPUInterface::insertBreakPoint ( const std::shared_ptr< BreakPoint > &  bp)
static

Definition at line 788 of file MSXCPUInterface.cc.

static bool openmsx::MSXCPUInterface::isBreaked ( )
inlinestatic

Definition at line 199 of file MSXCPUInterface.hh.

Referenced by checkBreakPoints(), and openmsx::DebugCmd::execute().

static bool openmsx::MSXCPUInterface::isContinue ( )
inlinestatic

Definition at line 207 of file MSXCPUInterface.hh.

bool openmsx::MSXCPUInterface::isExpanded ( int  ps) const
inline
bool openmsx::MSXCPUInterface::isFastForward ( ) const
inline

Definition at line 233 of file MSXCPUInterface.hh.

Referenced by doBreak(), doContinue(), and doStep().

static bool openmsx::MSXCPUInterface::isStep ( )
inlinestatic

Definition at line 205 of file MSXCPUInterface.hh.

byte openmsx::MSXCPUInterface::peekMem ( word  address,
EmuTime::param  time 
) const

Peek memory location.

See Also
MSXDevice::peekMem()

Definition at line 721 of file MSXCPUInterface.cc.

References isExpanded(), and openmsx::MSXDevice::peekMem().

Referenced by openmsx::dasm(), and openmsx::MemoryDebug::read().

byte openmsx::MSXCPUInterface::peekSlottedMem ( unsigned  address,
EmuTime::param  time 
) const
byte openmsx::MSXCPUInterface::readIO ( word  port,
EmuTime::param  time 
)
inline

This read a byte from the given IO-port.

See Also
MSXDevice::readIO()

Definition at line 100 of file MSXCPUInterface.hh.

References openmsx::MSXDevice::readIO().

byte openmsx::MSXCPUInterface::readIRQVector ( )

CPU uses this method to read 'extra' data from the databus used in interrupt routines.

In MSX this returns always 255.

Definition at line 655 of file MSXCPUInterface.cc.

References openmsx::MSXMotherBoard::readIRQVector().

byte openmsx::MSXCPUInterface::readMem ( word  address,
EmuTime::param  time 
)
inline

This reads a byte from the currently selected device.

Definition at line 79 of file MSXCPUInterface.hh.

References openmsx::MSXDevice::readMem(), and unlikely.

byte openmsx::MSXCPUInterface::readSlottedMem ( unsigned  address,
EmuTime::param  time 
)

Definition at line 747 of file MSXCPUInterface.cc.

References isExpanded(), and openmsx::MSXDevice::peekMem().

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

void openmsx::MSXCPUInterface::register_IO_In ( byte  port,
MSXDevice device 
)

Devices can register their In ports.

This is normally done in their constructor. Once device are registered, their readIO() method can get called.

Definition at line 407 of file MSXCPUInterface.cc.

Referenced by openmsx::MSXMotherBoard::Impl::createMapperIO(), openmsx::MegaFlashRomSCCPlus::MegaFlashRomSCCPlus(), openmsx::MSXDeviceSwitch::registerDevice(), openmsx::RomArc::RomArc(), openmsx::RomKonamiKeyboardMaster::RomKonamiKeyboardMaster(), and openmsx::RomManbow2::RomManbow2().

void openmsx::MSXCPUInterface::register_IO_Out ( byte  port,
MSXDevice device 
)
void openmsx::MSXCPUInterface::registerGlobalWrite ( MSXDevice device,
word  address 
)

(Un)register global writes.

See Also
MSXDevice::globalWrite()

Definition at line 607 of file MSXCPUInterface.cc.

References openmsx::MSXCPU::invalidateMemCache().

Referenced by openmsx::RomSuperLodeRunner::RomSuperLodeRunner().

void openmsx::MSXCPUInterface::registerMemDevice ( MSXDevice device,
int  primSl,
int  secSL,
int  base,
int  size 
)

Devices can register themself in the MSX slotstructure.

This is normally done in their constructor. Once devices are registered their readMem() / writeMem() methods can get called.

Definition at line 565 of file MSXCPUInterface.cc.

References isExpanded().

void openmsx::MSXCPUInterface::removeBreakPoint ( const BreakPoint bp)
static

Definition at line 793 of file MSXCPUInterface.cc.

References openmsx::BreakPoint::getAddress().

void openmsx::MSXCPUInterface::removeCondition ( const DebugCondition cond)
static

Definition at line 887 of file MSXCPUInterface.cc.

void openmsx::MSXCPUInterface::removeWatchPoint ( std::shared_ptr< WatchPoint watchPoint)
void openmsx::MSXCPUInterface::reset ( )

Reset (the slot state)

Definition at line 647 of file MSXCPUInterface.cc.

References setPrimarySlots().

Referenced by openmsx::MSXMotherBoard::Impl::doReset(), and openmsx::MSXMotherBoard::Impl::powerUp().

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

Definition at line 1245 of file MSXCPUInterface.cc.

References setPrimarySlots().

void openmsx::MSXCPUInterface::setCondition ( const std::shared_ptr< DebugCondition > &  cond)
static

Definition at line 882 of file MSXCPUInterface.cc.

static void openmsx::MSXCPUInterface::setContinue ( bool  x)
inlinestatic

Definition at line 208 of file MSXCPUInterface.hh.

void openmsx::MSXCPUInterface::setExpanded ( int  ps)

Definition at line 316 of file MSXCPUInterface.cc.

References changeExpanded(), and isExpanded().

void openmsx::MSXCPUInterface::setFastForward ( bool  fastForward_)
inline

Definition at line 232 of file MSXCPUInterface.hh.

void openmsx::MSXCPUInterface::setPrimarySlots ( byte  value)

Definition at line 660 of file MSXCPUInterface.cc.

References changeExpanded(), isExpanded(), and unlikely.

Referenced by reset(), and serialize().

static void openmsx::MSXCPUInterface::setStep ( bool  x)
inlinestatic

Definition at line 206 of file MSXCPUInterface.hh.

void openmsx::MSXCPUInterface::setWatchPoint ( const std::shared_ptr< WatchPoint > &  watchPoint)
void openmsx::MSXCPUInterface::testUnsetExpanded ( int  ps,
std::vector< MSXDevice * >  allowed 
) const

Definition at line 330 of file MSXCPUInterface.cc.

References isExpanded().

Referenced by openmsx::HardwareConfig::testRemove(), and unsetExpanded().

void openmsx::MSXCPUInterface::unregister_IO_In ( byte  port,
MSXDevice device 
)
void openmsx::MSXCPUInterface::unregister_IO_Out ( byte  port,
MSXDevice device 
)
void openmsx::MSXCPUInterface::unregisterGlobalWrite ( MSXDevice device,
word  address 
)
void openmsx::MSXCPUInterface::unregisterMemDevice ( MSXDevice device,
int  primSl,
int  secSL,
int  base,
int  size 
)

Definition at line 595 of file MSXCPUInterface.cc.

void openmsx::MSXCPUInterface::unsetExpanded ( int  ps)
void openmsx::MSXCPUInterface::writeIO ( word  port,
byte  value,
EmuTime::param  time 
)
inline

This writes a byte to the given IO-port.

See Also
MSXDevice::writeIO()

Definition at line 108 of file MSXCPUInterface.hh.

References openmsx::MSXDevice::writeIO().

Referenced by openmsx::IODebug::write().

void openmsx::MSXCPUInterface::writeMem ( word  address,
byte  value,
EmuTime::param  time 
)
inline

This writes a byte to the currently selected device.

Definition at line 89 of file MSXCPUInterface.hh.

References unlikely, and openmsx::MSXDevice::writeMem().

Referenced by openmsx::MemoryDebug::write().

void openmsx::MSXCPUInterface::writeSlottedMem ( unsigned  address,
byte  value,
EmuTime::param  time 
)

Friends And Related Function Documentation

friend class IODebug
friend

Definition at line 268 of file MSXCPUInterface.hh.

friend class IOInfo
friend

Definition at line 269 of file MSXCPUInterface.hh.

friend class SlotInfo
friend

Definition at line 267 of file MSXCPUInterface.hh.


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