openMSX
Public Member Functions | Static Public Member Functions | List of all members
openmsx::Joystick Class Reference

Uses an SDL joystick to emulate an MSX joystick. More...

#include <Joystick.hh>

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

Public Member Functions

 Joystick (MSXEventDistributor &eventDistributor, StateChangeDistributor &stateChangeDistributor, CommandController &commandController, SDL_Joystick *joystick)
virtual ~Joystick ()
virtual const std::string & getName () const
virtual string_ref getDescription () const
virtual void plugHelper (Connector &connector, EmuTime::param time)
virtual void unplugHelper (EmuTime::param time)
virtual byte read (EmuTime::param time)
virtual void write (byte value, EmuTime::param time)
template<typename Archive >
void serialize (Archive &ar, unsigned version)
- Public Member Functions inherited from openmsx::JoystickDevice
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 Public Member Functions

static void registerAll (MSXEventDistributor &eventDistributor, StateChangeDistributor &stateChangeDistributor, CommandController &commandController, PluggingController &controller)
 Register all available SDL joysticks.

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)
- 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
- Private Member Functions inherited from openmsx::MSXEventListener
virtual ~MSXEventListener ()
virtual void signalEvent (const std::shared_ptr< const Event > &event, EmuTime::param time)=0
 This method gets called when an event you are subscribed to occurs.
 MSXEventListener ()
- Private Member Functions inherited from openmsx::StateChangeListener
virtual void signalStateChange (const std::shared_ptr< StateChange > &event)=0
 This method gets called when a StateChange event occurs.
virtual void stopReplay (EmuTime::param time)=0
 This method gets called when we switch from replayed events to live events.
 StateChangeListener ()
virtual ~StateChangeListener ()

Detailed Description

Uses an SDL joystick to emulate an MSX joystick.

Definition at line 23 of file Joystick.hh.

Constructor & Destructor Documentation

openmsx::Joystick::Joystick ( MSXEventDistributor eventDistributor,
StateChangeDistributor stateChangeDistributor,
CommandController commandController,
SDL_Joystick *  joystick 
)
openmsx::Joystick::~Joystick ( )
virtual

Member Function Documentation

string_ref openmsx::Joystick::getDescription ( ) const
virtual

Definition at line 199 of file Joystick.cc.

const string & openmsx::Joystick::getName ( ) const
virtual

Definition at line 194 of file Joystick.cc.

void openmsx::Joystick::plugHelper ( Connector connector,
EmuTime::param  time 
)
virtual

Definition at line 204 of file Joystick.cc.

byte openmsx::Joystick::read ( EmuTime::param  time)
virtual

Definition at line 227 of file Joystick.cc.

void openmsx::Joystick::registerAll ( MSXEventDistributor eventDistributor,
StateChangeDistributor stateChangeDistributor,
CommandController commandController,
PluggingController controller 
)
static

Register all available SDL joysticks.

Definition at line 30 of file Joystick.cc.

References ad_printf, PLATFORM_ANDROID, and openmsx::PluggingController::registerPluggable().

Referenced by openmsx::PluggableFactory::createAll().

template<typename Archive >
void openmsx::Joystick::serialize ( Archive &  ar,
unsigned  version 
)

Definition at line 338 of file Joystick.cc.

References openmsx::Pluggable::isPluggedIn().

void openmsx::Joystick::unplugHelper ( EmuTime::param  time)
virtual
void openmsx::Joystick::write ( byte  value,
EmuTime::param  time 
)
virtual

Definition at line 232 of file Joystick.cc.


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