openMSX
RomMatraInk.cc
Go to the documentation of this file.
1#include "RomMatraInk.hh"
2#include "ranges.hh"
3#include "serialize.hh"
4#include <array>
5
6namespace openmsx {
7
9 : MSXRom(config, std::move(rom_))
10 , flash(rom, AmdFlashChip::AM29F040, {}, config)
11{
12 reset(EmuTime::dummy());
13}
14
15void RomMatraInk::reset(EmuTime::param /*time*/)
16{
17 flash.reset();
18}
19
20byte RomMatraInk::peekMem(word address, EmuTime::param /*time*/) const
21{
22 return flash.peek(address);
23}
24
25byte RomMatraInk::readMem(word address, EmuTime::param /*time*/)
26{
27 return flash.read(address);
28}
29
30void RomMatraInk::writeMem(word address, byte value, EmuTime::param /*time*/)
31{
32 flash.write(address + 0x10000, value);
33}
34
35const byte* RomMatraInk::getReadCacheLine(word address) const
36{
37 return flash.getReadCacheLine(address);
38}
39
41{
42 return nullptr;
43}
44
45template<typename Archive>
46void RomMatraInk::serialize(Archive& ar, unsigned /*version*/)
47{
48 // skip MSXRom base class
49 ar.template serializeBase<MSXDevice>(*this);
50
51 ar.serialize("flash", flash);
52}
55
56} // namespace openmsx
#define REGISTER_MSXDEVICE(CLASS, NAME)
Definition MSXDevice.hh:356
void write(size_t address, uint8_t value)
Definition AmdFlash.cc:456
const uint8_t * getReadCacheLine(size_t address) const
Definition AmdFlash.cc:444
uint8_t read(size_t address)
Definition AmdFlash.cc:432
uint8_t peek(size_t address) const
Definition AmdFlash.cc:186
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
void serialize(Archive &ar, unsigned version)
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
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.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
void reset(EmuTime::param time) override
This method is called on reset.
RomMatraInk(const DeviceConfig &config, Rom &&rom)
Definition RomMatraInk.cc:8
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29
STL namespace.
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)