2016-07-10 14:17:53 +00:00
|
|
|
//
|
|
|
|
// G64.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 10/07/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef G64_hpp
|
|
|
|
#define G64_hpp
|
|
|
|
|
|
|
|
#include "../Disk.hpp"
|
2016-11-21 12:14:09 +00:00
|
|
|
#include "../../FileHolder.hpp"
|
2016-07-10 14:17:53 +00:00
|
|
|
|
|
|
|
namespace Storage {
|
2016-08-27 21:15:09 +00:00
|
|
|
namespace Disk {
|
2016-07-10 14:17:53 +00:00
|
|
|
|
2016-08-01 10:04:55 +00:00
|
|
|
/*!
|
|
|
|
Provies a @c Disk containing a G64 disk image — a raw but perfectly-clocked GCR stream.
|
|
|
|
*/
|
2016-11-21 12:14:09 +00:00
|
|
|
class G64: public Disk, public Storage::FileHolder {
|
2016-07-10 14:17:53 +00:00
|
|
|
public:
|
2016-08-01 10:04:55 +00:00
|
|
|
/*!
|
|
|
|
Construct a @c G64 containing content from the file with name @c file_name.
|
|
|
|
|
|
|
|
@throws ErrorCantOpen if this file can't be opened.
|
|
|
|
@throws ErrorNotG64 if the file doesn't appear to contain a .G64 format image.
|
|
|
|
@throws ErrorUnknownVersion if this file appears to be a .G64 but has an unrecognised version number.
|
|
|
|
*/
|
2016-07-10 14:17:53 +00:00
|
|
|
G64(const char *file_name);
|
|
|
|
|
|
|
|
enum {
|
2016-08-01 10:04:55 +00:00
|
|
|
ErrorCantOpen,
|
|
|
|
ErrorNotG64,
|
2016-07-10 14:17:53 +00:00
|
|
|
ErrorUnknownVersion
|
|
|
|
};
|
|
|
|
|
2016-08-01 10:04:55 +00:00
|
|
|
// implemented to satisfy @c Disk
|
2016-07-10 14:17:53 +00:00
|
|
|
unsigned int get_head_position_count();
|
|
|
|
|
|
|
|
private:
|
2016-11-26 06:27:06 +00:00
|
|
|
std::shared_ptr<Track> virtual_get_track_at_position(unsigned int head, unsigned int position);
|
2016-11-21 12:14:09 +00:00
|
|
|
uint8_t number_of_tracks_;
|
|
|
|
uint16_t maximum_track_size_;
|
2016-07-10 14:17:53 +00:00
|
|
|
};
|
|
|
|
|
2016-08-27 21:15:09 +00:00
|
|
|
}
|
|
|
|
}
|
2016-07-10 14:17:53 +00:00
|
|
|
|
|
|
|
#endif /* G64_hpp */
|