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 "AmdFlash.hh"
7 #include "RomBlockDebuggable.hh"
8 #include "serialize_meta.hh"
9 #include <memory>
10 
11 namespace openmsx {
12 
13 class AY8910;
14 class SCC;
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  [[nodiscard]] byte peekMem(word address, EmuTime::param time) const override;
25  [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
26  void writeMem(word address, byte value, EmuTime::param time) override;
27  [[nodiscard]] const byte* getReadCacheLine(word address) const override;
28  [[nodiscard]] byte* getWriteCacheLine(word address) const override;
29 
30  [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
31  [[nodiscard]] 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 private:
41  const std::unique_ptr<SCC> scc; // can be nullptr
42  const std::unique_ptr<AY8910> psg; // can be nullptr
43  AmdFlash flash;
44  RomBlockDebuggable romBlockDebug;
45  byte psgLatch;
46  byte bank[4];
47  bool sccEnabled;
48 };
50 
51 } // namespace openmsx
52 
53 #endif
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: RomManbow2.cc:213
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:160
~RomManbow2() override
Definition: RomManbow2.cc:90
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:219
RomManbow2(const DeviceConfig &config, Rom &&rom, RomType type)
Definition: RomManbow2.cc:64
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomManbow2.cc:107
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: RomManbow2.cc:134
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition: RomManbow2.cc:99
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:173
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: RomManbow2.cc:147
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:207
void serialize(Archive &ar, unsigned version)
Definition: RomManbow2.cc:234
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: RomManbow2.cc:198
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
SCC
Definition: SCC.cc:597