14 : pluggingController(pluggingController_)
15 , name(std::move(name_))
23 slave = std::make_unique<JoystickPort>(
25 strCat(name,
"_port_",
char(
'1' + i)),
32 return "MSX Joy Tap device";
57 value &= s->read(time);
65 s->write(value, time);
69 template<
typename Archive>
79 char tag[6] = {
'p',
'o',
'r',
't',
'X', 0 };
81 tag[4] = char(
'0' + i);
82 ar.serialize(tag, *slave);
Represents something you can plug devices into.
This device is plugged in into the joyports and consolidates several other joysticks plugged into it.
void unplugHelper(EmuTime::param time) override
std::unique_ptr< JoystickPort > slaves[4]
byte read(EmuTime::param time) override
Read from the joystick device.
void plugHelper(Connector &connector, EmuTime::param time) override
std::string_view getDescription() const override
Description for this pluggable.
void serialize(Archive &ar, unsigned version)
void createPorts(static_string_view description)
void write(byte value, EmuTime::param time) override
Write a value to the joystick device.
JoyTap(PluggingController &pluggingController, std::string name)
std::string_view getName() const override
Name used to identify this pluggable.
PluggingController & pluggingController
bool isPluggedIn() const
Returns true if this pluggable is currently plugged into a connector.
Connector * getConnector() const
Get the connector this Pluggable is plugged into.
Central administration of Connectors and Pluggables.
EmuTime::param getCurrentTime() const
Convenience method: get current time.
constexpr auto enumerate(Iterable &&iterable)
Heavily inspired by Nathan Reed's blog post: Python-Like enumerate() In C++17 http://reedbeta....
This file implemented 3 utility functions:
REGISTER_POLYMORPHIC_INITIALIZER(Pluggable, CassettePlayer, "CassettePlayer")
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
std::string strCat(Ts &&...ts)