openMSX
JoystickDevice.hh
Go to the documentation of this file.
1#ifndef JOYSTICKDEVICE_HH
2#define JOYSTICKDEVICE_HH
3
4#include "Pluggable.hh"
5#include <cstdint>
6
7namespace openmsx {
8
10{
11public:
19 [[nodiscard]] virtual uint8_t read(EmuTime::param time) = 0;
20
29 virtual void write(uint8_t value, EmuTime::param time) = 0;
30
31 [[nodiscard]] std::string_view getClass() const final;
32
33 /* Missing pin descriptions
34 * pin 5 : +5V
35 * pin 9 : GND
36 */
37
38 // use in the read() method
39 static constexpr int JOY_UP = 0x01;
40 static constexpr int JOY_DOWN = 0x02;
41 static constexpr int JOY_LEFT = 0x04;
42 static constexpr int JOY_RIGHT = 0x08;
43 static constexpr int JOY_BUTTONA = 0x10;
44 static constexpr int JOY_BUTTONB = 0x20;
45 static constexpr int RD_PIN1 = 0x01;
46 static constexpr int RD_PIN2 = 0x02;
47 static constexpr int RD_PIN3 = 0x04;
48 static constexpr int RD_PIN4 = 0x08;
49 static constexpr int RD_PIN6 = 0x10;
50 static constexpr int RD_PIN7 = 0x20;
51
52 // use in the write() method
53 static constexpr int WR_PIN6 = 0x01;
54 static constexpr int WR_PIN7 = 0x02;
55 static constexpr int WR_PIN8 = 0x04;
56};
57
58} // namespace openmsx
59
60#endif
static constexpr int RD_PIN4
static constexpr int JOY_BUTTONA
static constexpr int JOY_RIGHT
static constexpr int RD_PIN3
static constexpr int RD_PIN2
static constexpr int JOY_LEFT
static constexpr int JOY_DOWN
static constexpr int RD_PIN6
static constexpr int WR_PIN8
static constexpr int RD_PIN7
static constexpr int WR_PIN7
static constexpr int JOY_BUTTONB
std::string_view getClass() const final
A pluggable belongs to a certain class.
static constexpr int RD_PIN1
virtual uint8_t read(EmuTime::param time)=0
Read from the joystick device.
static constexpr int WR_PIN6
static constexpr int JOY_UP
virtual void write(uint8_t value, EmuTime::param time)=0
Write a value to the joystick device.
This file implemented 3 utility functions:
Definition: Autofire.cc:9