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
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::RomPanasonic::serialize
void serialize(Archive &ar, unsigned version)
Definition: RomPanasonic.cc:184
openmsx::RomPanasonic::RomPanasonic
RomPanasonic(const DeviceConfig &config, Rom &&rom)
Definition: RomPanasonic.cc:15
openmsx::RomPanasonic
Definition: RomPanasonic.hh:10
openmsx::RomPanasonic::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: RomPanasonic.cc:52
openmsx::RomPanasonic::getWriteCacheLine
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: RomPanasonic.cc:131
openmsx::PanasonicMemory
Definition: PanasonicMemory.hh:14
openmsx::RomBlocks
Definition: RomBlocks.hh:13
openmsx::MSXRom::rom
Rom rom
Definition: MSXRom.hh:20
openmsx::Rom
Definition: Rom.hh:20
openmsx::RomPanasonic::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomPanasonic.cc:42
openmsx::RomPanasonic::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: RomPanasonic.cc:76
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::RomPanasonic::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: RomPanasonic.cc:91
openmsx::RomPanasonic::getReadCacheLine
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:81
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
RomBlocks.hh