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