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 <memory>
8#include <optional>
9#include <string>
10
11namespace openmsx {
12
13class MSXFDC : public MSXDevice
14{
15public:
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
24protected:
25 explicit MSXFDC(const DeviceConfig& config, const std::string& romId = {},
26 bool needROM = true,
28
29protected:
30 std::optional<Rom> rom;
31 std::unique_ptr<DiskDrive> drives[4];
32};
33
35
36} // namespace openmsx
37
38#endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:33
std::unique_ptr< DiskDrive > drives[4]
Definition: MSXFDC.hh:31
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: MSXFDC.cc:54
void powerDown(EmuTime::param time) override
This method is called when MSX is powered down.
Definition: MSXFDC.cc:42
std::optional< Rom > rom
Definition: MSXFDC.hh:30
MSXFDC(const DeviceConfig &config, const std::string &romId={}, bool needROM=true, DiskDrive::TrackMode trackMode=DiskDrive::TrackMode::NORMAL)
Definition: MSXFDC.cc:11
void serialize(Archive &ar, unsigned version)
Definition: MSXFDC.cc:66
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:59
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: MSXFDC.cc:49
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")