11 getCommandController(),
"turborpause",
12 "status of the TurboR pause", false)
14 pauseSetting.
attach(*
this);
15 reset(EmuTime::dummy());
21 pauseSetting.
detach(*
this);
48 if (
bool newTurboLed = (status & 0x80) != 0;
49 newTurboLed != turboLed) {
50 turboLed = newTurboLed;
56void MSXTurboRPause::update(
const Setting& )
noexcept
61void MSXTurboRPause::updatePause()
63 if (
bool newHwPause = (status & 0x02) && pauseSetting.
getBoolean();
64 newHwPause != hwPause) {
73 bool newPauseLed = (status & 0x01) || hwPause;
74 if (newPauseLed != pauseLed) {
75 pauseLed = newPauseLed;
80template<
typename Archive>
83 ar.template serializeBase<MSXDevice>(*
this);
84 ar.serialize(
"status", status);
85 if constexpr (Archive::IS_LOADER) {
86 writeIO(0, status, EmuTime::dummy());
#define REGISTER_MSXDEVICE(CLASS, NAME)
bool getBoolean() const noexcept
void setLed(Led led, bool status)
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
MSXMotherBoard & getMotherBoard() const
Get the mother board this device belongs to.
LedStatus & getLedStatus() const
void pause()
Pause MSX machine.
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.
MSXTurboRPause(const DeviceConfig &config)
~MSXTurboRPause() override
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)
void detach(Observer< T > &observer)
void attach(Observer< T > &observer)
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)