2017-08-18 01:48:48 +00:00
|
|
|
//
|
|
|
|
// HFE.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 17/08/2017.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2017 Thomas Harte. All rights reserved.
|
2017-08-18 01:48:48 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#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-05-13 19:34:31 +00:00
|
|
|
Provides a @c DiskImage containing an HFE: 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:
|
|
|
|
/*!
|
2018-04-24 02:59:19 +00:00
|
|
|
Construct an @c HFE containing content from the file with name @c file_name.
|
2017-08-18 01:48:48 +00:00
|
|
|
|
2018-04-28 03:18:45 +00:00
|
|
|
@throws Storage::FileHolder::Error::CantOpen if this file can't be opened.
|
|
|
|
@throws Error::InvalidFormat if the file doesn't appear to contain an .HFE format image.
|
|
|
|
@throws Error::UnknownVersion if the file looks correct but is an unsupported version.
|
2017-08-18 01:48:48 +00:00
|
|
|
*/
|
2018-04-06 21:42:24 +00:00
|
|
|
HFE(const std::string &file_name);
|
2017-08-18 01:48:48 +00:00
|
|
|
~HFE();
|
|
|
|
|
|
|
|
// implemented to satisfy @c Disk
|
2018-05-07 03:17:36 +00:00
|
|
|
HeadPosition get_maximum_head_position() override;
|
2017-10-07 23:37:36 +00:00
|
|
|
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 */
|