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