openMSX
RomFSA1FM.hh
Go to the documentation of this file.
1 #ifndef ROMFSA1FM1_HH
2 #define ROMFSA1FM1_HH
3 
4 #include "MSXRom.hh"
5 #include "RomBlocks.hh"
6 #include "FirmwareSwitch.hh"
7 
8 namespace openmsx {
9 
10 class SRAM;
11 
12 class RomFSA1FM1 final : public MSXRom
13 {
14 public:
15  RomFSA1FM1(const DeviceConfig& config, Rom&& rom);
16 
17  void reset(EmuTime::param time) override;
18  byte peekMem(word address, EmuTime::param time) const override;
19  byte readMem(word address, EmuTime::param time) override;
20  const byte* getReadCacheLine(word address) const override;
21  void writeMem(word address, byte value,
22  EmuTime::param time) override;
23  byte* getWriteCacheLine(word address) const override;
24 
25  template<typename Archive>
26  void serialize(Archive& ar, unsigned version);
27 
28 private:
29  std::shared_ptr<SRAM> fsSram;
30  FirmwareSwitch firmwareSwitch;
31 };
32 
33 class RomFSA1FM2 final : public Rom8kBBlocks
34 {
35 public:
36  RomFSA1FM2(const DeviceConfig& config, Rom&& rom);
37 
38  void reset(EmuTime::param time) override;
39  byte peekMem(word address, EmuTime::param time) const override;
40  byte readMem(word address, EmuTime::param time) override;
41  const byte* getReadCacheLine(word address) const override;
42  void writeMem(word address, byte value,
43  EmuTime::param time) override;
44  byte* getWriteCacheLine(word address) const override;
45 
46  template<typename Archive>
47  void serialize(Archive& ar, unsigned version);
48 
49 private:
50  void changeBank(byte region, byte bank);
51 
52  std::shared_ptr<SRAM> fsSram;
53  byte bankSelect[8];
54  bool isRam[8];
55  bool isEmpty[8];
56  byte control;
57 };
58 
59 } // namespace openmsx
60 
61 #endif
openmsx::RomFSA1FM1::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: RomFSA1FM.cc:99
openmsx::RomFSA1FM2
Definition: RomFSA1FM.hh:34
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
openmsx::RomFSA1FM2::serialize
void serialize(Archive &ar, unsigned version)
Definition: RomFSA1FM.cc:290
openmsx::RomFSA1FM2::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: RomFSA1FM.cc:197
openmsx::RomFSA1FM1
Definition: RomFSA1FM.hh:13
openmsx::RomFSA1FM1::getReadCacheLine
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: RomFSA1FM.cc:104
openmsx::RomFSA1FM2::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: RomFSA1FM.cc:217
openmsx::MSXRom
Definition: MSXRom.hh:10
openmsx::RomFSA1FM2::getReadCacheLine
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: RomFSA1FM.cc:202
openmsx::RomFSA1FM2::getWriteCacheLine
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: RomFSA1FM.cc:256
openmsx::SRAM
SRAM
Definition: SRAM.cc:150
openmsx::RomFSA1FM2::RomFSA1FM2
RomFSA1FM2(const DeviceConfig &config, Rom &&rom)
Definition: RomFSA1FM.cc:160
openmsx::RomFSA1FM1::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: RomFSA1FM.cc:121
FirmwareSwitch.hh
MSXRom.hh
openmsx::RomBlocks
Definition: RomBlocks.hh:14
openmsx::RomFSA1FM2::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: RomFSA1FM.cc:179
openmsx::RomFSA1FM1::RomFSA1FM1
RomFSA1FM1(const DeviceConfig &config, Rom &&rom)
Definition: RomFSA1FM.cc:58
openmsx::MSXRom::rom
Rom rom
Definition: MSXRom.hh:20
openmsx::Rom
Definition: Rom.hh:21
openmsx::RomFSA1FM1::serialize
void serialize(Archive &ar, unsigned version)
Definition: RomFSA1FM.cc:148
openmsx::FirmwareSwitch
Definition: FirmwareSwitch.hh:10
openmsx::RomFSA1FM1::getWriteCacheLine
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: RomFSA1FM.cc:134
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::RomFSA1FM1::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomFSA1FM.cc:70
openmsx::RomFSA1FM2::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: RomFSA1FM.cc:167
openmsx::RomFSA1FM1::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: RomFSA1FM.cc:75
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
RomBlocks.hh