openMSX
TurboRFDC.hh
Go to the documentation of this file.
1 #ifndef TURBORFDC_HH
2 #define TURBORFDC_HH
3 
4 #include "MSXFDC.hh"
5 #include "RomBlockDebuggable.hh"
6 #include "TC8566AF.hh"
7 
8 namespace openmsx {
9 
10 class TurboRFDC final : public MSXFDC
11 {
12 public:
13  enum Type { BOTH, R7FF2, R7FF8 };
14 
15  explicit TurboRFDC(const DeviceConfig& config);
16 
17  void reset(EmuTime::param time) override;
18  [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
19  [[nodiscard]] byte peekMem(word address, EmuTime::param time) const override;
20  void writeMem(word address, byte value, EmuTime::param time) override;
21  [[nodiscard]] const byte* getReadCacheLine(word start) const override;
22  [[nodiscard]] byte* getWriteCacheLine(word address) const override;
23 
24  template<typename Archive>
25  void serialize(Archive& ar, unsigned version);
26 
27 private:
28  void setBank(byte value);
29 
30 private:
31  TC8566AF controller;
32  RomBlockDebuggable romBlockDebug;
33  const byte* memory;
34  const byte blockMask;
35  byte bank;
36  const Type type;
37 };
38 
39 } // namespace openmsx
40 
41 #endif
TC8566AF.hh
openmsx::TC8566AF
Definition: TC8566AF.hh:17
openmsx::TurboRFDC
Definition: TurboRFDC.hh:11
openmsx::TurboRFDC::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: TurboRFDC.cc:154
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
openmsx::TurboRFDC::Type
Type
Definition: TurboRFDC.hh:13
openmsx::TurboRFDC::serialize
void serialize(Archive &ar, unsigned version)
Definition: TurboRFDC.cc:206
openmsx::TurboRFDC::TurboRFDC
TurboRFDC(const DeviceConfig &config)
Definition: TurboRFDC.cc:40
openmsx::TurboRFDC::getWriteCacheLine
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: TurboRFDC.cc:194
openmsx::TurboRFDC::R7FF8
@ R7FF8
Definition: TurboRFDC.hh:13
openmsx::MSXFDC
Definition: MSXFDC.hh:14
openmsx::TurboRFDC::BOTH
@ BOTH
Definition: TurboRFDC.hh:13
openmsx::RomBlockDebuggable
Definition: RomBlockDebuggable.hh:26
MSXFDC.hh
RomBlockDebuggable.hh
openmsx::TurboRFDC::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: TurboRFDC.cc:51
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::TurboRFDC::R7FF2
@ R7FF2
Definition: TurboRFDC.hh:13
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::TurboRFDC::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: TurboRFDC.cc:91
openmsx::TurboRFDC::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: TurboRFDC.cc:57
openmsx::TurboRFDC::getReadCacheLine
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: TurboRFDC.cc:143