openMSX
MSXS1990.hh
Go to the documentation of this file.
1 #ifndef MSXS1990_HH
2 #define MSXS1990_HH
3 
4 #include "MSXDevice.hh"
5 #include "FirmwareSwitch.hh"
6 #include "SimpleDebuggable.hh"
7 
8 namespace openmsx {
9 
15 class MSXS1990 final : public MSXDevice
16 {
17 public:
18  explicit MSXS1990(const DeviceConfig& config);
19 
20  void reset(EmuTime::param time) override;
21  [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
22  [[nodiscard]] byte peekIO(word port, EmuTime::param time) const override;
23  void writeIO(word port, byte value, EmuTime::param time) override;
24 
25  template<typename Archive>
26  void serialize(Archive& ar, unsigned version);
27 
28 private:
29  [[nodiscard]] byte readRegister(byte reg) const;
30  void writeRegister(byte reg, byte value);
31  void setCPUStatus(byte value);
32 
33 private:
34  struct Debuggable final : SimpleDebuggable {
35  Debuggable(MSXMotherBoard& motherBoard, const std::string& name);
36  [[nodiscard]] byte read(unsigned address) override;
37  void write(unsigned address, byte value) override;
38  } debuggable;
39 
40  FirmwareSwitch firmwareSwitch;
41  byte registerSelect;
42  byte cpuStatus;
43 };
44 
45 } // namespace openmsx
46 
47 #endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:33
This class implements the MSX-engine found in a MSX Turbo-R (S1990)
Definition: MSXS1990.hh:16
void serialize(Archive &ar, unsigned version)
Definition: MSXS1990.cc:115
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: MSXS1990.cc:43
MSXS1990(const DeviceConfig &config)
Definition: MSXS1990.cc:11
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MSXS1990.cc:19
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: MSXS1990.cc:25
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: MSXS1990.cc:30
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29