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) 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.
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
~RomManbow2() override
Definition RomManbow2.cc:86
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.
void reset(EmuTime::param time) override
This method is called on reset.
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition RomManbow2.cc:97
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.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
void serialize(Archive &ar, unsigned version)
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29
#define SERIALIZE_CLASS_VERSION(CLASS, VERSION)