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
serialize.hh
openmsx::RomGeneric16kB::writeMem
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.
Definition: RomGeneric16kB.cc:20
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
openmsx::MSXDevice::unmappedWrite
static byte unmappedWrite[0x10000]
Definition: MSXDevice.hh:301
openmsx::RomGeneric16kB
Definition: RomGeneric16kB.hh:9
openmsx::REGISTER_MSXDEVICE
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
openmsx::RomBlocks::setRom
void setRom(byte region, unsigned block)
Selects a block of the ROM image for reading in a certain region.
Definition: RomBlocks.cc:104
openmsx::RomBlocks::setUnmapped
void setUnmapped(byte region)
Select 'unmapped' memory for this region.
Definition: RomBlocks.cc:91
openmsx::RomBlocks
Definition: RomBlocks.hh:14
openmsx::RomGeneric16kB::getWriteCacheLine
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: RomGeneric16kB.cc:25
openmsx::Rom
Definition: Rom.hh:21
openmsx::RomGeneric16kB::RomGeneric16kB
RomGeneric16kB(const DeviceConfig &config, Rom &&rom)
Definition: RomGeneric16kB.cc:6
openmsx::RomGeneric16kB::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomGeneric16kB.cc:12
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
RomGeneric16kB.hh
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5