12 : pluggingController(pluggingController_)
13 , name(
std::move(name_))
22 strCat(name,
"_port_",
char(
'1' + i)),
23 strCat(description,
' ',
char(
'1' + i)));
24 slave->write(0, time);
30 return "MSX Joy Tap device";
55 value &= s->read(time);
63 s->write(value, time);
67template<
typename Archive>
71 if constexpr (!Archive::IS_LOADER) assert(
isPluggedIn());
73 if constexpr (Archive::IS_LOADER) {
77 std::array<char, 6> tag = {
'p',
'o',
'r',
't',
'X', 0};
79 tag[4] = char(
'0' + i);
80 ar.serialize(tag.data(), *slave);
Represents something you can plug devices into.
This device is plugged in into the joy-ports and consolidates several other joysticks plugged into it...
void unplugHelper(EmuTime::param time) override
void plugHelper(Connector &connector, EmuTime::param time) override
uint8_t read(EmuTime::param time) override
Read from the joystick device.
std::string_view getDescription() const override
Description for this pluggable.
void serialize(Archive &ar, unsigned version)
void write(uint8_t 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.
void createPorts(std::string_view description, EmuTime::param time)
std::array< std::optional< JoystickPort >, 4 > slaves
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:
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)