openMSX
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
openmsx::MSXDevice Class Referenceabstract

An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX. More...

#include <MSXDevice.hh>

Inheritance diagram for openmsx::MSXDevice:
Inheritance graph
[legend]

Public Types

using Devices = std::vector< MSXDevice * >
 

Public Member Functions

 MSXDevice (const MSXDevice &)=delete
 
MSXDeviceoperator= (const MSXDevice &)=delete
 
virtual ~MSXDevice ()=0
 
const HardwareConfiggetHardwareConfig () const
 Returns the hardwareconfig this device belongs to. More...
 
void testRemove (Devices alreadyRemoved) const
 Checks whether this device can be removed (no other device has a reference to it). More...
 
virtual void reset (EmuTime::param time)
 This method is called on reset. More...
 
virtual byte readIRQVector ()
 Gets IRQ vector used in IM2. More...
 
virtual void powerDown (EmuTime::param time)
 This method is called when MSX is powered down. More...
 
virtual void powerUp (EmuTime::param time)
 This method is called when MSX is powered up. More...
 
virtual std::string getName () const
 Returns a human-readable name for this device. More...
 
virtual void getNameList (TclObject &result) const
 Returns list of name(s) of this device. More...
 
void getDeviceInfo (TclObject &result) const
 Get device info. More...
 
void getVisibleMemRegion (unsigned &base, unsigned &size) const
 Returns the range where this device is visible in memory. More...
 
virtual byte readIO (word port, EmuTime::param time)
 Read a byte from an IO port at a certain time from this device. More...
 
virtual void writeIO (word port, byte value, EmuTime::param time)
 Write a byte to a given IO port at a certain time to this device. More...
 
virtual byte peekIO (word port, EmuTime::param time) const
 Read a byte from a given IO port. More...
 
virtual byte readMem (word address, EmuTime::param time)
 Read a byte from a location at a certain time from this device. More...
 
virtual void writeMem (word address, byte value, EmuTime::param time)
 Write a given byte to a given location at a certain time to this device. More...
 
virtual const bytegetReadCacheLine (word start) const
 Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading. More...
 
virtual bytegetWriteCacheLine (word start) const
 Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing. More...
 
virtual byte peekMem (word address, EmuTime::param time) const
 Read a byte from a given memory location. More...
 
virtual void globalWrite (word address, byte value, EmuTime::param time)
 Global writes. More...
 
void invalidateMemCache (word start, unsigned size)
 Invalidate CPU memory-mapping cache. More...
 
MSXMotherBoardgetMotherBoard () const
 Get the mother board this device belongs to. More...
 
const XMLElementgetDeviceConfig () const
 Get the configuration section for this device. More...
 
const DeviceConfiggetDeviceConfig2 () const
 
const DevicesgetReferences () const
 Get the device references that are specified for this device. More...
 
EmuTime::param getCurrentTime () const
 
MSXCPUgetCPU () const
 
MSXCPUInterfacegetCPUInterface () const
 
SchedulergetScheduler () const
 
CliCommgetCliComm () const
 
ReactorgetReactor () const
 
CommandControllergetCommandController () const
 
PluggingControllergetPluggingController () const
 
LedStatusgetLedStatus () const
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 

Static Public Attributes

static byte unmappedRead [0x10000]
 
static byte unmappedWrite [0x10000]
 

Protected Member Functions

 MSXDevice (const DeviceConfig &config, const std::string &name)
 Every MSXDevice has a config entry; this constructor gets some device properties from that config entry. More...
 
 MSXDevice (const DeviceConfig &config)
 
virtual void init ()
 
virtual void getExtraDeviceInfo (TclObject &result) const
 

Friends

class DeviceFactory
 Constructing a MSXDevice is a 2-step process, after the constructor is called this init() method must be called. More...
 

Detailed Description

An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.

There is no communication among devices, only between devices and the CPU.

Definition at line 31 of file MSXDevice.hh.

Member Typedef Documentation

◆ Devices

using openmsx::MSXDevice::Devices = std::vector<MSXDevice*>

Definition at line 37 of file MSXDevice.hh.

Constructor & Destructor Documentation

◆ MSXDevice() [1/3]

openmsx::MSXDevice::MSXDevice ( const MSXDevice )
delete

Referenced by getDeviceConfig2().

◆ ~MSXDevice()

openmsx::MSXDevice::~MSXDevice ( )
pure virtual

Definition at line 60 of file MSXDevice.cc.

References unmappedRead.

◆ MSXDevice() [2/3]

openmsx::MSXDevice::MSXDevice ( const DeviceConfig config,
const std::string &  name 
)
protected

Every MSXDevice has a config entry; this constructor gets some device properties from that config entry.

Parameters
configconfig entry for this device.
nameThe name for the MSXDevice (will be made unique)

Definition at line 28 of file MSXDevice.cc.

◆ MSXDevice() [3/3]

openmsx::MSXDevice::MSXDevice ( const DeviceConfig config)
explicitprotected

Definition at line 34 of file MSXDevice.cc.

