openMSX
VDPIODelay.hh
Go to the documentation of this file.
1 #ifndef VDPIODELAY_HH
2 #define VDPIODELAY_HH
3 
4 #include "MSXDevice.hh"
5 #include "Clock.hh"
6 
7 namespace openmsx {
8 
9 class MSXCPU;
10 class MSXCPUInterface;
11 
12 class VDPIODelay final : public MSXDevice
13 {
14 public:
15  VDPIODelay(const DeviceConfig& config, MSXCPUInterface& cpuInterface);
16 
17  [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
18  [[nodiscard]] byte peekIO(word port, EmuTime::param time) const override;
19  void writeIO(word port, byte value, EmuTime::param time) override;
20 
21  [[nodiscard]] const MSXDevice& getInDevice(byte port) const;
22  [[nodiscard]] MSXDevice*& getInDevicePtr (byte port);
23  [[nodiscard]] MSXDevice*& getOutDevicePtr(byte port);
24 
25  template<typename Archive>
26  void serialize(Archive& ar, unsigned version);
27 
28 private:
29  void delay(EmuTime::param time);
30 
31 private:
32  MSXCPU& cpu;
33  MSXDevice* inDevices[4];
34  MSXDevice* outDevices[4];
36  Clock<7159090> lastTime;
37 };
38 
39 } // namespace openmsx
40 
41 #endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
void serialize(Archive &ar, unsigned version)
Definition: VDPIODelay.cc:72
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: VDPIODelay.cc:40
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: VDPIODelay.cc:46
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: VDPIODelay.cc:51
const MSXDevice & getInDevice(byte port) const
Definition: VDPIODelay.cc:22
MSXDevice *& getOutDevicePtr(byte port)
Definition: VDPIODelay.cc:34
MSXDevice *& getInDevicePtr(byte port)
Definition: VDPIODelay.cc:28
VDPIODelay(const DeviceConfig &config, MSXCPUInterface &cpuInterface)
Definition: VDPIODelay.cc:11
This file implemented 3 utility functions:
Definition: Autofire.cc:5
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29