openMSX
|
This device is plugged in into the joyports and consolidates several other joysticks plugged into it. More...
#include <JoyTap.hh>
Public Member Functions | |
JoyTap (PluggingController &pluggingController, std::string name) | |
std::string_view | getName () const override |
Name used to identify this pluggable. More... | |
std::string_view | getDescription () const override |
Description for this pluggable. More... | |
void | plugHelper (Connector &connector, EmuTime::param time) override |
void | unplugHelper (EmuTime::param time) override |
byte | read (EmuTime::param time) override |
Read from the joystick device. More... | |
void | write (byte value, EmuTime::param time) override |
Write a value to the joystick device. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
![]() | |
std::string_view | getClass () const final |
A pluggable belongs to a certain class. More... | |
![]() | |
virtual | ~Pluggable ()=default |
void | plug (Connector &connector, EmuTime::param time) |
This method is called when this pluggable is inserted in a connector. More... | |
void | unplug (EmuTime::param time) |
This method is called when this pluggable is removed from a connector. More... | |
Connector * | getConnector () const |
Get the connector this Pluggable is plugged into. More... | |
bool | isPluggedIn () const |
Returns true if this pluggable is currently plugged into a connector. More... | |
Protected Member Functions | |
void | createPorts (static_string_view description) |
![]() | |
Pluggable () | |
void | setConnector (Connector *conn) |
Protected Attributes | |
std::optional< JoystickPort > | slaves [4] |
PluggingController & | pluggingController |
Additional Inherited Members | |
![]() | |
static constexpr int | JOY_UP = 0x01 |
static constexpr int | JOY_DOWN = 0x02 |
static constexpr int | JOY_LEFT = 0x04 |
static constexpr int | JOY_RIGHT = 0x08 |
static constexpr int | JOY_BUTTONA = 0x10 |
static constexpr int | JOY_BUTTONB = 0x20 |
static constexpr int | RD_PIN1 = 0x01 |
static constexpr int | RD_PIN2 = 0x02 |
static constexpr int | RD_PIN3 = 0x04 |
static constexpr int | RD_PIN4 = 0x08 |
static constexpr int | RD_PIN6 = 0x10 |
static constexpr int | RD_PIN7 = 0x20 |
static constexpr int | WR_PIN6 = 0x01 |
static constexpr int | WR_PIN7 = 0x02 |
static constexpr int | WR_PIN8 = 0x04 |
This device is plugged in into the joyports and consolidates several other joysticks plugged into it.
This joytap simply ANDs all the joystick outputs, acting as a simple wiring of all digital joysticks into one connector. This is the base class for the NinjaTap device and the FNano2 multiplayer extension, who basically have other read and write methods
openmsx::JoyTap::JoyTap | ( | PluggingController & | pluggingController, |
std::string | name | ||
) |
|
protected |
Definition at line 16 of file JoyTap.cc.
References enumerate(), pluggingController, slaves, and strCat().
Referenced by plugHelper(), and openmsx::NinjaTap::plugHelper().
|
overridevirtual |
|
overridevirtual |
Name used to identify this pluggable.
Reimplemented from openmsx::Pluggable.
|
overridevirtual |
Implements openmsx::Pluggable.
Reimplemented in openmsx::NinjaTap.
Definition at line 36 of file JoyTap.cc.
References createPorts().
Referenced by serialize().
|
overridevirtual |
Read from the joystick device.
The bits in the read byte have following meaning: 7 6 5 4 3 2 1 0 | xx | xx | BUTTON_B | BUTTON_A | RIGHT | LEFT | DOWN | UP | | xx | xx | pin7 | pin6 | pin4 | pin3 | pin2 | pin1|
Implements openmsx::JoystickDevice.
Reimplemented in openmsx::NinjaTap.
Definition at line 49 of file JoyTap.cc.
References slaves.
void openmsx::JoyTap::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 66 of file JoyTap.cc.
References enumerate(), openmsx::Pluggable::getConnector(), openmsx::PluggingController::getCurrentTime(), openmsx::Pluggable::isPluggedIn(), pluggingController, plugHelper(), and slaves.
|
overridevirtual |
|
overridevirtual |
Write a value to the joystick device.
The bits in the written byte have following meaning: 7 6 5 4 3 2 1 0 | xx | xx | xx | xx | xx | pin8 | pin7 | pin6 | As an optimization, this method might not be called when the new value is the same as the previous one.
Implements openmsx::JoystickDevice.
Reimplemented in openmsx::NinjaTap.
Definition at line 58 of file JoyTap.cc.
References slaves.
|
protected |
Definition at line 44 of file JoyTap.hh.
Referenced by createPorts(), and serialize().
|
protected |
Definition at line 43 of file JoyTap.hh.
Referenced by createPorts(), read(), serialize(), unplugHelper(), write(), and openmsx::NinjaTap::write().