2016-08-01 11:09:15 +00:00
|
|
|
//
|
|
|
|
// D64.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 01/08/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef D64_hpp
|
|
|
|
#define D64_hpp
|
|
|
|
|
|
|
|
#include "../Disk.hpp"
|
|
|
|
|
|
|
|
namespace Storage {
|
2016-08-27 21:15:09 +00:00
|
|
|
namespace Disk {
|
2016-08-01 11:09:15 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
Provies a @c Disk containing a D64 disk image — a decoded sector dump of a C1540-format disk.
|
|
|
|
*/
|
|
|
|
class D64: public Disk {
|
|
|
|
public:
|
|
|
|
/*!
|
|
|
|
Construct a @c D64 containing content from the file with name @c file_name.
|
|
|
|
|
|
|
|
@throws ErrorCantOpen if this file can't be opened.
|
|
|
|
@throws ErrorNotD64 if the file doesn't appear to contain a .D64 format image.
|
|
|
|
*/
|
|
|
|
D64(const char *file_name);
|
|
|
|
~D64();
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ErrorCantOpen,
|
|
|
|
ErrorNotD64,
|
|
|
|
};
|
|
|
|
|
|
|
|
// implemented to satisfy @c Disk
|
|
|
|
unsigned int get_head_position_count();
|
2016-09-18 23:21:02 +00:00
|
|
|
std::shared_ptr<Track> get_track_at_position(unsigned int head, unsigned int position);
|
2016-08-01 11:09:15 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
FILE *_file;
|
2016-08-01 12:41:16 +00:00
|
|
|
unsigned int _number_of_tracks;
|
|
|
|
uint16_t _disk_id;
|
2016-08-01 11:09:15 +00:00
|
|
|
};
|
|
|
|
|
2016-08-27 21:15:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-01 11:09:15 +00:00
|
|
|
#endif /* D64_hpp */
|