References getDeviceConfig(), and getMotherBoard().

Member Function Documentation

◆ getCliComm()

CliComm & openmsx::MSXDevice::getCliComm ( ) const

◆ getCommandController()

CommandController & openmsx::MSXDevice::getCommandController ( ) const

◆ getCPU()

MSXCPU & openmsx::MSXDevice::getCPU ( ) const

◆ getCPUInterface()

MSXCPUInterface & openmsx::MSXDevice::getCPUInterface ( ) const

◆ getCurrentTime()

EmuTime::param openmsx::MSXDevice::getCurrentTime ( ) const

Definition at line 135 of file MSXDevice.cc.

References openmsx::MSXMotherBoard::getCurrentTime(), and getMotherBoard().

Referenced by openmsx::BeerIDE::BeerIDE(), openmsx::ChakkariCopy::ChakkariCopy(), getDeviceConfig2(), openmsx::KonamiUltimateCollection::KonamiUltimateCollection(), openmsx::MegaFlashRomSCCPlus::MegaFlashRomSCCPlus(), openmsx::MSXAudio::MSXAudio(), openmsx::MSXFacMidiInterface::MSXFacMidiInterface(), openmsx::MSXFmPac::MSXFmPac(), openmsx::MSXHBI55::MSXHBI55(), openmsx::MSXMidi::MSXMidi(), openmsx::MSXMoonSound::MSXMoonSound(), openmsx::MSXMusicBase::MSXMusicBase(), openmsx::MSXOPL3Cartridge::MSXOPL3Cartridge(), openmsx::MSXPPI::MSXPPI(), openmsx::MSXPrinterPort::MSXPrinterPort(), openmsx::MSXPSG::MSXPSG(), openmsx::MSXRS232::MSXRS232(), openmsx::MSXRTC::MSXRTC(), openmsx::MSXSCCPlusCart::MSXSCCPlusCart(), openmsx::MSXTurboRPCM::MSXTurboRPCM(), openmsx::MSXYamahaSFG::MSXYamahaSFG(), openmsx::VDP::peekIO(), openmsx::PhilipsFDC::PhilipsFDC(), openmsx::PioneerLDControl::PioneerLDControl(), openmsx::RomKonamiSCC::RomKonamiSCC(), openmsx::RomManbow2::RomManbow2(), openmsx::RomSynthesizer::RomSynthesizer(), openmsx::SensorKid::SensorKid(), openmsx::MSXMoonSound::serialize(), openmsx::SVIPSG::serialize(), openmsx::SVIPPI::serialize(), openmsx::MSXPSG::serialize(), openmsx::ChakkariCopy::serialize(), openmsx::PioneerLDControl::serialize(), openmsx::MSXAudio::serialize(), openmsx::MSXPPI::serialize(), openmsx::V9990::serialize(), openmsx::SpectravideoFDC::SpectravideoFDC(), openmsx::SunriseIDE::SunriseIDE(), openmsx::SVIPPI::SVIPPI(), openmsx::SVIPrinterPort::SVIPrinterPort(), openmsx::SVIPSG::SVIPSG(), openmsx::TurboRFDC::TurboRFDC(), openmsx::V9990::V9990(), openmsx::VDP::VDP(), openmsx::VictorFDC::VictorFDC(), and openmsx::V9990::writeIO().

◆ getDeviceConfig()

const XMLElement& openmsx::MSXDevice::getDeviceConfig ( ) const
inline

Get the configuration section for this device.

This was passed as a constructor argument.

Definition at line 212 of file MSXDevice.hh.

References openmsx::DeviceConfig::getXML().

Referenced by getDeviceInfo(), openmsx::MSXRom::getExtraDeviceInfo(), openmsx::VDP::getMSX1Palette(), getPluggingController(), getVisibleMemRegion(), MSXDevice(), openmsx::MSXRam::MSXRam(), and testRemove().

◆ getDeviceConfig2()

const DeviceConfig& openmsx::MSXDevice::getDeviceConfig2 ( ) const
inline

◆ getDeviceInfo()

void openmsx::MSXDevice::getDeviceInfo ( TclObject result) const

Get device info.

Used by the 'machine_info device' command.

Definition at line 383 of file MSXDevice.cc.

References openmsx::TclObject::addListElement(), getDeviceConfig(), getExtraDeviceInfo(), and getName().

Referenced by openmsx::DeviceInfo::execute(), and getHardwareConfig().

◆ getExtraDeviceInfo()

void openmsx::MSXDevice::getExtraDeviceInfo ( TclObject result) const
protectedvirtual
See also
getDeviceInfo() Default implementation does nothing. Subclasses can override this method to add extra info (like subtypes).

Reimplemented in openmsx::MSXRom.

Definition at line 389 of file MSXDevice.cc.

Referenced by getDeviceInfo().

◆ getHardwareConfig()

const HardwareConfig& openmsx::MSXDevice::getHardwareConfig ( ) const
inline

◆ getLedStatus()

LedStatus & openmsx::MSXDevice::getLedStatus ( ) const

