openMSX
RomPageNN.cc
Go to the documentation of this file.
1 #include "RomPageNN.hh"
2 #include "serialize.hh"
3 
4 namespace openmsx {
5 
6 RomPageNN::RomPageNN(const DeviceConfig& config, Rom&& rom_, byte pages)
7  : Rom8kBBlocks(config, std::move(rom_))
8 {
9  int bank = 0;
10  for (int page = 0; page < 4; ++page) {
11  if (pages & (1 << page)) {
12  setRom(page * 2 + 0, bank++);
13  setRom(page * 2 + 1, bank++);
14  } else {
15  setUnmapped(page * 2 + 0);
16  setUnmapped(page * 2 + 1);
17  }
18  }
19 }
20 
21 REGISTER_MSXDEVICE(RomPageNN, "RomPageNN");
22 
23 } // namespace openmsx
openmsx::RomPageNN
Definition: RomPageNN.hh:8
serialize.hh
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::REGISTER_MSXDEVICE
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
openmsx::RomPageNN::RomPageNN
RomPageNN(const DeviceConfig &config, Rom &&rom, byte pages)
Definition: RomPageNN.cc:6
openmsx::RomBlocks::setRom
void setRom(byte region, unsigned block)
Selects a block of the ROM image for reading in a certain region.
Definition: RomBlocks.cc:104
openmsx::RomBlocks::setUnmapped
void setUnmapped(byte region)
Select 'unmapped' memory for this region.
Definition: RomBlocks.cc:91
openmsx::RomBlocks
Definition: RomBlocks.hh:13
openmsx::Rom
Definition: Rom.hh:20
RomPageNN.hh
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5