openMSX
DMKDiskImage.hh
Go to the documentation of this file.
1#ifndef DMKDISKIMAGE_HH
2#define DMKDISKIMAGE_HH
3
4#include "Disk.hh"
5#include <memory>
6
7namespace openmsx {
8
9class File;
10
16class DMKDiskImage final : public Disk
17{
18public:
19 DMKDiskImage(Filename filename, std::shared_ptr<File> file);
20
21 void readTrack(uint8_t track, uint8_t side, RawTrack& output) override;
22 void writeTrackImpl(uint8_t track, uint8_t side, const RawTrack& input) override;
23
24 // logical sector emulation for SectorAccessibleDisk
25 void readSectorImpl (size_t sector, SectorBuffer& buf) override;
26 void writeSectorImpl(size_t sector, const SectorBuffer& buf) override;
27 [[nodiscard]] size_t getNbSectorsImpl() const override;
28 [[nodiscard]] bool isWriteProtectedImpl() const override;
29 [[nodiscard]] Sha1Sum getSha1SumImpl(FilePool& filePool) override;
30
31private:
32 void detectGeometryFallback() override;
33
34 void seekTrack(uint8_t track, uint8_t side);
35 void doWriteTrack(uint8_t track, uint8_t side, const RawTrack& input);
36 void extendImageToTrack(uint8_t track);
37
38private:
39 std::shared_ptr<File> file;
40 unsigned dmkTrackLen;
41 uint8_t numTracks;
42 bool singleSided;
43 bool writeProtected;
44};
45
46} // namespace openmsx
47
48#endif
DMK disk image.
Sha1Sum getSha1SumImpl(FilePool &filePool) override
void readSectorImpl(size_t sector, SectorBuffer &buf) override
bool isWriteProtectedImpl() const override
void writeSectorImpl(size_t sector, const SectorBuffer &buf) override
size_t getNbSectorsImpl() const override
void readTrack(uint8_t track, uint8_t side, RawTrack &output) override
Read a full track from this disk image.
void writeTrackImpl(uint8_t track, uint8_t side, const RawTrack &input) override
This class represents a filename.
Definition Filename.hh:20
This class represents the result of a sha1 calculation (a 160-bit value).
Definition sha1.hh:24
This file implemented 3 utility functions:
Definition Autofire.cc:11