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"
8
9namespace openmsx {
10
11class MB89352;
12
13class ESE_SCC final : public MSXDevice
14{
15public:
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 [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
22 [[nodiscard]] byte peekMem(word address, EmuTime::param time) const override;
23 void writeMem(word address, byte value, EmuTime::param time) override;
24 [[nodiscard]] const byte* getReadCacheLine(word address) const override;
25 [[nodiscard]] byte* getWriteCacheLine(word address) const override;
26
27 template<typename Archive>
28 void serialize(Archive& ar, unsigned version);
29
30private:
31 [[nodiscard]] unsigned getSramSize(bool withSCSI) const;
32 void setMapperLow(unsigned page, byte value);
33 void setMapperHigh(byte value);
34
35private:
36 SRAM sram;
37 SCC scc;
38 const std::unique_ptr<MB89352> spc; // can be nullptr
39 RomBlockDebuggable romBlockDebug;
40
41 const byte mapperMask;
42 byte mapper[4];
43 bool spcEnable;
44 bool sccEnable;
45 bool writeEnable;
46};
47
48} // namespace openmsx
49
50#endif
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
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
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ESE_SCC.cc:95
void serialize(Archive &ar, unsigned version)
Definition: ESE_SCC.cc:252
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition: ESE_SCC.cc:89
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
ESE_SCC(const DeviceConfig &config, bool withSCSI)
Definition: ESE_SCC.cc:74
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: ESE_SCC.cc:171
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
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:33
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29