openMSX
ColecoJoystickIO.hh
Go to the documentation of this file.
1 #ifndef COLECOJOYSTICKIO_HH
2 #define COLECOJOYSTICKIO_HH
3 
4 #include "MSXDevice.hh"
5 #include "Keyboard.hh"
6 
7 
8 namespace openmsx {
9 
10 class JoystickPortIf;
11 
12 class ColecoJoystickIO final : public MSXDevice
13 {
14 public:
15  explicit ColecoJoystickIO(const DeviceConfig& config);
16 
17  // MSXDevice:
18  void reset(EmuTime::param time) override;
19  byte readIO(word port, EmuTime::param time) override;
20  byte peekIO(word port, EmuTime::param time) const override;
21  void writeIO(word port, byte value, EmuTime::param time) override;
22 
23  template<typename Archive>
24  void serialize(Archive& ar, unsigned version);
25 
26 private:
27  byte joyMode;
28  JoystickPortIf* ports[2];
29  Keyboard keyboard;
30 };
32 
33 } // namespace openmsx
34 
35 #endif
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:31
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::ColecoJoystickIO::ColecoJoystickIO
ColecoJoystickIO(const DeviceConfig &config)
Definition: ColecoJoystickIO.cc:10
openmsx::JoystickPortIf
Definition: JoystickPort.hh:12
openmsx::SERIALIZE_CLASS_VERSION
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
MSXDevice.hh
openmsx::ColecoJoystickIO::serialize
void serialize(Archive &ar, unsigned version)
Definition: ColecoJoystickIO.cc:86
openmsx::ColecoJoystickIO::readIO
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: ColecoJoystickIO.cc:75
openmsx::ColecoJoystickIO::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: ColecoJoystickIO.cc:80
openmsx::Keyboard
Definition: Keyboard.hh:35
openmsx::ColecoJoystickIO::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ColecoJoystickIO.cc:32
Keyboard.hh
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::ColecoJoystickIO
Definition: ColecoJoystickIO.hh:12
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::ColecoJoystickIO::peekIO
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: ColecoJoystickIO.cc:37