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 
7 namespace openmsx {
8 
9 class ROMHunterMk2 final : public MSXRom
10 {
11 public:
12  ROMHunterMk2(const DeviceConfig& config, Rom&& rom);
13 
14  void reset(EmuTime::param time) override;
15  byte peekMem(word address, EmuTime::param time) const override;
16  byte readMem(word address, EmuTime::param time) override;
17  const byte* getReadCacheLine(word address) const override;
18  void writeMem(word address, byte value, EmuTime::param time) override;
19  byte* getWriteCacheLine(word address) const override;
20 
21  template<typename Archive>
22  void serialize(Archive& ar, unsigned version);
23 
24 private:
25  unsigned getRamAddr(unsigned addr) const;
26 
27  Ram ram;
28  byte configReg;
29  byte bankRegs[4];
30 };
31 
32 } // namespace openmsx
33 
34 #endif
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: ROMHunterMk2.cc:77
ROMHunterMk2(const DeviceConfig &config, Rom &&rom)
Definition: ROMHunterMk2.cc:28
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing...
void serialize(Archive &ar, unsigned version)
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ROMHunterMk2.cc:35
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: ROMHunterMk2.cc:67
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: ROMHunterMk2.cc:72
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading...
Definition: ROMHunterMk2.cc:52