openMSX
MSXMultiIODevice.hh
Go to the documentation of this file.
1 #ifndef MSXMULTIIODEVICE_HH
2 #define MSXMULTIIODEVICE_HH
3 
4 #include "MSXMultiDevice.hh"
5 #include <vector>
6 
7 namespace openmsx {
8 
9 class MSXMultiIODevice final : public MSXMultiDevice
10 {
11 public:
12  using Devices = std::vector<MSXDevice*>;
13 
14  explicit MSXMultiIODevice(const HardwareConfig& hwConf);
15  ~MSXMultiIODevice() override;
16 
17  void addDevice(MSXDevice* device);
18  void removeDevice(MSXDevice* device);
19  Devices& getDevices() { return devices; }
20 
21  // MSXDevice
22  std::string getName() const override;
23  void getNameList(TclObject& result) const override;
24  byte readIO(word port, EmuTime::param time) override;
25  byte peekIO(word port, EmuTime::param time) const override;
26  void writeIO(word port, byte value, EmuTime::param time) override;
27 
28 private:
29  Devices devices; // ordered to get predictable readIO() conflict resolution
30 };
31 
32 } // namespace openmsx
33 
34 #endif
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
openmsx::MSXMultiIODevice::Devices
std::vector< MSXDevice * > Devices
Definition: MSXMultiIODevice.hh:12
openmsx::MSXMultiIODevice::writeIO
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
Definition: MSXMultiIODevice.cc:72
openmsx::MSXMultiDevice
Definition: MSXMultiDevice.hh:9
openmsx::MSXMultiIODevice
Definition: MSXMultiIODevice.hh:10
openmsx::MSXMultiIODevice::getName
std::string getName() const override
Returns a human-readable name for this device.
Definition: MSXMultiIODevice.cc:34
MSXMultiDevice.hh
openmsx::MSXMultiIODevice::addDevice
void addDevice(MSXDevice *device)
Definition: MSXMultiIODevice.cc:19
openmsx::MSXMultiIODevice::readIO
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: MSXMultiIODevice.cc:50
openmsx::MSXMultiIODevice::getDevices
Devices & getDevices()
Definition: MSXMultiIODevice.hh:19
openmsx::MSXMultiIODevice::MSXMultiIODevice
MSXMultiIODevice(const HardwareConfig &hwConf)
Definition: MSXMultiIODevice.cc:9
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::MSXMultiIODevice::~MSXMultiIODevice
~MSXMultiIODevice() override
Definition: MSXMultiIODevice.cc:14
openmsx::HardwareConfig
Definition: HardwareConfig.hh:22
openmsx::TclObject
Definition: TclObject.hh:22
openmsx::MSXMultiIODevice::peekIO
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: MSXMultiIODevice.cc:62
openmsx::MSXMultiIODevice::getNameList
void getNameList(TclObject &result) const override
Returns list of name(s) of this device.
Definition: MSXMultiIODevice.cc:40
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::MSXMultiIODevice::removeDevice
void removeDevice(MSXDevice *device)
Definition: MSXMultiIODevice.cc:29