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 
7 namespace openmsx {
8 
9 class MSXCPU;
10 
11 class RomRamFile final : public MSXRom
12 {
13 public:
14  RomRamFile(const DeviceConfig& config, Rom&& rom);
15 
16  void reset(EmuTime::param time) override;
17  byte readMem(word address, EmuTime::param time) override;
18  byte peekMem(word address, EmuTime::param time) const override;
19  const byte* getReadCacheLine(word address) const override;
20  void writeMem(word address, byte value, EmuTime::param time) override;
21  byte* getWriteCacheLine(word address) const override;
22 
23  template<typename Archive>
24  void serialize(Archive& ar, unsigned version);
25 
26 private:
27  std::unique_ptr<SRAM> sram;
28  MSXCPU& cpu;
29  byte shiftValue;
30 };
31 
32 } // namespace openmsx
33 
34 #endif
openmsx::RomRamFile::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: RomRamFile.cc:63
openmsx::RomRamFile::getReadCacheLine
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:74
openmsx::RomRamFile::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: RomRamFile.cc:47
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::RomRamFile::serialize
void serialize(Archive &ar, unsigned version)
Definition: RomRamFile.cc:105
openmsx::MSXCPU
MSXCPU
Definition: MSXCPU.cc:549
openmsx::MSXRom
Definition: MSXRom.hh:9
openmsx::RomRamFile::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomRamFile.cc:42
MSXRom.hh
openmsx::MSXCPU
Definition: MSXCPU.hh:28
openmsx::MSXRom::rom
Rom rom
Definition: MSXRom.hh:20
openmsx::Rom
Definition: Rom.hh:20
SRAM.hh
openmsx::RomRamFile::getWriteCacheLine
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: RomRamFile.cc:94
openmsx::RomRamFile::writeMem
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:86
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::RomRamFile
Definition: RomRamFile.hh:11
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::RomRamFile::RomRamFile
RomRamFile(const DeviceConfig &config, Rom &&rom)
Definition: RomRamFile.cc:34