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 "Rom.hh"
7#include <array>
8#include <memory>
9#include <optional>
10#include <string>
11
12namespace openmsx {
13
14class MSXFDC : public MSXDevice
15{
16public:
17 void powerDown(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 [[nodiscard]] const byte* getReadCacheLine(word start) const override;
21
22 void getExtraDeviceInfo(TclObject& result) const override;
23
24 template<typename Archive>
25 void serialize(Archive& ar, unsigned version);
26
27protected:
28 explicit MSXFDC(const DeviceConfig& config, const std::string& romId = {},
29 bool needROM = true,
31
32protected:
33 std::optional<Rom> rom;
34 std::array<std::unique_ptr<DiskDrive>, 4> drives;
35};
36
38
39} // namespace openmsx
40
41#endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:34
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: MSXFDC.cc:55
void powerDown(EmuTime::param time) override
This method is called when MSX is powered down.
Definition: MSXFDC.cc:43
std::optional< Rom > rom
Definition: MSXFDC.hh:33
std::array< std::unique_ptr< DiskDrive >, 4 > drives
Definition: MSXFDC.hh:34
MSXFDC(const DeviceConfig &config, const std::string &romId={}, bool needROM=true, DiskDrive::TrackMode trackMode=DiskDrive::TrackMode::NORMAL)
Definition: MSXFDC.cc:12
void getExtraDeviceInfo(TclObject &result) const override
Definition: MSXFDC.cc:65
void serialize(Archive &ar, unsigned version)
Definition: MSXFDC.cc:74
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
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
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
REGISTER_BASE_NAME_HELPER(MSXFDC, "FDC")