openMSX
MagicKey.cc
Go to the documentation of this file.
1 #include "MagicKey.hh"
2 #include "serialize.hh"
3 #include "serialize_meta.hh"
4 
5 namespace openmsx {
6 
7 // Pluggable
8 const std::string& MagicKey::getName() const
9 {
10  static const std::string NAME = "magic-key";
11  return NAME;
12 }
13 
14 std::string_view MagicKey::getDescription() const
15 {
16  return "Dongle used by some Japanese games to enable cheat mode";
17 }
18 
19 void MagicKey::plugHelper(Connector& /*connector*/, EmuTime::param /*time*/)
20 {
21 }
22 
23 void MagicKey::unplugHelper(EmuTime::param /*time*/)
24 {
25 }
26 
27 
28 // JoystickDevice
29 byte MagicKey::read(EmuTime::param /*time*/)
30 {
32 }
33 
34 void MagicKey::write(byte /*value*/, EmuTime::param /*time*/)
35 {
36 }
37 
38 
39 template<typename Archive>
40 void MagicKey::serialize(Archive& /*ar*/, unsigned /*version*/)
41 {
42 }
45 
46 } // namespace openmsx
REGISTER_POLYMORPHIC_INITIALIZER(Pluggable, CassettePlayer, "CassettePlayer")
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:20
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
static constexpr int JOY_LEFT
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
static constexpr int JOY_BUTTONB
std::string_view getDescription() const override
Description for this pluggable.
Definition: MagicKey.cc:14
static constexpr int JOY_BUTTONA
static constexpr int JOY_RIGHT
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
void serialize(Archive &ar, unsigned version)
Definition: MagicKey.cc:40
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
Definition: serialize.hh:981
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