openMSX
MSXFmPac.hh
Go to the documentation of this file.
1 #ifndef MSXFMPAC_HH
2 #define MSXFMPAC_HH
3 
4 #include "MSXMusic.hh"
5 #include "SRAM.hh"
6 #include "RomBlockDebuggable.hh"
7 #include "serialize_meta.hh"
8 
9 namespace openmsx {
10 
11 class MSXFmPac final : public MSXMusicBase
12 {
13 public:
14  explicit MSXFmPac(const DeviceConfig& config);
15 
16  void reset(EmuTime::param time) override;
17  void writeIO(word port, byte value, EmuTime::param time) override;
18  byte readMem(word address, EmuTime::param time) override;
19  void writeMem(word address, byte value, EmuTime::param time) override;
20  const byte* getReadCacheLine(word address) const override;
21  byte* getWriteCacheLine(word address) const override;
22 
23  template<typename Archive>
24  void serialize(Archive& ar, unsigned version);
25 
26 private:
27  void checkSramEnable();
28 
29  SRAM sram;
30  RomBlockDebuggable romBlockDebug;
31  byte enable;
32  byte bank;
33  byte r1ffe, r1fff;
34  bool sramEnabled;
35 };
36 SERIALIZE_CLASS_VERSION(MSXFmPac, 2); // must be in-sync with MSXMusicBase
37 
38 } // namespace openmsx
39 
40 #endif
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
Definition: MSXFmPac.cc:27
void serialize(Archive &ar, unsigned version)
Definition: MSXFmPac.cc:151
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading...
Definition: MSXFmPac.cc:59
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
MSXFmPac(const DeviceConfig &config)
Definition: MSXFmPac.cc:9
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MSXFmPac.cc:17
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
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: MSXFmPac.cc:78
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing...
Definition: MSXFmPac.cc:124
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: MSXFmPac.cc:34