openMSX
Public Member Functions | Static Public Attributes | List of all members
openmsx::JoystickDevice Class Referenceabstract

#include <JoystickDevice.hh>

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

Public Member Functions

virtual byte read (EmuTime::param time)=0
 Read from the joystick device. More...
 
virtual void write (byte value, EmuTime::param time)=0
 Write a value to the joystick device. More...
 
string_ref getClass () const final override
 A pluggable belongs to a certain class. More...
 
- Public Member Functions inherited from openmsx::Pluggable
virtual ~Pluggable ()
 
virtual const std::string & getName () const
 Name used to identify this pluggable. More...
 
virtual string_ref getDescription () const =0
 Description for this pluggable. More...
 
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...
 

Static Public Attributes

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
 

Additional Inherited Members

- Protected Member Functions inherited from openmsx::Pluggable
 Pluggable ()
 
virtual void plugHelper (Connector &newConnector, EmuTime::param time)=0
 
virtual void unplugHelper (EmuTime::param time)=0
 
void setConnector (Connector *conn)
 

Detailed Description

Definition at line 9 of file JoystickDevice.hh.

Member Function Documentation

◆ getClass()

string_ref openmsx::JoystickDevice::getClass ( ) const
finaloverridevirtual

A pluggable belongs to a certain class.

A pluggable only fits in connectors of the same class.

Implements openmsx::Pluggable.

Definition at line 5 of file JoystickDevice.cc.

◆ read()

virtual byte openmsx::JoystickDevice::read ( EmuTime::param  time)
pure virtual

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|

Implemented in openmsx::Joystick, openmsx::JoyMega, openmsx::JoyTap, openmsx::SETetrisDongle, openmsx::MagicKey, openmsx::NinjaTap, and openmsx::DummyJoystick.

Referenced by openmsx::JoystickPort::read().

◆ write()

virtual void openmsx::JoystickDevice::write ( byte  value,
EmuTime::param  time 
)
pure virtual

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.

Implemented in openmsx::Joystick, openmsx::JoyMega, openmsx::JoyTap, openmsx::SETetrisDongle, openmsx::MagicKey, openmsx::NinjaTap, and openmsx::DummyJoystick.

Referenced by openmsx::JoystickPort::plug(), and openmsx::JoystickPort::write().

Member Data Documentation

◆ JOY_BUTTONA

const int openmsx::JoystickDevice::JOY_BUTTONA = 0x10
static

◆ JOY_BUTTONB

const int openmsx::JoystickDevice::JOY_BUTTONB = 0x20
static

◆ JOY_DOWN

const int openmsx::JoystickDevice::JOY_DOWN = 0x02
static

◆ JOY_LEFT

const int openmsx::JoystickDevice::JOY_LEFT = 0x04
static

◆ JOY_RIGHT

const int openmsx::JoystickDevice::JOY_RIGHT = 0x08
static

◆ JOY_UP

const int openmsx::JoystickDevice::JOY_UP = 0x01
static

◆ RD_PIN1

const int openmsx::JoystickDevice::RD_PIN1 = 0x01
static

Definition at line 45 of file JoystickDevice.hh.

Referenced by openmsx::Touchpad::~Touchpad().

◆ RD_PIN2

const int openmsx::JoystickDevice::RD_PIN2 = 0x02
static

Definition at line 46 of file JoystickDevice.hh.

Referenced by openmsx::Touchpad::~Touchpad().

◆ RD_PIN3

const int openmsx::JoystickDevice::RD_PIN3 = 0x04
static

Definition at line 47 of file JoystickDevice.hh.

Referenced by openmsx::Touchpad::~Touchpad().

◆ RD_PIN4

const int openmsx::JoystickDevice::RD_PIN4 = 0x08
static

Definition at line 48 of file JoystickDevice.hh.

Referenced by openmsx::Touchpad::~Touchpad().

◆ RD_PIN6

const int openmsx::JoystickDevice::RD_PIN6 = 0x10
static

Definition at line 49 of file JoystickDevice.hh.

◆ RD_PIN7

const int openmsx::JoystickDevice::RD_PIN7 = 0x20
static

Definition at line 50 of file JoystickDevice.hh.

◆ WR_PIN6

const int openmsx::JoystickDevice::WR_PIN6 = 0x01
static

Definition at line 53 of file JoystickDevice.hh.

Referenced by openmsx::Touchpad::~Touchpad().

◆ WR_PIN7

const int openmsx::JoystickDevice::WR_PIN7 = 0x02
static

Definition at line 54 of file JoystickDevice.hh.

Referenced by openmsx::Touchpad::~Touchpad().

◆ WR_PIN8

const int openmsx::JoystickDevice::WR_PIN8 = 0x04
static

Definition at line 55 of file JoystickDevice.hh.

Referenced by openmsx::Touchpad::~Touchpad().


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