openMSX
ROMHunterMk2.hh
Go to the documentation of this file.
1#ifndef ROMHUNTERMK2_HH
2#define ROMHUNTERMK2_HH
3
4#include "MSXRom.hh"
5#include "Ram.hh"
6#include <array>
7
8namespace openmsx {
9
10class ROMHunterMk2 final : public MSXRom
11{
12public:
13 ROMHunterMk2(const DeviceConfig& config, Rom&& rom);
14
15 void reset(EmuTime::param time) override;
16 [[nodiscard]] byte peekMem(word address, EmuTime::param time) const override;
17 [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
18 [[nodiscard]] const byte* getReadCacheLine(word address) const override;
19 void writeMem(word address, byte value, EmuTime::param time) override;
20 [[nodiscard]] byte* getWriteCacheLine(word address) const override;
21
22 template<typename Archive>
23 void serialize(Archive& ar, unsigned version);
24
25private:
26 [[nodiscard]] unsigned getRamAddr(unsigned addr) const;
27
28private:
29 Ram ram;
30 byte configReg;
31 std::array<byte, 4> bankRegs;
32};
33
34} // namespace openmsx
35
36#endif
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
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.
void reset(EmuTime::param time) override
This method is called on reset.
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29