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  byte readMem(word address, EmuTime::param time) override;
19  byte peekMem(word address, EmuTime::param time) const override;
20  void writeMem(word address, byte value, EmuTime::param time) override;
21  const byte* getReadCacheLine(word start) const override;
22  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  TC8566AF controller;
31  RomBlockDebuggable romBlockDebug;
32  const byte* memory;
33  const byte blockMask;
34  byte bank;
35  const Type type;
36 };
37 
38 } // namespace openmsx
39 
40 #endif
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
void reset(EmuTime::param time) override
This method is called on reset.
Definition: TurboRFDC.cc:51
TurboRFDC(const DeviceConfig &config)
Definition: TurboRFDC.cc:40
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
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
void serialize(Archive &ar, unsigned version)
Definition: TurboRFDC.cc:206
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
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
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
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
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: TurboRFDC.cc:91