1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-05 21:05:51 +00:00
CLK/Storage/Disk/DiskImage/Formats/MFMSectorDump.hpp
Thomas Harte e384c50580 Switches FileHolder to have a usage much closer to FILE *.
Thereby opens a route for file format implementations such as that appearing for CPC DSK that create an in-memory copy and perform a full rewrite.
2017-11-02 22:32:00 -04:00

45 lines
1.0 KiB
C++

//
// MFMSectorDump.hpp
// Clock Signal
//
// Created by Thomas Harte on 30/09/2017.
// Copyright © 2017 Thomas Harte. All rights reserved.
//
#ifndef SectorDump_hpp
#define SectorDump_hpp
#include "../DiskImage.hpp"
#include "../../../FileHolder.hpp"
namespace Storage {
namespace Disk {
/*!
Provies the base for writeable [M]FM disk images that just contain contiguous sector content dumps.
*/
class MFMSectorDump: public DiskImage {
public:
MFMSectorDump(const char *file_name);
void set_geometry(int sectors_per_track, uint8_t sector_size, bool is_double_density);
bool get_is_read_only() override;
void set_tracks(const std::map<Track::Address, std::shared_ptr<Track>> &tracks) override;
std::shared_ptr<Track> get_track_at_position(Track::Address address) override;
protected:
Storage::FileHolder file_;
private:
virtual long get_file_offset_for_position(Track::Address address) = 0;
int sectors_per_track_ = 0;
uint8_t sector_size_ = 0;
bool is_double_density_ = true;
};
}
}
#endif /* SectorDump_hpp */