| e8555c89 Andy McCall |
1 |
#ifndef COLECOJOYSTICKIO_HH |
| 2 |
#define COLECOJOYSTICKIO_HH |
| 3 |
|
| 4 |
#include "Keyboard.hh" |
| 5 |
|
| 6 |
#include "MSXDevice.hh" |
| 7 |
|
| 8 |
#include <array> |
| 9 |
|
| 10 |
namespace openmsx { |
| 11 |
|
| 12 |
class JoystickPortIf; |
| 13 |
|
| 14 |
class ColecoJoystickIO final : public MSXDevice |
| 15 |
{ |
| 16 |
public: |
| 17 |
explicit ColecoJoystickIO(const DeviceConfig& config); |
| 18 |
|
| 19 |
|
| 20 |
void reset(EmuTime time) override; |
| 21 |
[[nodiscard]] byte readIO(uint16_t port, EmuTime time) override; |
| 22 |
[[nodiscard]] byte peekIO(uint16_t port, EmuTime time) const override; |
| 23 |
void writeIO(uint16_t port, byte value, EmuTime time) override; |
| 24 |
|
| 25 |
template<typename Archive> |
| 26 |
void serialize(Archive& ar, unsigned version); |
| 27 |
|
| 28 |
private: |
| 29 |
byte joyMode; |
| 30 |
std::array<JoystickPortIf*, 2> ports; |
| 31 |
Keyboard keyboard; |
| 32 |
}; |
| 33 |
SERIALIZE_CLASS_VERSION(ColecoJoystickIO, 2); |
| 34 |
|
| 35 |
} |
| 36 |
|
| 37 |
#endif |