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
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.
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
void removeDevice(MSXDevice *device)
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX...
Definition: MSXDevice.hh:31
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
MSXMultiIODevice(const HardwareConfig &hwConf)
void addDevice(MSXDevice *device)
std::string getName() const override
Returns a human-readable name for this device.
std::vector< MSXDevice * > Devices
void getNameList(TclObject &result) const override
Returns list of name(s) of this device.