2017-08-18 01:48:48 +00:00
|
|
|
//
|
|
|
|
// HFE.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 17/08/2017.
|
|
|
|
// Copyright © 2017 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef HFE_hpp
|
|
|
|
#define HFE_hpp
|
|
|
|
|
2017-09-23 00:28:11 +00:00
|
|
|
#include "../DiskImage.hpp"
|
2017-09-23 02:39:23 +00:00
|
|
|
#include "../../../FileHolder.hpp"
|
2017-08-18 01:48:48 +00:00
|
|
|
|
2018-04-06 21:42:24 +00:00
|
|
|
#include <string>
|
|
|
|
|
2017-08-18 01:48:48 +00:00
|
|
|
namespace Storage {
|
|
|
|
namespace Disk {
|
|
|
|
|
|
|
|
/*!
|
2018-01-09 01:55:40 +00:00
|
|
|
Provides a @c Disk containing an HFE disk image — a bit stream representation of a floppy.
|
2017-08-18 01:48:48 +00:00
|
|
|
*/
|
2017-11-03 02:32:00 +00:00
|
|
|
class HFE: public DiskImage {
|
2017-08-18 01:48:48 +00:00
|
|
|
public:
|
|
|
|
/*!
|
|
|
|
Construct an @c SSD containing content from the file with name @c file_name.
|
|
|
|
|
|
|
|
@throws ErrorCantOpen if this file can't be opened.
|
|
|
|
@throws ErrorNotSSD if the file doesn't appear to contain a .SSD format image.
|
|
|
|
*/
|
2018-04-06 21:42:24 +00:00
|
|
|
HFE(const std::string &file_name);
|
2017-08-18 01:48:48 +00:00
|
|
|
~HFE();
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ErrorNotHFE,
|
|
|
|
};
|
|
|
|
|
|
|
|
// implemented to satisfy @c Disk
|
2017-10-07 23:37:36 +00:00
|
|
|
int get_head_position_count() override;
|
|
|
|
int get_head_count() override;
|
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-08-18 01:48:48 +00:00
|
|
|
|
|
|
|
private:
|
2017-11-03 02:32:00 +00:00
|
|
|
Storage::FileHolder file_;
|
2017-10-07 01:45:12 +00:00
|
|
|
uint16_t seek_track(Track::Address address);
|
2017-08-18 01:48:48 +00:00
|
|
|
|
2017-10-07 01:45:12 +00:00
|
|
|
int head_count_;
|
|
|
|
int track_count_;
|
2017-08-18 02:20:02 +00:00
|
|
|
long track_list_offset_;
|
2017-08-18 01:48:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* HFE_hpp */
|