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
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:31
openmsx::ESE_SCC::writeMem
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:206
openmsx::ESE_SCC::powerUp
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition: ESE_SCC.cc:89
openmsx::ESE_SCC::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ESE_SCC.cc:95
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::MB89352
MB89352
Definition: MB89352.cc:778
openmsx::ESE_SCC::getWriteCacheLine
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:245
openmsx::ESE_SCC
Definition: ESE_SCC.hh:13
openmsx::SRAM
Definition: SRAM.hh:11
openmsx::ESE_SCC::serialize
void serialize(Archive &ar, unsigned version)
Definition: ESE_SCC.cc:252
openmsx::ESE_SCC::readMem
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:151
openmsx::ESE_SCC::getReadCacheLine
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:191
openmsx::ESE_SCC::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: ESE_SCC.cc:171
openmsx::SCC
Definition: SCC.hh:11
MSXDevice.hh
openmsx::ESE_SCC::ESE_SCC
ESE_SCC(const DeviceConfig &config, bool withSCSI)
Definition: ESE_SCC.cc:72
SRAM.hh
openmsx::RomBlockDebuggable
Definition: RomBlockDebuggable.hh:25
RomBlockDebuggable.hh
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
SCC.hh
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5