openMSX
SVIPSG.hh
Go to the documentation of this file.
1 #ifndef SVIPSG_HH
2 #define SVIPSG_HH
3 
4 #include "MSXDevice.hh"
5 #include "AY8910Periphery.hh"
6 #include <memory>
7 
8 namespace openmsx {
9 
10 class AY8910;
11 class JoystickPortIf;
12 
13 class SVIPSG final : public MSXDevice, public AY8910Periphery
14 {
15 public:
16  SVIPSG(const DeviceConfig& config);
17  ~SVIPSG() override;
18 
19  void reset(EmuTime::param time) override;
20  void powerDown(EmuTime::param time) override;
21  byte readIO(word port, EmuTime::param time) override;
22  byte peekIO(word port, EmuTime::param time) const override;
23  void writeIO(word port, byte value, EmuTime::param time) override;
24 
25  template<typename Archive>
26  void serialize(Archive& ar, unsigned version);
27 
28 private:
29  // AY8910Periphery: port A input, port B output
30  byte readA(EmuTime::param time) override;
31  void writeB(byte value, EmuTime::param time) override;
32 
33  std::unique_ptr<AY8910> ay8910;
34  JoystickPortIf* ports[2];
35 
36  int registerLatch;
37  byte prev;
38 };
39 
40 } // namespace openmsx
41 
42 #endif
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
openmsx::SVIPSG::SVIPSG
SVIPSG(const DeviceConfig &config)
Definition: SVIPSG.cc:50
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
openmsx::SVIPSG::serialize
void serialize(Archive &ar, unsigned version)
Definition: SVIPSG.cc:144
openmsx::AY8910
AY8910
Definition: AY8910.cc:1021
openmsx::SVIPSG::writeIO
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: SVIPSG.cc:89
openmsx::AY8910Periphery
Models the general purpose I/O ports of the AY8910.
Definition: AY8910Periphery.hh:15
openmsx::JoystickPortIf
Definition: JoystickPort.hh:13
openmsx::SVIPSG
Definition: SVIPSG.hh:14
MSXDevice.hh
openmsx::SVIPSG::powerDown
void powerDown(EmuTime::param time) override
This method is called when MSX is powered down.
Definition: SVIPSG.cc:74
openmsx::SVIPSG::peekIO
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: SVIPSG.cc:84
openmsx::SVIPSG::readIO
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: SVIPSG.cc:79
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::SVIPSG::~SVIPSG
~SVIPSG() override
Definition: SVIPSG.cc:63
openmsx::SVIPSG::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: SVIPSG.cc:68
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
AY8910Periphery.hh