12 std::string name_, std::string description_)
14 , description(
std::move(description_))
25 return "Joystick Port";
30 return *checked_cast<JoystickDevice*>(&
getPlugged());
46 if (lastValue != value) writeDirect(value, time);
48void JoystickPort::writeDirect(uint8_t value, EmuTime::param time)
54template<
typename Archive>
57 ar.template serializeBase<Connector>(*
this);
58 if constexpr (Archive::IS_LOADER) {
Represents something you can plug devices into.
Pluggable & getPlugged() const
Returns the Pluggable currently plugged in.
PluggingController & getPluggingController() const
virtual void plug(Pluggable &device, EmuTime::param time)
This plugs a Pluggable in this Connector.
void write(uint8_t value, EmuTime::param time) override
uint8_t read(EmuTime::param time) override
virtual uint8_t read(EmuTime::param time)=0
Read from the joystick device.
virtual void write(uint8_t value, EmuTime::param time)=0
Write a value to the joystick device.
JoystickPort(PluggingController &pluggingController, std::string name, std::string description)
uint8_t read(EmuTime::param time) override
JoystickDevice & getPluggedJoyDev() const
void write(uint8_t value, EmuTime::param time) override
std::string_view getDescription() const override
Get a description for this connector.
void serialize(Archive &ar, unsigned version)
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)