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  byte readIO(word port, EmuTime::param time) override;
35  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  BooleanSetting pauseSetting;
48  byte status;
49  bool pauseLed;
50  bool turboLed;
51  bool hwPause;
52 };
53 
54 } // namespace openmsx
55 
56 #endif
void serialize(Archive &ar, unsigned version)
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
MSXTurboRPause(const DeviceConfig &config)
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.
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.
void reset(EmuTime::param time) override
This method is called on reset.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX...
Definition: MSXDevice.hh:31
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
void powerDown(EmuTime::param time) override
This method is called when MSX is powered down.
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:9
This class implements the MSX Turbo-R pause key.