openMSX
RomGeneric16kB.cc
Go to the documentation of this file.
1#include "RomGeneric16kB.hh"
2#include "serialize.hh"
3
4namespace openmsx {
5
7 : Rom16kBBlocks(config, std::move(rom_))
8{
9 reset(EmuTime::dummy());
10}
11
12void RomGeneric16kB::reset(EmuTime::param /*time*/)
13{
14 setUnmapped(0);
15 setRom(1, 0);
16 setRom(2, 1);
17 setUnmapped(3);
18}
19
20void 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.data();
31 }
32}
33
35
36} // namespace openmsx
#define REGISTER_MSXDEVICE(CLASS, NAME)
Definition MSXDevice.hh:354
static std::array< byte, 0x10000 > unmappedWrite
Definition MSXDevice.hh:305
void setUnmapped(unsigned region)
Select 'unmapped' memory for this region.
Definition RomBlocks.cc:92
void setRom(unsigned region, unsigned block)
Selects a block of the ROM image for reading in a certain region.
Definition RomBlocks.cc:104
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
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29
STL namespace.