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
7namespace openmsx {
8
9class MSXMultiIODevice final : public MSXMultiDevice
10{
11public:
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 [[nodiscard]] Devices& getDevices() { return devices; }
20
21 // MSXDevice
22 [[nodiscard]] const std::string& getName() const override;
23 void getNameList(TclObject& result) const override;
24 [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
25 [[nodiscard]] byte peekIO(word port, EmuTime::param time) const override;
26 void writeIO(word port, byte value, EmuTime::param time) override;
27
28private:
29 Devices devices; // ordered to get predictable readIO() conflict resolution
30};
31
32} // namespace openmsx
33
34#endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
void addDevice(MSXDevice *device)
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.
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
std::vector< MSXDevice * > Devices
void getNameList(TclObject &result) const override
Returns list of name(s) of this device.
void removeDevice(MSXDevice *device)
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
const std::string & getName() const override
Returns a human-readable name for this device.
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29