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
15namespace openmsx {
16
25class MSXTurboRPause final : public MSXDevice, private Observer<Setting>
26{
27public:
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
41private:
42 // Observer<Setting>
43 void update(const Setting& setting) noexcept override;
44
45 void updatePause();
46
47private:
48 BooleanSetting pauseSetting;
49 byte status = 255;
50 bool pauseLed = false;
51 bool turboLed = false;
52 bool hwPause = false;
53};
54
55} // namespace openmsx
56
57#endif
BaseSetting * setting
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
This class implements the MSX Turbo-R pause key.
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.
void powerDown(EmuTime::param time) override
This method is called when MSX is powered down.
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.
void serialize(Archive &ar, unsigned version)
Generic Gang-of-Four Observer class, templatized edition.
Definition Observer.hh:10
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29