openMSX
Public Member Functions | List of all members
openmsx::MagicKey Class Referencefinal

#include <MagicKey.hh>

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

Public Member Functions

std::string_view getName () const override
 Name used to identify this pluggable.
 
std::string_view getDescription () const override
 Description for this pluggable.
 
void plugHelper (Connector &connector, EmuTime::param time) override
 
void unplugHelper (EmuTime::param time) override
 
uint8_t read (EmuTime::param time) override
 Read from the joystick device.
 
void write (uint8_t value, EmuTime::param time) override
 Write a value to the joystick device.
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 
- Public Member Functions inherited from openmsx::JoystickDevice
std::string_view getClass () const final
 A pluggable belongs to a certain class.
 
- Public Member Functions inherited from openmsx::Pluggable
virtual ~Pluggable ()=default
 
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.
 

Additional Inherited Members

- Static Public Attributes inherited from openmsx::JoystickDevice
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
 
- Protected Member Functions inherited from openmsx::Pluggable
 Pluggable ()
 
void setConnector (Connector *conn)
 

Detailed Description

Definition at line 8 of file MagicKey.hh.

Member Function Documentation

◆ getDescription()

std::string_view openmsx::MagicKey::getDescription ( ) const
overridevirtual

Description for this pluggable.

Implements openmsx::Pluggable.

Definition at line 13 of file MagicKey.cc.

◆ getName()

std::string_view openmsx::MagicKey::getName ( ) const
overridevirtual

Name used to identify this pluggable.

Reimplemented from openmsx::Pluggable.

Definition at line 8 of file MagicKey.cc.

◆ plugHelper()

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

Implements openmsx::Pluggable.

Definition at line 18 of file MagicKey.cc.

◆ read()

uint8_t openmsx::MagicKey::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.

Definition at line 28 of file MagicKey.cc.

References openmsx::JoystickDevice::JOY_BUTTONA, openmsx::JoystickDevice::JOY_BUTTONB, openmsx::JoystickDevice::JOY_LEFT, and openmsx::JoystickDevice::JOY_RIGHT.

◆ serialize()

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

Definition at line 39 of file MagicKey.cc.

◆ unplugHelper()

void openmsx::MagicKey::unplugHelper ( EmuTime::param  time)
overridevirtual

Implements openmsx::Pluggable.

Definition at line 22 of file MagicKey.cc.

◆ write()

void openmsx::MagicKey::write ( uint8_t  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.

Definition at line 33 of file MagicKey.cc.


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