openMSX
RomRamFile.hh
Go to the documentation of this file.
1#ifndef ROMRAMFILE_HH
2#define ROMRAMFILE_HH
3
4#include "MSXRom.hh"
5#include "SRAM.hh"
6
7namespace openmsx {
8
9class MSXCPU;
10
11class RomRamFile final : public MSXRom
12{
13public:
14 RomRamFile(const DeviceConfig& config, Rom&& rom);
15
16 void reset(EmuTime::param time) override;
17 [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
18 [[nodiscard]] byte peekMem(word address, EmuTime::param time) const override;
19 [[nodiscard]] const byte* getReadCacheLine(word address) const override;
20 void writeMem(word address, byte value, EmuTime::param time) override;
21 [[nodiscard]] byte* getWriteCacheLine(word address) const override;
22
23 template<typename Archive>
24 void serialize(Archive& ar, unsigned version);
25
26private:
27 std::unique_ptr<SRAM> sram;
28 MSXCPU& cpu;
29 byte shiftValue;
30};
31
32} // namespace openmsx
33
34#endif
void reset(EmuTime::param time) override
This method is called on reset.
Definition RomRamFile.cc:43
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition RomRamFile.cc:75
void serialize(Archive &ar, unsigned version)
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition RomRamFile.cc:95
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition RomRamFile.cc:48
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 RomRamFile.cc:87
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition RomRamFile.cc:64
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29