openMSX
RomPageNN.cc
Go to the documentation of this file.
1 #include "RomPageNN.hh"
2 #include "Rom.hh"
3 #include "serialize.hh"
4 
5 namespace openmsx {
6 
7 RomPageNN::RomPageNN(const DeviceConfig& config, std::unique_ptr<Rom> rom, byte pages)
8  : Rom8kBBlocks(config, std::move(rom))
9 {
10  int bank = 0;
11  for (int page = 0; page < 4; ++page) {
12  if (pages & (1 << page)) {
13  setRom(page * 2 + 0, bank++);
14  setRom(page * 2 + 1, bank++);
15  } else {
16  setUnmapped(page * 2 + 0);
17  setUnmapped(page * 2 + 1);
18  }
19  }
20 }
21 
22 REGISTER_MSXDEVICE(RomPageNN, "RomPageNN");
23 
24 } // namespace openmsx
void setRom(byte region, int block)
Selects a block of the ROM image for reading in a certain region.
Definition: RomBlocks.cc:95
REGISTER_MSXDEVICE(DebugDevice,"DebugDevice")
const byte * bank[NUM_BANKS]
Definition: RomBlocks.hh:80
unsigned char byte
8 bit unsigned integer
Definition: openmsx.hh:33
RomPageNN(const DeviceConfig &config, std::unique_ptr< Rom > rom, byte pages)
Definition: RomPageNN.cc:7
void setUnmapped(byte region)
Select 'unmapped' memory for this region.
Definition: RomBlocks.cc:76