MegaSCSI.hh 1006 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef MEGASCSI_HH
  2. #define MEGASCSI_HH
  3. #include "MSXDevice.hh"
  4. #include "MB89352.hh"
  5. #include "SRAM.hh"
  6. #include "RomBlockDebuggable.hh"
  7. namespace openmsx {
  8. class MegaSCSI final : public MSXDevice
  9. {
  10. public:
  11. explicit MegaSCSI(const DeviceConfig& config);
  12. void reset(EmuTime::param time) override;
  13. byte readMem(word address, EmuTime::param time) override;
  14. byte peekMem(word address, EmuTime::param time) const override;
  15. void writeMem(word address, byte value, EmuTime::param time) override;
  16. const byte* getReadCacheLine(word address) const override;
  17. byte* getWriteCacheLine(word address) const override;
  18. template<typename Archive>
  19. void serialize(Archive& ar, unsigned version);
  20. private:
  21. unsigned getSramSize() const;
  22. void setSRAM(unsigned region, byte block);
  23. MB89352 mb89352;
  24. SRAM sram;
  25. RomBlockDebuggable romBlockDebug;
  26. bool isWriteable[4]; // which region is readonly?
  27. byte mapped[4]; // SPC block mapped in this region?
  28. const byte blockMask;
  29. };
  30. } // namespace openmsx
  31. #endif