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 "DiskDrive.hh"
6 #include <memory>
7 #include <string>
8 
9 namespace openmsx {
10 
11 class Rom;
12 
13 class MSXFDC : public MSXDevice
14 {
15 public:
16  void powerDown(EmuTime::param time) override;
17  [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
18  [[nodiscard]] byte peekMem(word address, EmuTime::param time) const override;
19  [[nodiscard]] 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,
28  ~MSXFDC() override;
29 
30 protected:
31  std::unique_ptr<Rom> rom;
32  std::unique_ptr<DiskDrive> drives[4];
33 };
34 
36 
37 } // namespace openmsx
38 
39 #endif
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
openmsx::MSXFDC::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: MSXFDC.cc:51
openmsx::MSXFDC::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: MSXFDC.cc:56
DiskDrive.hh
openmsx::REGISTER_BASE_NAME_HELPER
REGISTER_BASE_NAME_HELPER(MSXFDC, "FDC")
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
openmsx::MSXFDC::MSXFDC
MSXFDC(const DeviceConfig &config, const std::string &romId={}, bool needROM=true, DiskDrive::TrackMode trackMode=DiskDrive::TrackMode::NORMAL)
Definition: MSXFDC.cc:11
openmsx::MSXFDC
Definition: MSXFDC.hh:14
openmsx::MSXFDC::~MSXFDC
~MSXFDC() override
MSXDevice.hh
openmsx::MSXFDC::rom
std::unique_ptr< Rom > rom
Definition: MSXFDC.hh:31
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::MSXFDC::serialize
void serialize(Archive &ar, unsigned version)
Definition: MSXFDC.cc:68
openmsx::MSXFDC::powerDown
void powerDown(EmuTime::param time) override
This method is called when MSX is powered down.
Definition: MSXFDC.cc:44
openmsx::MSXFDC::getReadCacheLine
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:61
openmsx::MSXFDC::drives
std::unique_ptr< DiskDrive > drives[4]
Definition: MSXFDC.hh:32
openmsx::DiskDrive::TrackMode::NORMAL
@ NORMAL
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::DiskDrive::TrackMode
TrackMode
Definition: DiskDrive.hh:15