Go to the documentation of this file.
21 class CommandController;
23 class PluggingController;
56 virtual void reset(EmuTime::param time);
73 virtual void powerDown(EmuTime::param time);
80 virtual void powerUp(EmuTime::param time);
86 [[nodiscard]]
virtual std::string
getName()
const;
113 [[nodiscard]]
virtual byte readIO(
word port, EmuTime::param time);
120 virtual void writeIO(
word port,
byte value, EmuTime::param time);
130 [[nodiscard]]
virtual byte peekIO(
word port, EmuTime::param time)
const;
140 [[nodiscard]]
virtual byte readMem(
word address, EmuTime::param time);
147 virtual void writeMem(
word address,
byte value, EmuTime::param time);
187 [[nodiscard]]
virtual byte peekMem(
word address, EmuTime::param time)
const;
197 virtual void globalWrite(
word address,
byte value, EmuTime::param time);
231 return *deviceConfig.
getXML();
252 template<
typename Archive>
253 void serialize(Archive& ar,
unsigned version);
304 template<
typename Action,
typename... Args>
305 void clip(
unsigned start,
unsigned size, Action action, Args... args);
307 void initName(
const std::string& name);
308 static void staticInit();
311 void unlockDevices();
313 void registerSlots();
314 void unregisterSlots();
316 void registerPorts();
317 void unregisterPorts();
320 using MemRegions = std::vector<std::pair<unsigned, unsigned>>;
321 MemRegions memRegions;
322 std::vector<byte> inPorts;
323 std::vector<byte> outPorts;
326 std::string deviceName;
337 #define REGISTER_MSXDEVICE(CLASS, NAME) \
338 REGISTER_POLYMORPHIC_INITIALIZER(MSXDevice, CLASS, NAME);
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
MSXDevice(const MSXDevice &)=delete
void fillDeviceRCache(unsigned start, unsigned size, const byte *rData)
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.
virtual const byte * getReadCacheLine(word start) const
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
REGISTER_BASE_NAME_HELPER(MSXFDC, "FDC")
virtual byte readMem(word address, EmuTime::param time)
Read a byte from a location at a certain time from this device.
virtual void globalRead(word address, EmuTime::param time)
Global reads.
virtual byte * getWriteCacheLine(word start) const
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Scheduler & getScheduler() const
size_t size(std::string_view utf8)
static byte unmappedWrite[0x10000]
MSXDevice & operator=(const MSXDevice &)=delete
void serialize(Archive &ar, unsigned version)
virtual void globalWrite(word address, byte value, EmuTime::param time)
Global writes.
std::vector< MSXDevice * > Devices
MSXCPUInterface & getCPUInterface() const
virtual bool allowUnaligned() const
By default we don't allow unaligned <mem> specifications in the config file.
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.
virtual byte peekMem(word address, EmuTime::param time) const
Read a byte from a given memory location.
virtual byte readIRQVector()
Gets IRQ vector used in IM2.
virtual void reset(EmuTime::param time)
This method is called on reset.
Contains the main loop of openMSX.
void fillDeviceWCache(unsigned start, unsigned size, byte *wData)
void invalidateDeviceWCache()
void getVisibleMemRegion(unsigned &base, unsigned &size) const
Returns the range where this device is visible in memory.
EmuTime::param getCurrentTime() const
void getDeviceInfo(TclObject &result) const
Get device info.
MSXMotherBoard & getMotherBoard() const
Get the mother board this device belongs to.
const HardwareConfig & getHardwareConfig() const
LedStatus & getLedStatus() const
const DeviceConfig & getDeviceConfig2() const
CliComm & getCliComm() const
void invalidateDeviceRCache()
void invalidateDeviceRWCache()
Calls MSXCPUInterface::invalidateXXCache() for the specific (part of) the slot that this device is lo...
virtual void powerDown(EmuTime::param time)
This method is called when MSX is powered down.
virtual unsigned getBaseSizeAlignment() const
The 'base' and 'size' attribute values need to be at least aligned to CacheLine::SIZE.
const Devices & getReferences() const
Get the device references that are specified for this device.
CommandController & getCommandController() const
PluggingController & getPluggingController() const
virtual std::string getName() const
Returns a human-readable name for this device.
virtual byte readIO(word port, EmuTime::param time)
Read a byte from an IO port at a certain time from this device.
const XMLElement * getXML() const
static byte unmappedRead[0x10000]
uint16_t word
16 bit unsigned integer
const HardwareConfig & getHardwareConfig() const
Returns the hardwareconfig this device belongs to.
virtual void getNameList(TclObject &result) const
Returns list of name(s) of this device.
virtual byte peekIO(word port, EmuTime::param time) const
Read a byte from a given IO port.
void testRemove(Devices alreadyRemoved) const
Checks whether this device can be removed (no other device has a reference to it).
Central administration of Connectors and Pluggables.
This file implemented 3 utility functions:
Reactor & getReactor() const
virtual void getExtraDeviceInfo(TclObject &result) const
virtual void powerUp(EmuTime::param time)
This method is called when MSX is powered up.
const XMLElement & getDeviceConfig() const
Get the configuration section for this device.
void fillDeviceRWCache(unsigned start, unsigned size, byte *rwData)
Calls MSXCPUInterface::fillXXCache() for the specific (part of) the slot that this device is located ...