openMSX
MegaSCSI.hh
Go to the documentation of this file.
1 #ifndef MEGASCSI_HH
2 #define MEGASCSI_HH
3 
4 #include "MSXDevice.hh"
5 #include "MB89352.hh"
6 #include "SRAM.hh"
7 #include "RomBlockDebuggable.hh"
8 
9 namespace openmsx {
10 
11 class MegaSCSI final : public MSXDevice
12 {
13 public:
14  explicit MegaSCSI(const DeviceConfig& config);
15 
16  void reset(EmuTime::param time) override;
17 
18  [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
19  [[nodiscard]]byte peekMem(word address, EmuTime::param time) const override;
20  void writeMem(word address, byte value, EmuTime::param time) override;
21  [[nodiscard]]const byte* getReadCacheLine(word address) const override;
22  [[nodiscard]]byte* getWriteCacheLine(word address) const override;
23 
24  template<typename Archive>
25  void serialize(Archive& ar, unsigned version);
26 
27 private:
28  [[nodiscard]]unsigned getSramSize() const;
29  void setSRAM(unsigned region, byte block);
30 
31 private:
32  MB89352 mb89352;
33  SRAM sram;
34  RomBlockDebuggable romBlockDebug;
35 
36  bool isWriteable[4]; // which region is readonly?
37  byte mapped[4]; // SPC block mapped in this region?
38  const byte blockMask;
39 };
40 
41 } // namespace openmsx
42 
43 #endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
void serialize(Archive &ar, unsigned version)
Definition: MegaSCSI.cc:177
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: MegaSCSI.cc:153
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: MegaSCSI.cc:83
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: MegaSCSI.cc:104
void writeMem(word address, byte value, EmuTime::param time) override
Write a given byte to a given location at a certain time to this device.
Definition: MegaSCSI.cc:133
MegaSCSI(const DeviceConfig &config)
Definition: MegaSCSI.cc:66
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MegaSCSI.cc:75
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: MegaSCSI.cc:118
This file implemented 3 utility functions:
Definition: Autofire.cc:5
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29