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
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
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomManbow2.cc:68
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
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
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition: RomManbow2.cc:62
RomManbow2(const DeviceConfig &config, Rom &&rom, RomType type)
Definition: RomManbow2.cc:32
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
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
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
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
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
~RomManbow2() override
Definition: RomManbow2.cc:53
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: RomManbow2.cc:93
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: RomManbow2.cc:172
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
void serialize(Archive &ar, unsigned version)
Definition: RomManbow2.cc:192
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