openMSX
MSXS1985.hh
Go to the documentation of this file.
1 /*
2  * This class implements the
3  * backup RAM
4  * bitmap function
5  * of the S1985 MSX-engine
6  *
7  * TODO explanation
8  */
9 
10 #ifndef S1985_HH
11 #define S1985_HH
12 
13 #include "MSXDevice.hh"
14 #include "MSXSwitchedDevice.hh"
15 #include <memory>
16 
17 namespace openmsx {
18 
19 class SRAM;
20 
21 class MSXS1985 final : public MSXDevice, public MSXSwitchedDevice
22 {
23 public:
24  explicit MSXS1985(const DeviceConfig& config);
25  ~MSXS1985() override;
26 
27  // MSXDevice
28  void reset(EmuTime::param time) override;
29 
30  // MSXSwitchedDevice
31  byte readSwitchedIO(word port, EmuTime::param time) override;
32  byte peekSwitchedIO(word port, EmuTime::param time) const override;
33  void writeSwitchedIO(word port, byte value, EmuTime::param time) override;
34 
35  template<typename Archive>
36  void serialize(Archive& ar, unsigned version);
37 
38 private:
39  std::unique_ptr<SRAM> sram;
40  nibble address;
41  byte color1;
42  byte color2;
43  byte pattern;
44 };
46 
47 } // namespace openmsx
48 
49 #endif
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:31
openmsx::MSXS1985::~MSXS1985
~MSXS1985() override
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::MSXS1985
Definition: MSXS1985.hh:21
openmsx::MSXSwitchedDevice
Definition: MSXSwitchedDevice.hh:11
openmsx::MSXS1985::MSXS1985
MSXS1985(const DeviceConfig &config)
Definition: MSXS1985.cc:10
openmsx::SERIALIZE_CLASS_VERSION
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
openmsx::SRAM
SRAM
Definition: SRAM.cc:150
openmsx::MSXS1985::serialize
void serialize(Archive &ar, unsigned version)
Definition: MSXS1985.cc:87
openmsx::MSXS1985::readSwitchedIO
byte readSwitchedIO(word port, EmuTime::param time) override
Definition: MSXS1985.cc:35
MSXSwitchedDevice.hh
openmsx::nibble
uint8_t nibble
4 bit integer
Definition: openmsx.hh:23
MSXDevice.hh
openmsx::MSXS1985::peekSwitchedIO
byte peekSwitchedIO(word port, EmuTime::param time) const override
Definition: MSXS1985.cc:46
openmsx::MSXS1985::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MSXS1985.cc:30
openmsx::MSXS1985::writeSwitchedIO
void writeSwitchedIO(word port, byte value, EmuTime::param time) override
Definition: MSXS1985.cc:65
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5