11 : pluggingController(pluggingController_)
12 , name(std::move(name_))
21 strCat(name,
"_port_",
char(
'1' + i)),
28 return "MSX Joy Tap device";
53 value &= s->read(time);
61 s->write(value, time);
65 template<
typename Archive>
69 if constexpr (!Archive::IS_LOADER) assert(
isPluggedIn());
71 if constexpr (Archive::IS_LOADER) {
75 char tag[6] = {
'p',
'o',
'r',
't',
'X', 0 };
77 tag[4] = char(
'0' + i);
78 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
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.
std::optional< JoystickPort > slaves[4]
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)