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 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.
 
std::string_view getClass () const final
 A pluggable belongs to a certain class.
 
- Public Member Functions inherited from openmsx::Pluggable
virtual ~Pluggable ()=default
 
virtual std::string_view getName () const
 Name used to identify this pluggable.
 
virtual std::string_view getDescription () const =0
 Description for this pluggable.
 
void plug (Connector &connector, EmuTime::param time)
 This method is called when this pluggable is inserted in a connector.
 
void unplug (EmuTime::param time)
 This method is called when this pluggable is removed from a connector.
 
ConnectorgetConnector () const
 Get the connector this Pluggable is plugged into.
 
bool isPluggedIn () const
 Returns true if this pluggable is currently plugged into a connector.
 

Static Public Attributes

static constexpr uint8_t JOY_UP = 0x01
 
static constexpr uint8_t JOY_DOWN = 0x02
 
static constexpr uint8_t JOY_LEFT = 0x04
 
static constexpr uint8_t JOY_RIGHT = 0x08
 
static constexpr uint8_t JOY_BUTTONA = 0x10
 
static constexpr uint8_t JOY_BUTTONB = 0x20
 
static constexpr uint8_t RD_PIN1 = 0x01
 
static constexpr uint8_t RD_PIN2 = 0x02
 
static constexpr uint8_t RD_PIN3 = 0x04
 
static constexpr uint8_t RD_PIN4 = 0x08
 
static constexpr uint8_t RD_PIN6 = 0x10
 
static constexpr uint8_t RD_PIN7 = 0x20
 
static constexpr uint8_t WR_PIN6 = 0x01
 
static constexpr uint8_t WR_PIN7 = 0x02
 
static constexpr uint8_t 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()

std::string_view openmsx::JoystickDevice::getClass ( ) const
finalvirtual

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 uint8_t 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::CircuitDesignerRDDongle, openmsx::DummyJoystick, openmsx::JoyTap, openmsx::MagicKey, openmsx::NinjaTap, and openmsx::SETetrisDongle.

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

◆ write()

virtual void openmsx::JoystickDevice::write ( uint8_t  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::CircuitDesignerRDDongle, openmsx::DummyJoystick, openmsx::JoyTap, openmsx::MagicKey, openmsx::NinjaTap, and openmsx::SETetrisDongle.

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

Member Data Documentation

◆ JOY_BUTTONA

constexpr uint8_t openmsx::JoystickDevice::JOY_BUTTONA = 0x10
staticconstexpr

Definition at line 43 of file JoystickDevice.hh.

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

◆ JOY_BUTTONB

constexpr uint8_t openmsx::JoystickDevice::JOY_BUTTONB = 0x20
staticconstexpr

Definition at line 44 of file JoystickDevice.hh.

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

◆ JOY_DOWN

constexpr uint8_t openmsx::JoystickDevice::JOY_DOWN = 0x02
staticconstexpr

Definition at line 40 of file JoystickDevice.hh.

◆ JOY_LEFT

constexpr uint8_t openmsx::JoystickDevice::JOY_LEFT = 0x04
staticconstexpr

Definition at line 41 of file JoystickDevice.hh.

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

◆ JOY_RIGHT

constexpr uint8_t openmsx::JoystickDevice::JOY_RIGHT = 0x08
staticconstexpr

Definition at line 42 of file JoystickDevice.hh.

Referenced by openmsx::MagicKey::read(), and openmsx::SETetrisDongle::write().

◆ JOY_UP

constexpr uint8_t openmsx::JoystickDevice::JOY_UP = 0x01
staticconstexpr

Definition at line 39 of file JoystickDevice.hh.

Referenced by openmsx::CircuitDesignerRDDongle::write().

◆ RD_PIN1

constexpr uint8_t openmsx::JoystickDevice::RD_PIN1 = 0x01
staticconstexpr

Definition at line 45 of file JoystickDevice.hh.

◆ RD_PIN2

constexpr uint8_t openmsx::JoystickDevice::RD_PIN2 = 0x02
staticconstexpr

Definition at line 46 of file JoystickDevice.hh.

◆ RD_PIN3

constexpr uint8_t openmsx::JoystickDevice::RD_PIN3 = 0x04
staticconstexpr

Definition at line 47 of file JoystickDevice.hh.

◆ RD_PIN4

constexpr uint8_t openmsx::JoystickDevice::RD_PIN4 = 0x08
staticconstexpr

Definition at line 48 of file JoystickDevice.hh.

◆ RD_PIN6

constexpr uint8_t openmsx::JoystickDevice::RD_PIN6 = 0x10
staticconstexpr

Definition at line 49 of file JoystickDevice.hh.

◆ RD_PIN7

constexpr uint8_t openmsx::JoystickDevice::RD_PIN7 = 0x20
staticconstexpr

Definition at line 50 of file JoystickDevice.hh.

◆ WR_PIN6

constexpr uint8_t openmsx::JoystickDevice::WR_PIN6 = 0x01
staticconstexpr

Definition at line 53 of file JoystickDevice.hh.

Referenced by openmsx::CircuitDesignerRDDongle::write().

◆ WR_PIN7

constexpr uint8_t openmsx::JoystickDevice::WR_PIN7 = 0x02
staticconstexpr

Definition at line 54 of file JoystickDevice.hh.

Referenced by openmsx::CircuitDesignerRDDongle::write().

◆ WR_PIN8

constexpr uint8_t openmsx::JoystickDevice::WR_PIN8 = 0x04
staticconstexpr

Definition at line 55 of file JoystickDevice.hh.


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