openMSX
RomManbow2.hh
Go to the documentation of this file.
1 #ifndef ROMMANBOW2_HH
2 #define ROMMANBOW2_HH
3 
4 #include "MSXRom.hh"
5 #include "RomTypes.hh"
6 #include "SCC.hh"
7 #include "AmdFlash.hh"
8 #include "RomBlockDebuggable.hh"
9 #include "serialize_meta.hh"
10 #include <memory>
11 
12 namespace openmsx {
13 
14 class AY8910;
15 
16 class RomManbow2 final : public MSXRom
17 {
18 public:
19  RomManbow2(const DeviceConfig& config, Rom&& rom, RomType type);
20  ~RomManbow2() override;
21 
22  void powerUp(EmuTime::param time) override;
23  void reset(EmuTime::param time) override;
24  byte peekMem(word address, EmuTime::param time) const override;
25  byte readMem(word address, EmuTime::param time) override;
26  void writeMem(word address, byte value, EmuTime::param time) override;
27  const byte* getReadCacheLine(word address) const override;
28  byte* getWriteCacheLine(word address) const override;
29 
30  byte readIO(word port, EmuTime::param time) override;
31  byte peekIO(word port, EmuTime::param time) const override;
32  void writeIO(word port, byte value, EmuTime::param time) override;
33 
34  template<typename Archive>
35  void serialize(Archive& ar, unsigned version);
36 
37 private:
38  void setRom(unsigned region, unsigned block);
39 
40  SCC scc;
41  const std::unique_ptr<AY8910> psg; // can be nullptr
42  AmdFlash flash;
43  RomBlockDebuggable romBlockDebug;
44  byte psgLatch;
45  byte bank[4];
46  bool sccEnabled;
47 };
49 
50 } // namespace openmsx
51 
52 #endif
openmsx::RomManbow2::~RomManbow2
~RomManbow2() override
Definition: RomManbow2.cc:53
openmsx::RomManbow2::readIO
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: RomManbow2.cc:166
openmsx::RomManbow2::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: RomManbow2.cc:106
openmsx::AmdFlash
Definition: AmdFlash.hh:17
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
serialize_meta.hh
openmsx::RomManbow2::serialize
void serialize(Archive &ar, unsigned version)
Definition: RomManbow2.cc:192
openmsx::AY8910
AY8910
Definition: AY8910.cc:1018
openmsx::RomManbow2::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: RomManbow2.cc:93
openmsx::MSXRom
Definition: MSXRom.hh:9
openmsx::SERIALIZE_CLASS_VERSION
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
AmdFlash.hh
openmsx::SCC
Definition: SCC.hh:11
openmsx::RomManbow2::RomManbow2
RomManbow2(const DeviceConfig &config, Rom &&rom, RomType type)
Definition: RomManbow2.cc:32
MSXRom.hh
openmsx::RomManbow2::getReadCacheLine
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: RomManbow2.cc:119
openmsx::MSXRom::rom
Rom rom
Definition: MSXRom.hh:20
openmsx::Rom
Definition: Rom.hh:20
RomTypes.hh
openmsx::RomManbow2::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomManbow2.cc:68
openmsx::RomBlockDebuggable
Definition: RomBlockDebuggable.hh:25
RomBlockDebuggable.hh
openmsx::RomManbow2::peekIO
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: RomManbow2.cc:172
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
SCC.hh
openmsx::RomType
RomType
Definition: RomTypes.hh:6
openmsx::RomManbow2::powerUp
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition: RomManbow2.cc:62
openmsx::RomManbow2::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: RomManbow2.cc:132
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::RomManbow2
Definition: RomManbow2.hh:16
openmsx::RomManbow2::getWriteCacheLine
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: RomManbow2.cc:157
openmsx::RomManbow2::writeIO
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
Definition: RomManbow2.cc:178