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 "openmsx.hh"
6 
7 namespace openmsx {
8 
9 class JoystickDevice : public Pluggable
10 {
11 public:
19  virtual byte read(EmuTime::param time) = 0;
20 
29  virtual void write(byte value, EmuTime::param time) = 0;
30 
31  string_ref getClass() const final override;
32 
33  /* Missing pin descriptions
34  * pin 5 : +5V
35  * pin 9 : GND
36  */
37 
38  // use in the read() method
39  static const int JOY_UP = 0x01;
40  static const int JOY_DOWN = 0x02;
41  static const int JOY_LEFT = 0x04;
42  static const int JOY_RIGHT = 0x08;
43  static const int JOY_BUTTONA = 0x10;
44  static const int JOY_BUTTONB = 0x20;
45  static const int RD_PIN1 = 0x01;
46  static const int RD_PIN2 = 0x02;
47  static const int RD_PIN3 = 0x04;
48  static const int RD_PIN4 = 0x08;
49  static const int RD_PIN6 = 0x10;
50  static const int RD_PIN7 = 0x20;
51 
52  // use in the write() method
53  static const int WR_PIN6 = 0x01;
54  static const int WR_PIN7 = 0x02;
55  static const int WR_PIN8 = 0x04;
56 };
57 
58 } // namespace openmsx
59 
60 #endif
static const int JOY_LEFT
static const int JOY_UP
static const int RD_PIN1
static const int JOY_BUTTONB
string_ref getClass() const final override
A pluggable belongs to a certain class.
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
static const int WR_PIN8
This class implements a subset of the proposal for std::string_ref (proposed for the next c++ standar...
Definition: string_ref.hh:18
static const int RD_PIN6
static const int WR_PIN7
static const int WR_PIN6
static const int RD_PIN4
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
static const int JOY_DOWN
static const int RD_PIN3
virtual byte read(EmuTime::param time)=0
Read from the joystick device.
static const int JOY_BUTTONA
virtual void write(byte value, EmuTime::param time)=0
Write a value to the joystick device.
static const int RD_PIN7
static const int RD_PIN2
static const int JOY_RIGHT