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  byte readIO(word port, EmuTime::param time) override;
18  byte peekIO(word port, EmuTime::param time) const override;
19  void writeIO(word port, byte value, EmuTime::param time) override;
20 
21  const MSXDevice& getInDevice(byte port) const;
22  MSXDevice*& getInDevicePtr (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  MSXCPU& cpu;
32  MSXDevice* inDevices[4];
33  MSXDevice* outDevices[4];
35  Clock<7159090> lastTime;
36 };
37 
38 } // namespace openmsx
39 
40 #endif
unsigned char byte
8 bit unsigned integer
Definition: openmsx.hh:33
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:7
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX...
Definition: MSXDevice.hh:32
unsigned short word
16 bit unsigned integer
Definition: openmsx.hh:38
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: VDPIODelay.cc:45
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:39
void serialize(Archive &ar, unsigned version)
Definition: VDPIODelay.cc:72
VDPIODelay(const DeviceConfig &config, MSXCPUInterface &cpuInterface)
Definition: VDPIODelay.cc:10
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:50
MSXDevice *& getOutDevicePtr(byte port)
Definition: VDPIODelay.cc:33
MSXDevice *& getInDevicePtr(byte port)
Definition: VDPIODelay.cc:27
const MSXDevice & getInDevice(byte port) const
Definition: VDPIODelay.cc:21