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  byte readMem(word address, EmuTime::param time) override;
19  byte peekMem(word address, EmuTime::param time) const override;
20  void writeMem(word address, byte value, EmuTime::param time) override;
21  const byte* getReadCacheLine(word address) const override;
22  byte* getWriteCacheLine(word address) const override;
23 
24  template<typename Archive>
25  void serialize(Archive& ar, unsigned version);
26 
27 private:
28  unsigned getSramSize() const;
29  void setSRAM(unsigned region, byte block);
30 
31  MB89352 mb89352;
32  SRAM sram;
33  RomBlockDebuggable romBlockDebug;
34 
35  bool isWriteable[4]; // which region is readonly?
36  byte mapped[4]; // SPC block mapped in this region?
37  const byte blockMask;
38 };
39 
40 } // namespace openmsx
41 
42 #endif
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: MegaSCSI.cc:104
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MegaSCSI.cc:73
MegaSCSI(const DeviceConfig &config)
Definition: MegaSCSI.cc:64
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
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
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: MegaSCSI.cc:81
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX...
Definition: MSXDevice.hh:31
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
void serialize(Archive &ar, unsigned version)
Definition: MegaSCSI.cc:177
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29