◆ getMotherBoard()

MSXMotherBoard & openmsx::MSXDevice::getMotherBoard ( ) const

◆ getName()

string openmsx::MSXDevice::getName ( ) const
virtual

◆ getNameList()

void openmsx::MSXDevice::getNameList ( TclObject result) const
virtual

Returns list of name(s) of this device.

This is normally the same as getName() (but formatted as a Tcl list) except for multi-{mem,io}-devices.

Reimplemented in openmsx::MSXMultiIODevice, openmsx::MSXMultiMemDevice, and openmsx::DummyDevice.

Definition at line 378 of file MSXDevice.cc.

References openmsx::TclObject::addListElement(), and getName().

Referenced by getHardwareConfig().

◆ getPluggingController()

PluggingController & openmsx::MSXDevice::getPluggingController ( ) const

◆ getReactor()

Reactor & openmsx::MSXDevice::getReactor ( ) const

◆ getReadCacheLine()

const byte * openmsx::MSXDevice::getReadCacheLine ( word  start) const
virtual

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. The start of the interval is CacheLine::SIZE aligned.

Reimplemented in openmsx::MSXMusicWX, openmsx::BeerIDE, openmsx::RomFSA1FM2, openmsx::MSXAudio, openmsx::MSXRS232, openmsx::NowindInterface, openmsx::MSXMultiMemDevice, openmsx::RomManbow2, openmsx::ChakkariCopy, openmsx::PioneerLDControl, openmsx::RomMitsubishiMLTS2, openmsx::MegaFlashRomSCCPlusSD, openmsx::SunriseIDE, openmsx::ESE_SCC, openmsx::MSXSCCPlusCart, openmsx::MSXMegaRam, openmsx::RomBlocks< BANK_SIZE_ >, openmsx::TurboRFDC, openmsx::MegaSCSI, openmsx::MegaFlashRomSCCPlus, openmsx::MSXMemoryMapper, openmsx::RomFSA1FM1, openmsx::KonamiUltimateCollection, openmsx::MSXRam, openmsx::MSXFmPac, openmsx::MSXYamahaSFG, openmsx::MSXFDC, openmsx::ESE_RAM, openmsx::RomRamFile, openmsx::SpectravideoFDC, openmsx::GoudaSCSI, openmsx::RomAscii8_8, openmsx::RomHolyQuran2, openmsx::RomKonamiSCC, openmsx::RomMatraInk, openmsx::RomPanasonic, openmsx::MSXBunsetsu, openmsx::MSXMusicBase, openmsx::PhilipsFDC, openmsx::VictorFDC, openmsx::FraelSwitchableROM, openmsx::MSXMirrorDevice, openmsx::MSXPac, openmsx::RomPlayBall, openmsx::NationalFDC, openmsx::SanyoFDC, openmsx::RomAscii16_2, openmsx::RomDRAM, openmsx::RomNational, openmsx::RomHalnote, and openmsx::RomMSXtra.

Definition at line 418 of file MSXDevice.cc.

Referenced by getHardwareConfig(), openmsx::MSXMultiMemDevice::getReadCacheLine(), and peekMem().

◆ getReferences()

const MSXDevice::Devices & openmsx::MSXDevice::getReferences ( ) const

Get the device references that are specified for this device.

Definition at line 129 of file MSXDevice.cc.

Referenced by openmsx::ADVram::ADVram(), getDeviceConfig2(), openmsx::MSXMatsushita::init(), openmsx::Video9000::init(), and openmsx::PioneerLDControl::init().

◆ getScheduler()

Scheduler & openmsx::MSXDevice::getScheduler ( ) const

◆ getVisibleMemRegion()

void openmsx::MSXDevice::getVisibleMemRegion ( unsigned &  base,
unsigned &  size 
) const

Returns the range where this device is visible in memory.

This is the union of the "mem" tags inside the device tag in hardwareconfig.xml (though practically always there is only one "mem" tag). Information on possible holes in this range (when there are multiple "mem" tags) is not returned by this method.

Definition at line 299 of file MSXDevice.cc.

References begin(), end(), getCPUInterface(), getDeviceConfig(), gl::max(), gl::min(), openmsx::MSXCPUInterface::register_IO_In(), and openmsx::MSXCPUInterface::register_IO_Out().

Referenced by getHardwareConfig(), and openmsx::MSXRam::MSXRam().

◆ getWriteCacheLine()

byte * openmsx::MSXDevice::getWriteCacheLine ( word  start) const
virtual

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. The start of the interval is CacheLine::SIZE aligned.

