2017-10-01 00:30:15 +00:00
|
|
|
//
|
|
|
|
// MFMSectorDump.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 30/09/2017.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2017 Thomas Harte. All rights reserved.
|
2017-10-01 00:30:15 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef SectorDump_hpp
|
|
|
|
#define SectorDump_hpp
|
|
|
|
|
|
|
|
#include "../DiskImage.hpp"
|
|
|
|
#include "../../../FileHolder.hpp"
|
|
|
|
|
2018-04-06 21:42:24 +00:00
|
|
|
#include <string>
|
|
|
|
|
2017-10-01 00:30:15 +00:00
|
|
|
namespace Storage {
|
|
|
|
namespace Disk {
|
|
|
|
|
|
|
|
/*!
|
2018-01-09 01:55:40 +00:00
|
|
|
Provides the base for writeable [M]FM disk images that just contain contiguous sector content dumps.
|
2017-10-01 00:30:15 +00:00
|
|
|
*/
|
2017-11-03 02:32:00 +00:00
|
|
|
class MFMSectorDump: public DiskImage {
|
2017-10-01 00:30:15 +00:00
|
|
|
public:
|
2018-04-06 21:42:24 +00:00
|
|
|
MFMSectorDump(const std::string &file_name);
|
2018-01-08 02:59:18 +00:00
|
|
|
void set_geometry(int sectors_per_track, uint8_t sector_size, uint8_t first_sector, bool is_double_density);
|
2017-10-01 00:30:15 +00:00
|
|
|
|
2017-11-03 02:32:00 +00:00
|
|
|
bool get_is_read_only() override;
|
2017-10-07 23:37:36 +00:00
|
|
|
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;
|
2017-10-01 00:30:15 +00:00
|
|
|
|
2017-11-03 02:32:00 +00:00
|
|
|
protected:
|
|
|
|
Storage::FileHolder file_;
|
|
|
|
|
2017-10-01 00:30:15 +00:00
|
|
|
private:
|
2017-10-07 01:45:12 +00:00
|
|
|
virtual long get_file_offset_for_position(Track::Address address) = 0;
|
2017-10-01 00:30:15 +00:00
|
|
|
|
|
|
|
int sectors_per_track_ = 0;
|
|
|
|
uint8_t sector_size_ = 0;
|
|
|
|
bool is_double_density_ = true;
|
2018-01-08 02:59:18 +00:00
|
|
|
uint8_t first_sector_ = 0;
|
2017-10-01 00:30:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* SectorDump_hpp */
|