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
static std::array< byte, 0x10000 > unmappedWrite
Definition: MSXDevice.hh:303
void setRom(byte region, unsigned block)
Selects a block of the ROM image for reading in a certain region.
Definition: RomBlocks.cc:103
void setUnmapped(byte region)
Select 'unmapped' memory for this region.
Definition: RomBlocks.cc:91
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: RomHarryFox.cc:38
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomHarryFox.cc:21
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: RomHarryFox.cc:29
RomHarryFox(const DeviceConfig &config, Rom &&rom)
Definition: RomHarryFox.cc:15
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
STL namespace.