openMSX
RomSuperSwangi.cc
Go to the documentation of this file.
1 #include "RomSuperSwangi.hh"
2 #include "CacheLine.hh"
3 #include "serialize.hh"
4 
5 namespace openmsx {
6 
8  : Rom16kBBlocks(config, std::move(rom_))
9 {
10  reset(EmuTime::dummy());
11 }
12 
13 void RomSuperSwangi::reset(EmuTime::param /*time*/)
14 {
15  setUnmapped(0);
16  setRom(1, 0);
17  setRom(2, 0);
18  setUnmapped(3);
19 }
20 
21 void RomSuperSwangi::writeMem(word address, byte value, EmuTime::param /*time*/)
22 {
23  if (address == 0x8000) {
24  setRom(2, value >> 1);
25  }
26 }
27 
29 {
30  if (address == (0x8000 & CacheLine::HIGH)) return nullptr;
31  return unmappedWrite;
32 }
33 
34 REGISTER_MSXDEVICE(RomSuperSwangi, "RomSuperSwangi");
35 
36 } // namespace openmsx
void setRom(byte region, unsigned block)
Selects a block of the ROM image for reading in a certain region.
Definition: RomBlocks.cc:98
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
STL namespace.
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
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.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
void reset(EmuTime::param time) override
This method is called on reset.
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
static byte unmappedWrite[0x10000]
Definition: MSXDevice.hh:275
void setUnmapped(byte region)
Select 'unmapped' memory for this region.
Definition: RomBlocks.cc:85
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing...
RomSuperSwangi(const DeviceConfig &config, Rom &&rom)