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