MSXS1985.hh 954 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * This class implements the
  3. * backup RAM
  4. * bitmap function
  5. * of the S1985 MSX-engine
  6. *
  7. * TODO explanation
  8. */
  9. #ifndef S1985_HH
  10. #define S1985_HH
  11. #include "MSXDevice.hh"
  12. #include "MSXSwitchedDevice.hh"
  13. #include <memory>
  14. namespace openmsx {
  15. class SRAM;
  16. class MSXS1985 final : public MSXDevice, public MSXSwitchedDevice
  17. {
  18. public:
  19. explicit MSXS1985(const DeviceConfig& config);
  20. ~MSXS1985() override;
  21. // MSXDevice
  22. void reset(EmuTime::param time) override;
  23. // MSXSwitchedDevice
  24. byte readSwitchedIO(word port, EmuTime::param time) override;
  25. byte peekSwitchedIO(word port, EmuTime::param time) const override;
  26. void writeSwitchedIO(word port, byte value, EmuTime::param time) override;
  27. template<typename Archive>
  28. void serialize(Archive& ar, unsigned version);
  29. private:
  30. std::unique_ptr<SRAM> sram;
  31. nibble address;
  32. byte color1;
  33. byte color2;
  34. byte pattern;
  35. };
  36. SERIALIZE_CLASS_VERSION(MSXS1985, 2);
  37. } // namespace openmsx
  38. #endif