Reimplemented in openmsx::MSXMusicWX, openmsx::RomFSA1FM2, openmsx::MSXAudio, openmsx::MSXRS232, openmsx::NowindInterface, openmsx::ChakkariCopy, openmsx::MSXMultiMemDevice, openmsx::RomManbow2, openmsx::PioneerLDControl, openmsx::MegaFlashRomSCCPlusSD, openmsx::ESE_SCC, openmsx::MSXMegaRam, openmsx::RomMitsubishiMLTS2, openmsx::MSXSCCPlusCart, openmsx::RomFSA1FM1, openmsx::MegaFlashRomSCCPlus, openmsx::TurboRFDC, openmsx::MegaSCSI, openmsx::KonamiUltimateCollection, openmsx::MSXMemoryMapper, openmsx::MSXYamahaSFG, openmsx::MSXRam, openmsx::RomRamFile, openmsx::MSXFmPac, openmsx::ESE_RAM, openmsx::RomKonamiSCC, openmsx::RomPanasonic, openmsx::SpectravideoFDC, openmsx::RomAscii8_8, openmsx::RomHolyQuran2, openmsx::RomMatraInk, openmsx::RomPlayBall, openmsx::MSXBunsetsu, openmsx::PhilipsFDC, openmsx::VictorFDC, openmsx::MSXMirrorDevice, openmsx::MSXPac, openmsx::RomAscii16_2, openmsx::RomDooly, openmsx::RomNational, openmsx::NationalFDC, openmsx::SanyoFDC, openmsx::RomHalnote, openmsx::RomMSXtra, openmsx::PanasonicRam, openmsx::RomAscii16kB, openmsx::RomAscii8kB, openmsx::RomKonami, openmsx::RomMajutsushi, openmsx::RomMSXWrite, openmsx::RomNettouYakyuu, openmsx::RomSynthesizer, openmsx::RomZemina90in1, openmsx::RomCrossBlaim, openmsx::RomGameMaster2, openmsx::RomGeneric16kB, openmsx::RomGeneric8kB, openmsx::RomHarryFox, openmsx::RomHolyQuran, openmsx::RomMSXDOS2, openmsx::RomRType, openmsx::RomSuperSwangi, openmsx::RomZemina126in1, openmsx::RomZemina80in1, and openmsx::MSXRom.

Definition at line 447 of file MSXDevice.cc.

Referenced by getHardwareConfig(), and openmsx::MSXMultiMemDevice::getWriteCacheLine().

◆ globalWrite()

void openmsx::MSXDevice::globalWrite ( word  address,
byte  value,
EmuTime::param  time 
)
virtual

Global writes.

Some devices violate the MSX standard by ignoring the SLOT-SELECT signal; they react to writes to a certain address in any slot. Luckily the only known example so far is 'Super Lode Runner'. This method is triggered for such 'global' writes. You need to register each address for which you want this method to be triggered.

Reimplemented in openmsx::RomSuperLodeRunner.

Definition at line 441 of file MSXDevice.cc.

References UNREACHABLE.

Referenced by getHardwareConfig().

◆ init()

void openmsx::MSXDevice::init ( )
protectedvirtual

◆ invalidateMemCache()

void openmsx::MSXDevice::invalidateMemCache ( word  start,
unsigned  size 
)

Invalidate CPU memory-mapping cache.

This is a shortcut to the MSXCPU::invalidateMemCache() method, see that method for more details.

Definition at line 452 of file MSXDevice.cc.

References getCPU(), and openmsx::MSXCPU::invalidateMemCache().

Referenced by getHardwareConfig(), openmsx::MSXPac::getWriteCacheLine(), openmsx::ESE_RAM::getWriteCacheLine(), openmsx::MSXFmPac::getWriteCacheLine(), openmsx::MegaSCSI::getWriteCacheLine(), openmsx::MSXSCCPlusCart::getWriteCacheLine(), openmsx::MegaFlashRomSCCPlusSD::getWriteCacheLine(), openmsx::ChakkariCopy::getWriteCacheLine(), openmsx::RomFSA1FM2::getWriteCacheLine(), openmsx::MSXMegaRam::readIO(), openmsx::FraelSwitchableROM::reset(), openmsx::KonamiUltimateCollection::reset(), openmsx::MegaFlashRomSCCPlus::reset(), openmsx::ESE_SCC::reset(), openmsx::MegaFlashRomSCCPlusSD::reset(), openmsx::RomManbow2::reset(), openmsx::RomBlocks< BANK_SIZE_ >::setBank(), openmsx::MSXMapperIO::writeIO(), openmsx::FraelSwitchableROM::writeIO(), openmsx::ChakkariCopy::writeIO(), openmsx::MSXMegaRam::writeIO(), openmsx::MegaFlashRomSCCPlusSD::writeIO(), openmsx::RomHalnote::writeMem(), openmsx::RomAscii16_2::writeMem(), openmsx::MSXFmPac::writeMem(), openmsx::RomKonamiSCC::writeMem(), openmsx::TurboRFDC::writeMem(), openmsx::KonamiUltimateCollection::writeMem(), openmsx::RomFSA1FM1::writeMem(), openmsx::MegaFlashRomSCCPlus::writeMem(), openmsx::SunriseIDE::writeMem(), openmsx::RomManbow2::writeMem(), openmsx::MegaFlashRomSCCPlusSD::writeMem(), openmsx::NowindInterface::writeMem(), and openmsx::MSXMusicWX::writeMem().

