openMSX
RomGeneric8kB.cc
Go to the documentation of this file.
1 #include "RomGeneric8kB.hh"
2 #include "serialize.hh"
3 
4 namespace openmsx {
5 
7  : Rom8kBBlocks(config, std::move(rom_))
8 {
9  reset(EmuTime::dummy());
10 }
11 
12 void RomGeneric8kB::reset(EmuTime::param /*time*/)
13 {
14  setUnmapped(0);
15  setUnmapped(1);
16  for (int i = 2; i < 6; i++) {
17  setRom(i, i - 2);
18  }
19  setUnmapped(6);
20  setUnmapped(7);
21 }
22 
23 void RomGeneric8kB::writeMem(word address, byte value, EmuTime::param /*time*/)
24 {
25  setRom(address >> 13, value);
26 }
27 
29 {
30  if ((0x4000 <= address) && (address < 0xC000)) {
31  return nullptr;
32  } else {
33  return unmappedWrite;
34  }
35 }
36 
37 REGISTER_MSXDEVICE(RomGeneric8kB, "RomGeneric8kB");
38 
39 } // namespace openmsx
void reset(EmuTime::param time) override
This method is called on reset.
void setRom(byte region, unsigned block)
Selects a block of the ROM image for reading in a certain region.
Definition: RomBlocks.cc:98
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
STL namespace.
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
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 * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing...
RomGeneric8kB(const DeviceConfig &config, Rom &&rom)
Definition: RomGeneric8kB.cc:6
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
static byte unmappedWrite[0x10000]
Definition: MSXDevice.hh:275
void setUnmapped(byte region)
Select &#39;unmapped&#39; memory for this region.
Definition: RomBlocks.cc:85