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
void setRom(byte region, int block)
Selects a block of the ROM image for reading in a certain region.
Definition: RomBlocks.cc:86
REGISTER_MSXDEVICE(DebugDevice,"DebugDevice")
const byte * bank[NUM_BANKS]
Definition: RomBlocks.hh:80
STL namespace.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
RomPageNN(const DeviceConfig &config, Rom &&rom, byte pages)
Definition: RomPageNN.cc:6
unsigned char byte
8 bit unsigned integer
Definition: openmsx.hh:25
void setUnmapped(byte region)
Select 'unmapped' memory for this region.
Definition: RomBlocks.cc:73