openMSX
RomPanasonic.hh
Go to the documentation of this file.
1 #ifndef ROMPANASONIC_HH
2 #define ROMPANASONIC_HH
3 
4 #include "RomBlocks.hh"
5 
6 namespace openmsx {
7 
8 class PanasonicMemory;
9 
10 class RomPanasonic final : public Rom8kBBlocks
11 {
12 public:
13  RomPanasonic(const DeviceConfig& config, Rom&& rom);
14 
15  void reset(EmuTime::param time) override;
16  byte peekMem(word address, EmuTime::param time) const override;
17  byte readMem(word address, EmuTime::param time) override;
18  const byte* getReadCacheLine(word address) const override;
19  void writeMem(word address, byte value, EmuTime::param time) override;
20  byte* getWriteCacheLine(word address) const override;
21 
22  template<typename Archive>
23  void serialize(Archive& ar, unsigned version);
24 
25 private:
26  void changeBank(byte region, int bank);
27 
28  PanasonicMemory& panasonicMem;
29  int maxSRAMBank;
30 
31  int bankSelect[8];
32  byte control;
33 };
34 
35 } // namespace openmsx
36 
37 #endif
void serialize(Archive &ar, unsigned version)
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomPanasonic.cc:42
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 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: RomPanasonic.cc:90
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading...
Definition: RomPanasonic.cc:80
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: RomPanasonic.cc:51
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
RomPanasonic(const DeviceConfig &config, Rom &&rom)
Definition: RomPanasonic.cc:15
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: RomPanasonic.cc:75