openMSX
MagicKey.hh
Go to the documentation of this file.
1 #ifndef MAGICKEY_HH
2 #define MAGICKEY_HH
3 
4 #include "JoystickDevice.hh"
5 
6 namespace openmsx {
7 
8 class MagicKey final : public JoystickDevice
9 {
10 public:
11  // Pluggable
12  const std::string& getName() const override;
13  string_ref getDescription() const override;
14  void plugHelper(Connector& connector, EmuTime::param time) override;
15  void unplugHelper(EmuTime::param time) override;
16 
17  // JoystickDevice
18  byte read(EmuTime::param time) override;
19  void write(byte value, EmuTime::param time) override;
20 
21  template<typename Archive>
22  void serialize(Archive& ar, unsigned version);
23 };
24 
25 } // namespace openmsx
26 
27 #endif
string_ref getDescription() const override
Description for this pluggable.
Definition: MagicKey.cc:14
void write(byte value, EmuTime::param time) override
Write a value to the joystick device.
Definition: MagicKey.cc:34
Represents something you can plug devices into.
Definition: Connector.hh:21
unsigned char byte
8 bit unsigned integer
Definition: openmsx.hh:33
This class implements a subset of the proposal for std::string_ref (proposed for the next c++ standar...
Definition: string_ref.hh:18
void unplugHelper(EmuTime::param time) override
Definition: MagicKey.cc:23
byte read(EmuTime::param time) override
Read from the joystick device.
Definition: MagicKey.cc:29
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:7
void serialize(Archive &ar, unsigned version)
Definition: MagicKey.cc:40
const std::string & getName() const override
Name used to identify this pluggable.
Definition: MagicKey.cc:8
void plugHelper(Connector &connector, EmuTime::param time) override
Definition: MagicKey.cc:19