15 , description(description_)
26 return "Joystick Port";
31 return *checked_cast<JoystickDevice*>(&
getPlugged());
47 if (lastValue != value) writeDirect(value, time);
49 void JoystickPort::writeDirect(
byte value, EmuTime::param time)
55 template<
typename Archive>
58 ar.template serializeBase<Connector>(*
this);
59 if constexpr (Archive::IS_LOADER) {
Represents something you can plug devices into.
Pluggable & getPlugged() const
Returns the Pluggable currently plugged in.
virtual void plug(Pluggable &device, EmuTime::param time)
This plugs a Pluggable in this Connector.
PluggingController & getPluggingController() const
void write(byte value, EmuTime::param time) override
byte read(EmuTime::param time) override
virtual void write(byte value, EmuTime::param time)=0
Write a value to the joystick device.
virtual byte read(EmuTime::param time)=0
Read from the joystick device.
byte read(EmuTime::param time) override
JoystickPort(PluggingController &pluggingController, std::string name, static_string_view description)
JoystickDevice & getPluggedJoyDev() const
std::string_view getDescription() const override
Get a description for this connector.
void serialize(Archive &ar, unsigned version)
void write(byte value, EmuTime::param time) override
void plug(Pluggable &device, EmuTime::param time) override
This plugs a Pluggable in this Connector.
std::string_view getClass() const override
A Connector belong to a certain class.
Central administration of Connectors and Pluggables.
This file implemented 3 utility functions:
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)