openMSX
SG1000JoystickIO.hh
Go to the documentation of this file.
1#ifndef SG1000JOYSTICKIO_HH
2#define SG1000JOYSTICKIO_HH
3
4#include "MSXDevice.hh"
5#include <array>
6
7namespace openmsx {
8
9class JoystickPortIf;
10
13class SG1000JoystickIO final : public MSXDevice
14{
15public:
16 explicit SG1000JoystickIO(const DeviceConfig& config);
17
18 [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
19 [[nodiscard]] byte peekIO(word port, EmuTime::param time) const override;
20
21 template<typename Archive>
22 void serialize(Archive& ar, unsigned version);
23
24private:
25 std::array<JoystickPortIf*, 2> ports;
26};
27
28} // namespace openmsx
29
30#endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
I/O port access to the joysticks for the Sega SG-1000.
void serialize(Archive &ar, unsigned version)
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
This file implemented 3 utility functions:
Definition Autofire.cc:9
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29