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"
7#include "serialize_meta.hh"
8
9namespace openmsx {
10
11class MSXFmPac final : public MSXMusicBase
12{
13public:
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 [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
19 void writeMem(word address, byte value, EmuTime::param time) override;
20 [[nodiscard]] const byte* getReadCacheLine(word address) const override;
21 [[nodiscard]] byte* getWriteCacheLine(word address) const override;
22
23 template<typename Archive>
24 void serialize(Archive& ar, unsigned version);
25
26private:
27 void checkSramEnable();
28
29private:
30 SRAM sram;
31 RomBlockDebuggable romBlockDebug;
32 byte enable;
33 byte bank;
34 byte r1ffe, r1fff;
35 bool sramEnabled;
36};
37SERIALIZE_CLASS_VERSION(MSXFmPac, 3); // must be in-sync with MSXMusicBase
38
39} // namespace openmsx
40
41#endif
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
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
void reset(EmuTime::param time) override
This method is called on reset.
Definition MSXFmPac.cc:17
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:148
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
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition MSXFmPac.cc:121
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29
#define SERIALIZE_CLASS_VERSION(CLASS, VERSION)