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

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

Additional Inherited Members

- Protected Member Functions inherited from openmsx::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

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

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.

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

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

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

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

Member Data Documentation

const int openmsx::JoystickDevice::JOY_BUTTONA = 0x10
staticprotected
const int openmsx::JoystickDevice::JOY_BUTTONB = 0x20
staticprotected
const int openmsx::JoystickDevice::JOY_DOWN = 0x02
staticprotected
const int openmsx::JoystickDevice::JOY_LEFT = 0x04
staticprotected
const int openmsx::JoystickDevice::JOY_RIGHT = 0x08
staticprotected
const int openmsx::JoystickDevice::JOY_UP = 0x01
staticprotected

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