openMSX
RomSuperSwangi.cc
Go to the documentation of this file.
1#include "RomSuperSwangi.hh"
2#include "CacheLine.hh"
3#include "serialize.hh"
4
5namespace openmsx {
6
8 : Rom16kBBlocks(config, std::move(rom_))
9{
10 reset(EmuTime::dummy());
11}
12
13void RomSuperSwangi::reset(EmuTime::param /*time*/)
14{
15 setUnmapped(0);
16 setRom(1, 0);
17 setRom(2, 0);
18 setUnmapped(3);
19}
20
21void 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.data();
32}
33
35
36} // 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
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
RomSuperSwangi(const DeviceConfig &config, Rom &&rom)
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.
constexpr unsigned HIGH
Definition CacheLine.hh:10
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29
STL namespace.