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"
8#include "serialize_meta.hh"
9#include <array>
10#include <memory>
11
12namespace openmsx {
13
14class AY8910;
15class SCC;
16
17class RomManbow2 final : public MSXRom
18{
19public:
20 RomManbow2(const DeviceConfig& config, Rom&& rom, RomType type);
21 ~RomManbow2() override;
22
23 void powerUp(EmuTime::param time) override;
24 void reset(EmuTime::param time) override;
25 [[nodiscard]] byte peekMem(word address, EmuTime::param time) const override;
26 [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
27 void writeMem(word address, byte value, EmuTime::param time) override;
28 [[nodiscard]] const byte* getReadCacheLine(word address) const override;
29 [[nodiscard]] byte* getWriteCacheLine(word address) const override;
30
31 [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
32 [[nodiscard]] byte peekIO(word port, EmuTime::param time) const override;
33 void writeIO(word port, byte value, EmuTime::param time) override;
34
35 template<typename Archive>
36 void serialize(Archive& ar, unsigned version);
37
38private:
39 void setRom(unsigned region, byte block);
40
41private:
42 const std::unique_ptr<SCC> scc; // can be nullptr
43 const std::unique_ptr<AY8910> psg; // can be nullptr
44 AmdFlash flash;
45 RomBlockDebuggable romBlockDebug;
46 byte psgLatch;
47 std::array<byte, 4> bank;
48 bool sccEnabled;
49};
51
52} // namespace openmsx
53
54#endif
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: RomManbow2.cc:214
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:161
~RomManbow2() override
Definition: RomManbow2.cc:91
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:220
RomManbow2(const DeviceConfig &config, Rom &&rom, RomType type)
Definition: RomManbow2.cc:65
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomManbow2.cc:108
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: RomManbow2.cc:135
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition: RomManbow2.cc:100
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:174
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: RomManbow2.cc:148
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:208
void serialize(Archive &ar, unsigned version)
Definition: RomManbow2.cc:235
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: RomManbow2.cc:199
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:598