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 
13 namespace openmsx {
14 
16  : Rom16kBBlocks(config, std::move(rom_))
17 {
19 }
20 
22 {
23  setUnmapped(0);
24  setRom(1, 0);
25  setRom(2, 1);
26  setUnmapped(3);
27 }
28 
29 void 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;
44  }
45 }
46 
47 REGISTER_MSXDEVICE(RomHarryFox, "RomHarryFox");
48 
49 } // namespace openmsx
void setRom(byte region, int block)
Selects a block of the ROM image for reading in a certain region.
Definition: RomBlocks.cc:86
REGISTER_MSXDEVICE(DebugDevice,"DebugDevice")
static param dummy()
Definition: EmuTime.hh:21
STL namespace.
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomHarryFox.cc:21
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
RomHarryFox(const DeviceConfig &config, Rom &&rom)
Definition: RomHarryFox.cc:15
unsigned char byte
8 bit unsigned integer
Definition: openmsx.hh:25
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
static byte unmappedWrite[0x10000]
Definition: MSXDevice.hh:267
void setUnmapped(byte region)
Select 'unmapped' memory for this region.
Definition: RomBlocks.cc:73
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
unsigned short word
16 bit unsigned integer
Definition: openmsx.hh:28