openMSX
MSXFDC.hh
Go to the documentation of this file.
1 #ifndef MSXFDC_HH
2 #define MSXFDC_HH
3 
4 #include "MSXDevice.hh"
5 #include <memory>
6 #include <string>
7 
8 namespace openmsx {
9 
10 class DiskDrive;
11 class Rom;
12 
13 class MSXFDC : public MSXDevice
14 {
15 public:
16  void powerDown(EmuTime::param time) override;
17  byte readMem(word address, EmuTime::param time) override;
18  byte peekMem(word address, EmuTime::param time) const override;
19  const byte* getReadCacheLine(word start) const override;
20 
21  template<typename Archive>
22  void serialize(Archive& ar, unsigned version);
23 
24 protected:
25  explicit MSXFDC(const DeviceConfig& config, const std::string& romId = {},
26  bool needROM = true);
27  ~MSXFDC() override;
28 
29  std::unique_ptr<Rom> rom;
30  std::unique_ptr<DiskDrive> drives[4];
31 };
32 
34 
35 } // namespace openmsx
36 
37 #endif
std::unique_ptr< Rom > rom
Definition: MSXFDC.hh:29
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: MSXFDC.cc:50
REGISTER_BASE_NAME_HELPER(MSXFDC, "FDC")
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
std::unique_ptr< DiskDrive > drives[4]
Definition: MSXFDC.hh:30
void serialize(Archive &ar, unsigned version)
Definition: MSXFDC.cc:67
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading...
Definition: MSXFDC.cc:60
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX...
Definition: MSXDevice.hh:31
void powerDown(EmuTime::param time) override
This method is called when MSX is powered down.
Definition: MSXFDC.cc:43
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: MSXFDC.cc:55
~MSXFDC() override
MSXFDC(const DeviceConfig &config, const std::string &romId={}, bool needROM=true)
Definition: MSXFDC.cc:11