openMSX
RomMultiRom.cc
Go to the documentation of this file.
1//
2// Manuel Pazos MultiROM Collection
3//
4
5#include "RomMultiRom.hh"
6#include "serialize.hh"
7#include "xrange.hh"
8
9namespace openmsx {
10
12 : Rom16kBBlocks(config, std::move(rom_))
13{
14 reset(EmuTime::dummy());
15}
16
17void RomMultiRom::reset(EmuTime::param /*time*/)
18{
19 ++counter &= 7;
20 for (auto i : xrange(4)) {
21 setRom(i, counter * 4 + i);
22 }
23}
24
25template<typename Archive>
26void RomMultiRom::serialize(Archive& ar, unsigned /*version*/)
27{
28 ar.template serializeBase<Rom16kBBlocks>(*this);
29 ar.serialize("counter", counter);
30}
33
34} // namespace openmsx
#define REGISTER_MSXDEVICE(CLASS, NAME)
Definition MSXDevice.hh:356
void setRom(unsigned region, unsigned block)
Selects a block of the ROM image for reading in a certain region.
Definition RomBlocks.cc:104
RomMultiRom(const DeviceConfig &config, Rom &&rom)
void reset(EmuTime::param time) override
This method is called on reset.
void serialize(Archive &ar, unsigned version)
This file implemented 3 utility functions:
Definition Autofire.cc:11
STL namespace.
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
constexpr auto xrange(T e)
Definition xrange.hh:132