openMSX
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
openmsx::JoyTap Class Reference

This device is pluged in into the joyports and consolidates several other joysticks plugged into it. More...

#include <JoyTap.hh>

Inheritance diagram for openmsx::JoyTap:
Inheritance graph
[legend]
Collaboration diagram for openmsx::JoyTap:
Collaboration graph
[legend]

Public Member Functions

 JoyTap (PluggingController &pluggingController, const std::string &name)
 
virtual ~JoyTap ()
 
const std::string & getName () const override
 Name used to identify this pluggable. More...
 
string_ref 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)
 
- Public Member Functions inherited from openmsx::JoystickDevice
string_ref getClass () const finaloverride
 A pluggable belongs to a certain class. More...
 
- Public Member Functions inherited from openmsx::Pluggable
virtual ~Pluggable ()
 
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 conector. More...
 
ConnectorgetConnector () 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 (PluggingController &pluggingController, const std::string &baseDescription)
 
- Protected Member Functions inherited from openmsx::Pluggable
 Pluggable ()
 
void setConnector (Connector *conn)
 

Protected Attributes

std::unique_ptr< JoystickPortslaves [4]
 
PluggingControllerpluggingController
 

Additional Inherited Members

- Static Protected Attributes inherited from openmsx::JoystickDevice
static const int JOY_UP = 0x01
 
static const int JOY_DOWN = 0x02
 
static const int JOY_LEFT = 0x04
 
static const int JOY_RIGHT = 0x08
 
static const int JOY_BUTTONA = 0x10
 
static const int JOY_BUTTONB = 0x20
 
static const int RD_PIN1 = 0x01
 
static const int RD_PIN2 = 0x02
 
static const int RD_PIN3 = 0x04
 
static const int RD_PIN4 = 0x08
 
static const int RD_PIN6 = 0x10
 
static const int RD_PIN7 = 0x20
 
static const int WR_PIN6 = 0x01
 
static const int WR_PIN7 = 0x02
 
static const int WR_PIN8 = 0x04
 

Detailed Description

This device is pluged 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 basicly have other read and write methods

Definition at line 20 of file JoyTap.hh.

Constructor & Destructor Documentation

openmsx::JoyTap::JoyTap ( PluggingController pluggingController,
const std::string &  name 
)

Definition at line 12 of file JoyTap.cc.

openmsx::JoyTap::~JoyTap ( )
virtual

Definition at line 19 of file JoyTap.cc.

Member Function Documentation

void openmsx::JoyTap::createPorts ( PluggingController pluggingController,
const std::string &  baseDescription 
)
protected

Definition at line 23 of file JoyTap.cc.

References pluggingController, and slaves.

Referenced by openmsx::NinjaTap::plugHelper(), and plugHelper().

string_ref openmsx::JoyTap::getDescription ( ) const
overridevirtual

Description for this pluggable.

Implements openmsx::Pluggable.

Reimplemented in openmsx::NinjaTap.

Definition at line 32 of file JoyTap.cc.

const std::string & openmsx::JoyTap::getName ( ) const
overridevirtual

Name used to identify this pluggable.

Reimplemented from openmsx::Pluggable.

Definition at line 37 of file JoyTap.cc.

void openmsx::JoyTap::plugHelper ( Connector connector,
EmuTime::param  time 
)
overridevirtual

Implements openmsx::Pluggable.

Reimplemented in openmsx::NinjaTap.

Definition at line 42 of file JoyTap.cc.

References createPorts(), and pluggingController.

Referenced by serialize().

byte openmsx::JoyTap::read ( EmuTime::param  time)
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 55 of file JoyTap.cc.

References slaves.

template<typename Archive >
void openmsx::JoyTap::serialize ( Archive &  ar,
unsigned  version 
)
void openmsx::JoyTap::unplugHelper ( EmuTime::param  time)
overridevirtual

Implements openmsx::Pluggable.

Definition at line 47 of file JoyTap.cc.

References slaves.

void openmsx::JoyTap::write ( byte  value,
EmuTime::param  time 
)
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 64 of file JoyTap.cc.

References slaves.

Member Data Documentation

PluggingController& openmsx::JoyTap::pluggingController
protected

Definition at line 45 of file JoyTap.hh.

Referenced by createPorts(), openmsx::NinjaTap::plugHelper(), plugHelper(), and serialize().

std::unique_ptr<JoystickPort> openmsx::JoyTap::slaves[4]
protected

Definition at line 44 of file JoyTap.hh.

Referenced by createPorts(), read(), serialize(), unplugHelper(), openmsx::NinjaTap::write(), and write().


The documentation for this class was generated from the following files: