| e8555c89 Andy McCall |
1 |
#ifndef SVIPSG_HH |
| 2 |
#define SVIPSG_HH |
| 3 |
|
| 4 |
#include "AY8910.hh" |
| 5 |
#include "AY8910Periphery.hh" |
| 6 |
|
| 7 |
#include "MSXDevice.hh" |
| 8 |
|
| 9 |
#include <array> |
| 10 |
|
| 11 |
namespace openmsx { |
| 12 |
|
| 13 |
class JoystickPortIf; |
| 14 |
|
| 15 |
class SVIPSG final : public MSXDevice, public AY8910Periphery |
| 16 |
{ |
| 17 |
public: |
| 18 |
explicit SVIPSG(const DeviceConfig& config); |
| 19 |
~SVIPSG() override; |
| 20 |
|
| 21 |
void reset(EmuTime time) override; |
| 22 |
void powerDown(EmuTime time) override; |
| 23 |
[[nodiscard]] byte readIO(uint16_t port, EmuTime time) override; |
| 24 |
[[nodiscard]] byte peekIO(uint16_t port, EmuTime time) const override; |
| 25 |
void writeIO(uint16_t port, byte value, EmuTime time) override; |
| 26 |
|
| 27 |
template<typename Archive> |
| 28 |
void serialize(Archive& ar, unsigned version); |
| 29 |
|
| 30 |
private: |
| 31 |
|
| 32 |
[[nodiscard]] byte readA(EmuTime time) override; |
| 33 |
void writeB(byte value, EmuTime time) override; |
| 34 |
|
| 35 |
private: |
| 36 |
std::array<JoystickPortIf*, 2> ports; |
| 37 |
AY8910 ay8910; |
| 38 |
int registerLatch; |
| 39 |
byte prev = 255; |
| 40 |
}; |
| 41 |
|
| 42 |
} |
| 43 |
|
| 44 |
#endif |