◆ operator=()

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

◆ peekIO()

byte openmsx::MSXDevice::peekIO ( word  port,
EmuTime::param  time 
) const
virtual

◆ peekMem()

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

Read a byte from a given memory location.

Reading memory via this method has no side effects (doesn't change the device status). If save reading is not possible this method returns 0xFF. This method is not used by the emulation. It can however be used by a debugger. The default implementation uses the cache mechanism (getReadCacheLine() method). If a certain region is not cacheable you cannot read it by default, Override this method if you want to improve this behaviour.

Reimplemented in openmsx::MSXMusicWX, openmsx::RomFSA1FM2, openmsx::MSXAudio, openmsx::ChakkariCopy, openmsx::MSXMultiMemDevice, openmsx::NowindInterface, openmsx::PioneerLDControl, openmsx::RomManbow2, openmsx::RomMitsubishiMLTS2, openmsx::MegaFlashRomSCCPlusSD, openmsx::MSXMemoryMapper, openmsx::ESE_SCC, openmsx::MSXRam, openmsx::MSXSCCPlusCart, openmsx::RomBlocks< BANK_SIZE_ >, openmsx::TurboRFDC, openmsx::MegaSCSI, openmsx::MegaFlashRomSCCPlus, openmsx::MSXMirrorDevice, openmsx::RomFSA1FM1, openmsx::MSXYamahaSFG, openmsx::MSXFDC, openmsx::KonamiUltimateCollection, openmsx::RomRamFile, openmsx::SpectravideoFDC, openmsx::RomHolyQuran2, openmsx::RomKonamiSCC, openmsx::RomPanasonic, openmsx::MSXMusicBase, openmsx::PhilipsFDC, openmsx::VictorFDC, openmsx::RomDooly, openmsx::RomMatraInk, openmsx::RomPlayBall, openmsx::NationalFDC, openmsx::SanyoFDC, openmsx::RomNational, and openmsx::MSXVictorHC9xSystemControl.

Definition at line 429 of file MSXDevice.cc.

References getReadCacheLine().

Referenced by getHardwareConfig(), openmsx::MSXMultiMemDevice::peekMem(), openmsx::MSXCPUInterface::peekMem(), openmsx::MSXCPUInterface::peekSlottedMem(), and openmsx::MSXCPUInterface::readSlottedMem().

◆ powerDown()

void openmsx::MSXDevice::powerDown ( EmuTime::param  time)
virtual

This method is called when MSX is powered down.

The default implementation does nothing, this is usually ok. Typically devices that need to turn off LEDs need to reimplement this method.

Parameters
timeThe moment in time the power down occurs.

Reimplemented in openmsx::MSXPPI, openmsx::MSXTurboRPause, openmsx::MSXPSG, openmsx::SVIPSG, openmsx::MSXFDC, and openmsx::MSXMultiDevice.

Definition at line 363 of file MSXDevice.cc.

Referenced by getHardwareConfig().

◆ powerUp()

void openmsx::MSXDevice::powerUp ( EmuTime::param  time)
virtual

◆ readIO()

byte openmsx::MSXDevice::readIO ( word  port,
EmuTime::param  time 
)
virtual

◆ readIRQVector()

byte openmsx::MSXDevice::readIRQVector ( )
virtual

Gets IRQ vector used in IM2.

This method only exists to support YamahaSfg05. There is no way for several devices to coordinate which vector is actually send to the CPU. But this IM is anyway not really supported in the MSX standard. Default implementation returns 0xFF.

Reimplemented in openmsx::MSXYamahaSFG.

Definition at line 358 of file MSXDevice.cc.

Referenced by getHardwareConfig().

◆ readMem()

byte openmsx::MSXDevice::readMem ( word  address,
EmuTime::param  time 
)
virtual

Read a byte from a location at a certain time from this device.

The default implementation returns 255.

Reimplemented in openmsx::MSXMusicWX, openmsx::BeerIDE, openmsx::RomFSA1FM2, openmsx::ADVram, openmsx::MSXAudio, openmsx::MSXRS232, openmsx::NowindInterface, openmsx::RomManbow2, openmsx::ChakkariCopy, openmsx::MSXMultiMemDevice, openmsx::MegaFlashRomSCCPlusSD, openmsx::PioneerLDControl, openmsx::RomMitsubishiMLTS2, openmsx::SunriseIDE, openmsx::ESE_SCC, openmsx::MSXMegaRam, openmsx::MSXSCCPlusCart, openmsx::MegaFlashRomSCCPlus, openmsx::RomBlocks< BANK_SIZE_ >, openmsx::RomFSA1FM1, openmsx::KonamiUltimateCollection, openmsx::MSXMemoryMapper, openmsx::TurboRFDC, openmsx::MegaSCSI, openmsx::MSXRam, openmsx::MSXFmPac, openmsx::MSXYamahaSFG, openmsx::MSXFDC, openmsx::GoudaSCSI, openmsx::ESE_RAM, openmsx::RomKonamiSCC, openmsx::RomPanasonic, openmsx::RomRamFile, openmsx::MSXMusicBase, openmsx::FraelSwitchableROM, openmsx::RomAscii8_8, openmsx::RomDooly, openmsx::RomMatraInk, openmsx::RomPlayBall, openmsx::MSXBunsetsu, openmsx::SpectravideoFDC, openmsx::MSXMirrorDevice, openmsx::MSXPac, openmsx::RomAscii16_2, openmsx::RomDRAM, openmsx::RomHolyQuran2, openmsx::RomNational, openmsx::PhilipsFDC, openmsx::VictorFDC, openmsx::RomHalnote, openmsx::RomMSXtra, openmsx::NationalFDC, openmsx::SanyoFDC, and openmsx::MSXVictorHC9xSystemControl.

Definition at line 412 of file MSXDevice.cc.

Referenced by getHardwareConfig(), openmsx::MSXMultiMemDevice::readMem(), and openmsx::MSXCPUInterface::~MSXCPUInterface().

◆ reset()

void openmsx::MSXDevice::reset ( EmuTime::param  time)
virtual

This method is called on reset.

Default implementation does nothing.

Reimplemented in openmsx::VDP, openmsx::MSXDeviceSwitch, openmsx::MSXMusicWX, openmsx::BeerIDE, openmsx::MSXPPI, openmsx::RomFSA1FM2, openmsx::V9990, openmsx::MSXTurboRPause, openmsx::MSXS1985, openmsx::MSXAudio, openmsx::Video9000, openmsx::NowindInterface, openmsx::MSXMatsushita, openmsx::MC6850, openmsx::MSXRS232, openmsx::ADVram, openmsx::RomManbow2, openmsx::MSXE6Timer, openmsx::PioneerLDControl, openmsx::MegaFlashRomSCCPlusSD, openmsx::MSXPSG, openmsx::SVIPPI, openmsx::RomMitsubishiMLTS2, openmsx::SVIPrinterPort, openmsx::ChakkariCopy, openmsx::SunriseIDE, openmsx::MSXMegaRam, openmsx::MSXPrinterPort, openmsx::MSXS1990, openmsx::MSXSCCPlusCart, openmsx::ESE_SCC, openmsx::MSXResetStatusRegister, openmsx::MSXMidi, openmsx::MSXTurboRPCM, openmsx::SVIPSG, openmsx::MegaFlashRomSCCPlus, openmsx::RomFSA1FM1, openmsx::TurboRFDC, openmsx::KonamiUltimateCollection, openmsx::MSXMemoryMapper, openmsx::MSXKanji, openmsx::MSXMoonSound, openmsx::MSXYamahaSFG, openmsx::MegaSCSI, openmsx::MSXHBI55, openmsx::RomRamFile, openmsx::MSXKanji12, openmsx::MSXFacMidiInterface, openmsx::MSXFmPac, openmsx::DebugDevice, openmsx::GoudaSCSI, openmsx::ESE_RAM, openmsx::MSXMapperIO, openmsx::RomAscii8_8, openmsx::RomKonamiKeyboardMaster, openmsx::RomKonamiSCC, openmsx::RomMultiRom, openmsx::RomPanasonic, openmsx::MSXRTC, openmsx::SpectravideoFDC, openmsx::WD2793BasedFDC, openmsx::FraelSwitchableROM, openmsx::MSXPac, openmsx::RomArc, openmsx::RomAscii16_2, openmsx::RomAscii16kB, openmsx::RomAscii8kB, openmsx::RomDooly, openmsx::RomHolyQuran2, openmsx::RomKonami, openmsx::RomMajutsushi, openmsx::RomMatraInk, openmsx::RomMSXWrite, openmsx::RomNettouYakyuu, openmsx::RomPlayBall, openmsx::RomSuperLodeRunner, openmsx::RomSynthesizer, openmsx::RomZemina90in1, openmsx::MSXBunsetsu, openmsx::MSXCielTurbo, openmsx::MSXHiResTimer, openmsx::SensorKid, openmsx::MSXMusicBase, openmsx::MSXOPL3Cartridge, openmsx::MSXMultiDevice, openmsx::PhilipsFDC, openmsx::VictorFDC, openmsx::RomCrossBlaim, openmsx::RomGameMaster2, openmsx::RomGeneric16kB, openmsx::RomGeneric8kB, openmsx::RomHalnote, openmsx::RomHarryFox, openmsx::RomHolyQuran, openmsx::RomMSXDOS2, openmsx::RomNational, openmsx::RomPadial16kB, openmsx::RomPadial8kB, openmsx::RomRType, openmsx::RomSuperSwangi, openmsx::RomZemina126in1, openmsx::RomZemina80in1, openmsx::PasswordCart, and openmsx::DummyDevice.

Definition at line 353 of file MSXDevice.cc.

Referenced by getHardwareConfig(), and powerUp().

◆ serialize()

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

Definition at line 458 of file MSXDevice.cc.

Referenced by getDeviceConfig2().

◆ testRemove()

void openmsx::MSXDevice::testRemove ( Devices  alreadyRemoved) const

Checks whether this device can be removed (no other device has a reference to it).

Throws an exception if it can't be removed.

Definition at line 82 of file MSXDevice.cc.

References begin(), end(), openmsx::MSXMotherBoard::findDevice(), getDeviceConfig(), getMotherBoard(), getName(), move_pop_back(), and rfind_unguarded().

Referenced by getHardwareConfig().

◆ writeIO()

void openmsx::MSXDevice::writeIO ( word  port,
byte  value,
EmuTime::param  time 
)
virtual

◆ writeMem()

void openmsx::MSXDevice::writeMem ( word  address,
byte  value,
EmuTime::param  time 
)
virtual

Write a given byte to a given location at a certain time to this device.

The default implementation ignores the write (does nothing).

Reimplemented in openmsx::MSXMusicWX, openmsx::ADVram, openmsx::RomFSA1FM2, openmsx::MSXAudio, openmsx::MSXRS232, openmsx::ChakkariCopy, openmsx::NowindInterface, openmsx::MSXMultiMemDevice, openmsx::MegaFlashRomSCCPlusSD, openmsx::RomManbow2, openmsx::PioneerLDControl, openmsx::SunriseIDE, openmsx::ESE_SCC, openmsx::MSXMegaRam, openmsx::MSXSCCPlusCart, openmsx::MegaFlashRomSCCPlus, openmsx::RomFSA1FM1, openmsx::RomMitsubishiMLTS2, openmsx::KonamiUltimateCollection, openmsx::MSXYamahaSFG, openmsx::TurboRFDC, openmsx::MegaSCSI, openmsx::MSXMemoryMapper, openmsx::RomRamFile, openmsx::MSXRam, openmsx::RomKonamiSCC, openmsx::RomPanasonic, openmsx::MSXFmPac, openmsx::ESE_RAM, openmsx::RomPlayBall, openmsx::SpectravideoFDC, openmsx::RomAscii16_2, openmsx::RomAscii8_8, openmsx::RomDooly, openmsx::RomHolyQuran2, openmsx::RomMatraInk, openmsx::RomNational, openmsx::MSXBunsetsu, openmsx::PhilipsFDC, openmsx::VictorFDC, openmsx::MSXMirrorDevice, openmsx::MSXPac, openmsx::RomHalnote, openmsx::RomMSXtra, openmsx::NationalFDC, openmsx::SanyoFDC, openmsx::PanasonicRam, openmsx::RomAscii16kB, openmsx::RomAscii8kB, openmsx::RomKonami, openmsx::RomMajutsushi, openmsx::RomMSXWrite, openmsx::RomNettouYakyuu, openmsx::RomSynthesizer, openmsx::MSXVictorHC9xSystemControl, openmsx::RomCrossBlaim, openmsx::RomGameMaster2, openmsx::RomGeneric16kB, openmsx::RomGeneric8kB, openmsx::RomHarryFox, openmsx::RomHolyQuran, openmsx::RomMSXDOS2, openmsx::RomRType, openmsx::RomSuperSwangi, openmsx::RomZemina126in1, openmsx::RomZemina80in1, and openmsx::MSXRom.

Definition at line 423 of file MSXDevice.cc.

Referenced by getHardwareConfig(), openmsx::MSXMultiMemDevice::writeMem(), openmsx::MSXCPUInterface::writeSlottedMem(), and openmsx::MSXCPUInterface::~MSXCPUInterface().

Friends And Related Function Documentation

◆ DeviceFactory

friend class DeviceFactory
friend

Constructing a MSXDevice is a 2-step process, after the constructor is called this init() method must be called.

The reason is exception safety (init() might throw and we use the destructor to clean up some stuff, this is more difficult when everything is done in the constrcutor). This is also a non-public method. This means you can only construct MSXDevices via DeviceFactory. In rare cases you need to override this method, for example when you need to access the referenced devices already during construction of this device (e.g. ADVram)

Definition at line 257 of file MSXDevice.hh.

Member Data Documentation

◆ unmappedRead

byte openmsx::MSXDevice::unmappedRead
static

Definition at line 268 of file MSXDevice.hh.

Referenced by openmsx::RomMSXtra::getReadCacheLine(), openmsx::SanyoFDC::getReadCacheLine(), openmsx::NationalFDC::getReadCacheLine(), openmsx::MSXPac::getReadCacheLine(), openmsx::VictorFDC::getReadCacheLine(), openmsx::PhilipsFDC::getReadCacheLine(), openmsx::SpectravideoFDC::getReadCacheLine(), openmsx::RomHolyQuran2::getReadCacheLine(), openmsx::ESE_RAM::getReadCacheLine(), openmsx::RomRamFile::getReadCacheLine(), openmsx::KonamiUltimateCollection::getReadCacheLine(), openmsx::MSXFmPac::getReadCacheLine(), openmsx::TurboRFDC::getReadCacheLine(), openmsx::MegaSCSI::getReadCacheLine(), openmsx::RomFSA1FM1::getReadCacheLine(), openmsx::MegaFlashRomSCCPlus::getReadCacheLine(), openmsx::MSXMegaRam::getReadCacheLine(), openmsx::SunriseIDE::getReadCacheLine(), openmsx::MSXSCCPlusCart::getReadCacheLine(), openmsx::MegaFlashRomSCCPlusSD::getReadCacheLine(), openmsx::PioneerLDControl::getReadCacheLine(), openmsx::ChakkariCopy::getReadCacheLine(), openmsx::RomManbow2::getReadCacheLine(), openmsx::NowindInterface::getReadCacheLine(), openmsx::MSXRS232::getReadCacheLine(), openmsx::RomFSA1FM2::getReadCacheLine(), openmsx::Y8950Periphery::getReadCacheLine(), openmsx::BeerIDE::getReadCacheLine(), openmsx::MSXMusicWX::getReadCacheLine(), openmsx::AmdFlash::getReadCacheLine(), openmsx::MSXSCCPlusCart::getWriteCacheLine(), openmsx::MegaFlashRomSCCPlusSD::getWriteCacheLine(), openmsx::RomBlocks< BANK_SIZE_ >::serialize(), openmsx::RomBlocks< BANK_SIZE_ >::setBank(), openmsx::RomBlocks< BANK_SIZE_ >::setRom(), openmsx::RomBlocks< BANK_SIZE_ >::setUnmapped(), and ~MSXDevice().

◆ unmappedWrite

byte openmsx::MSXDevice::unmappedWrite
static

Definition at line 269 of file MSXDevice.hh.

Referenced by openmsx::MSXRom::getWriteCacheLine(), openmsx::RomMSXDOS2::getWriteCacheLine(), openmsx::RomRType::getWriteCacheLine(), openmsx::RomSuperSwangi::getWriteCacheLine(), openmsx::RomZemina126in1::getWriteCacheLine(), openmsx::RomGameMaster2::getWriteCacheLine(), openmsx::RomGeneric16kB::getWriteCacheLine(), openmsx::RomZemina80in1::getWriteCacheLine(), openmsx::RomGeneric8kB::getWriteCacheLine(), openmsx::RomHarryFox::getWriteCacheLine(), openmsx::RomHolyQuran::getWriteCacheLine(), openmsx::PanasonicRam::getWriteCacheLine(), openmsx::RomKonami::getWriteCacheLine(), openmsx::RomMSXWrite::getWriteCacheLine(), openmsx::RomAscii16kB::getWriteCacheLine(), openmsx::RomAscii8kB::getWriteCacheLine(), openmsx::RomSynthesizer::getWriteCacheLine(), openmsx::RomZemina90in1::getWriteCacheLine(), openmsx::RomMSXtra::getWriteCacheLine(), openmsx::SanyoFDC::getWriteCacheLine(), openmsx::NationalFDC::getWriteCacheLine(), openmsx::RomHalnote::getWriteCacheLine(), openmsx::MSXPac::getWriteCacheLine(), openmsx::PhilipsFDC::getWriteCacheLine(), openmsx::RomNational::getWriteCacheLine(), openmsx::RomDooly::getWriteCacheLine(), openmsx::VictorFDC::getWriteCacheLine(), openmsx::RomHolyQuran2::getWriteCacheLine(), openmsx::MSXBunsetsu::getWriteCacheLine(), openmsx::RomAscii8_8::getWriteCacheLine(), openmsx::RomPlayBall::getWriteCacheLine(), openmsx::SpectravideoFDC::getWriteCacheLine(), openmsx::RomKonamiSCC::getWriteCacheLine(), openmsx::RomPanasonic::getWriteCacheLine(), openmsx::ESE_RAM::getWriteCacheLine(), openmsx::RomRamFile::getWriteCacheLine(), openmsx::MSXFmPac::getWriteCacheLine(), openmsx::MegaSCSI::getWriteCacheLine(), openmsx::TurboRFDC::getWriteCacheLine(), openmsx::KonamiUltimateCollection::getWriteCacheLine(), openmsx::MSXYamahaSFG::getWriteCacheLine(), openmsx::RomFSA1FM1::getWriteCacheLine(), openmsx::MSXMegaRam::getWriteCacheLine(), openmsx::RomMitsubishiMLTS2::getWriteCacheLine(), openmsx::MSXSCCPlusCart::getWriteCacheLine(), openmsx::MegaFlashRomSCCPlusSD::getWriteCacheLine(), openmsx::PioneerLDControl::getWriteCacheLine(), openmsx::ChakkariCopy::getWriteCacheLine(), openmsx::RomManbow2::getWriteCacheLine(), openmsx::NowindInterface::getWriteCacheLine(), openmsx::MSXRS232::getWriteCacheLine(), openmsx::RomFSA1FM2::getWriteCacheLine(), openmsx::Y8950Periphery::getWriteCacheLine(), openmsx::PanasonicAudioPeriphery::getWriteCacheLine(), and openmsx::MSXMusicWX::getWriteCacheLine().


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