openMSX
RomHarryFox.cc
Go to the documentation of this file.
1// This mapper is used for the game "Harry Fox Yki no Maoh"
2
10#include "RomHarryFox.hh"
11#include "serialize.hh"
12
13namespace openmsx {
14
16 : Rom16kBBlocks(config, std::move(rom_))
17{
18 reset(EmuTime::dummy());
19}
20
21void RomHarryFox::reset(EmuTime::param /*time*/)
22{
23 setUnmapped(0);
24 setRom(1, 0);
25 setRom(2, 1);
26 setUnmapped(3);
27}
28
29void RomHarryFox::writeMem(word address, byte value, EmuTime::param /*time*/)
30{
31 if ((0x6000 <= address) && (address < 0x7000)) {
32 setRom(1, 2 * (value & 1) + 0);
33 } else if ((0x7000 <= address) && (address < 0x8000)) {
34 setRom(2, 2 * (value & 1) + 1);
35 }
36}
37
39{
40 if ((0x6000 <= address) && (address < 0x8000)) {
41 return nullptr;
42 } else {
43 return unmappedWrite.data();
44 }
45}
46
48
49} // namespace openmsx
#define REGISTER_MSXDEVICE(CLASS, NAME)
Definition MSXDevice.hh:356
static std::array< byte, 0x10000 > unmappedWrite
Definition MSXDevice.hh:307
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 reset(EmuTime::param time) override
This method is called on reset.
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.
RomHarryFox(const DeviceConfig &config, Rom &&rom)
byte * getWriteCacheLine(word address) 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:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29
STL namespace.