2020-01-08 04:21:32 +00:00
|
|
|
//
|
|
|
|
// STX.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 13/11/2019.
|
|
|
|
// Copyright © 2019 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2024-01-17 04:34:46 +00:00
|
|
|
#pragma once
|
2020-01-08 04:21:32 +00:00
|
|
|
|
|
|
|
#include "../DiskImage.hpp"
|
|
|
|
#include "../../../FileHolder.hpp"
|
|
|
|
|
2023-05-10 21:02:18 +00:00
|
|
|
namespace Storage::Disk {
|
2020-01-08 04:21:32 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
Provides a @c Disk containing an STX disk image: sector contents plus a bunch of annotations as to sizing,
|
|
|
|
placement, bit density, fuzzy bits, etc.
|
|
|
|
*/
|
|
|
|
class STX: public DiskImage {
|
|
|
|
public:
|
|
|
|
/*!
|
|
|
|
Construct an @c STX containing content from the file with name @c file_name.
|
|
|
|
|
|
|
|
@throws Storage::FileHolder::Error::CantOpen if this file can't be opened.
|
|
|
|
@throws Error::InvalidFormat if the file doesn't appear to contain a .STX format image.
|
|
|
|
*/
|
|
|
|
STX(const std::string &file_name);
|
|
|
|
|
|
|
|
HeadPosition get_maximum_head_position() final;
|
|
|
|
int get_head_count() final;
|
|
|
|
|
|
|
|
std::shared_ptr<::Storage::Disk::Track> get_track_at_position(::Storage::Disk::Track::Address address) final;
|
|
|
|
|
|
|
|
private:
|
|
|
|
FileHolder file_;
|
|
|
|
|
|
|
|
int track_count_;
|
2020-01-13 03:23:34 +00:00
|
|
|
int head_count_;
|
|
|
|
|
2020-01-08 04:21:32 +00:00
|
|
|
bool is_new_format_;
|
|
|
|
long offset_by_track_[256];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|