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 "AY8910.hh"
6#include "AY8910Periphery.hh"
7#include <array>
8
9namespace openmsx {
10
11class JoystickPortIf;
12
13class SVIPSG final : public MSXDevice, public AY8910Periphery
14{
15public:
16 SVIPSG(const DeviceConfig& config);
17 ~SVIPSG() override;
18
19 void reset(EmuTime::param time) override;
20 void powerDown(EmuTime::param time) override;
21 [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
22 [[nodiscard]] 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
28private:
29 // AY8910Periphery: port A input, port B output
30 [[nodiscard]] byte readA(EmuTime::param time) override;
31 void writeB(byte value, EmuTime::param time) override;
32
33private:
34 std::array<JoystickPortIf*, 2> ports;
35 AY8910 ay8910; // must come after ports
36 int registerLatch;
37 byte prev = 255;
38};
39
40} // namespace openmsx
41
42#endif
Models the general purpose I/O ports of the AY8910.
This class implements the AY-3-8910 sound chip.
Definition: AY8910.hh:21
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:34
void powerDown(EmuTime::param time) override
This method is called when MSX is powered down.
Definition: SVIPSG.cc:68
SVIPSG(const DeviceConfig &config)
Definition: SVIPSG.cc:49
~SVIPSG() override
Definition: SVIPSG.cc:57
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: SVIPSG.cc:78
void serialize(Archive &ar, unsigned version)
Definition: SVIPSG.cc:138
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:73
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:83
void reset(EmuTime::param time) override
This method is called on reset.
Definition: SVIPSG.cc:62
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29