openMSX
MSXTurboRPause.hh
Go to the documentation of this file.
1 /*
2  * This class implements the 2 Turbo-R specific LEDS:
3  *
4  * Bit 0 of IO-port 0xA7 turns the PAUSE led ON (1) or OFF (0)
5  * Bit 7 TURBO
6  * TODO merge doc below
7  */
8 #ifndef TURBORPAUSE_HH
9 #define TURBORPAUSE_HH
10 
11 #include "MSXDevice.hh"
12 #include "BooleanSetting.hh"
13 #include "Observer.hh"
14 
15 namespace openmsx {
16 
25 class MSXTurboRPause final : public MSXDevice, private Observer<Setting>
26 {
27 public:
28  explicit MSXTurboRPause(const DeviceConfig& config);
29  ~MSXTurboRPause() override;
30 
31  void reset(EmuTime::param time) override;
32  void powerDown(EmuTime::param time) override;
33 
34  [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
35  [[nodiscard]] byte peekIO(word port, EmuTime::param time) const override;
36  void writeIO(word port, byte value, EmuTime::param time) override;
37 
38  template<typename Archive>
39  void serialize(Archive& ar, unsigned version);
40 
41 private:
42  // Observer<Setting>
43  void update(const Setting& setting) override;
44 
45  void updatePause();
46 
47 private:
48  BooleanSetting pauseSetting;
49  byte status;
50  bool pauseLed;
51  bool turboLed;
52  bool hwPause;
53 };
54 
55 } // namespace openmsx
56 
57 #endif
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
openmsx::MSXTurboRPause::~MSXTurboRPause
~MSXTurboRPause() override
Definition: MSXTurboRPause.cc:22
openmsx::MSXTurboRPause::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MSXTurboRPause.cc:33
openmsx::MSXTurboRPause::readIO
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: MSXTurboRPause.cc:39
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
openmsx::MSXTurboRPause::peekIO
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: MSXTurboRPause.cc:44
openmsx::Setting
Definition: Setting.hh:120
BooleanSetting.hh
openmsx::MSXTurboRPause::powerDown
void powerDown(EmuTime::param time) override
This method is called when MSX is powered down.
Definition: MSXTurboRPause.cc:28
Observer.hh
MSXDevice.hh
openmsx::MSXTurboRPause
This class implements the MSX Turbo-R pause key.
Definition: MSXTurboRPause.hh:26
openmsx::MSXTurboRPause::MSXTurboRPause
MSXTurboRPause(const DeviceConfig &config)
Definition: MSXTurboRPause.cc:8
openmsx::MSXTurboRPause::serialize
void serialize(Archive &ar, unsigned version)
Definition: MSXTurboRPause.cc:85
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::BooleanSetting
Definition: BooleanSetting.hh:9
openmsx::MSXTurboRPause::writeIO
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
Definition: MSXTurboRPause.cc:49
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::Observer
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:10