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  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  const std::unique_ptr<SCC> scc; // can be nullptr
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:65
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:182
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:122
openmsx::AmdFlash
Definition: AmdFlash.hh:18
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
serialize_meta.hh
openmsx::RomManbow2::serialize
void serialize(Archive &ar, unsigned version)
Definition: RomManbow2.cc:209
openmsx::AY8910
AY8910
Definition: AY8910.cc:1021
openmsx::RomManbow2::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: RomManbow2.cc:109
openmsx::SCC
SCC
Definition: SCC.cc:601
openmsx::MSXRom
Definition: MSXRom.hh:10
openmsx::SERIALIZE_CLASS_VERSION
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
AmdFlash.hh
openmsx::RomManbow2::RomManbow2
RomManbow2(const DeviceConfig &config, Rom &&rom, RomType type)
Definition: RomManbow2.cc:41
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:135
openmsx::MSXRom::rom
Rom rom
Definition: MSXRom.hh:20
openmsx::Rom
Definition: Rom.hh:21
RomTypes.hh
openmsx::RomManbow2::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomManbow2.cc:82
openmsx::RomBlockDebuggable
Definition: RomBlockDebuggable.hh:26
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:188
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
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:74
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:148
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::RomManbow2
Definition: RomManbow2.hh:17
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:173
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:194