openMSX
ESE_SCC.hh
Go to the documentation of this file.
1 #ifndef ESE_SCC_HH
2 #define ESE_SCC_HH
3 
4 #include "MSXDevice.hh"
5 #include "SRAM.hh"
6 #include "SCC.hh"
7 #include "RomBlockDebuggable.hh"
8 
9 namespace openmsx {
10 
11 class MB89352;
12 
13 class ESE_SCC final : public MSXDevice
14 {
15 public:
16  ESE_SCC(const DeviceConfig& config, bool withSCSI);
17 
18  void powerUp(EmuTime::param time) override;
19  void reset(EmuTime::param time) override;
20 
21  byte readMem(word address, EmuTime::param time) override;
22  byte peekMem(word address, EmuTime::param time) const override;
23  void writeMem(word address, byte value, EmuTime::param time) override;
24  const byte* getReadCacheLine(word address) const override;
25  byte* getWriteCacheLine(word address) const override;
26 
27  template<typename Archive>
28  void serialize(Archive& ar, unsigned version);
29 
30 private:
31  unsigned getSramSize(bool withSCSI) const;
32  void setMapperLow(unsigned page, byte value);
33  void setMapperHigh(byte value);
34 
35  SRAM sram;
36  SCC scc;
37  const std::unique_ptr<MB89352> spc; // can be nullptr
38  RomBlockDebuggable romBlockDebug;
39 
40  const byte mapperMask;
41  byte mapper[4];
42  bool spcEnable;
43  bool sccEnable;
44  bool writeEnable;
45 };
46 
47 } // namespace openmsx
48 
49 #endif
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading...
Definition: ESE_SCC.cc:190
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: ESE_SCC.cc:150
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
ESE_SCC(const DeviceConfig &config, bool withSCSI)
Definition: ESE_SCC.cc:71
void serialize(Archive &ar, unsigned version)
Definition: ESE_SCC.cc:251
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition: ESE_SCC.cc:88
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
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ESE_SCC.cc:94
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing...
Definition: ESE_SCC.cc:244
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: ESE_SCC.cc:205
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: ESE_SCC.cc:170