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 {
9  reset(EmuTime::dummy());
10 }
11 
12 void RomGeneric16kB::reset(EmuTime::param /*time*/)
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 
35 
36 } // namespace openmsx
static byte unmappedWrite[0x10000]
Definition: MSXDevice.hh:302
void setRom(byte region, unsigned block)
Selects a block of the ROM image for reading in a certain region.
Definition: RomBlocks.cc:105
void setUnmapped(byte region)
Select 'unmapped' memory for this region.
Definition: RomBlocks.cc:92
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.
void reset(EmuTime::param time) override
This method is called on reset.
RomGeneric16kB(const DeviceConfig &config, Rom &&rom)
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
This file implemented 3 utility functions:
Definition: Autofire.cc:9
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29