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
|
|
|
|
|
2017-09-23 00:28:11 +00:00
|
|
|
#include "../DiskImage.hpp"
|
2017-09-23 02:39:23 +00:00
|
|
|
#include "../../../FileHolder.hpp"
|
2016-08-01 11:09:15 +00:00
|
|
|
|
|
|
|
namespace Storage {
|
2016-08-27 21:15:09 +00:00
|
|
|
namespace Disk {
|
2016-08-01 11:09:15 +00:00
|
|
|
|
|
|
|
/*!
|
2018-01-09 01:55:40 +00:00
|
|
|
Provides a @c Disk containing a D64 disk image — a decoded sector dump of a C1540-format disk.
|
2016-08-01 11:09:15 +00:00
|
|
|
*/
|
2017-11-03 02:32:00 +00:00
|
|
|
class D64: public DiskImage {
|
2016-08-01 11:09:15 +00:00
|
|
|
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);
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ErrorNotD64,
|
|
|
|
};
|
|
|
|
|
|
|
|
// implemented to satisfy @c Disk
|
2017-10-07 23:37:36 +00:00
|
|
|
int get_head_position_count() override;
|
2017-10-03 23:36:06 +00:00
|
|
|
using DiskImage::get_is_read_only;
|
2017-10-07 23:37:36 +00:00
|
|
|
std::shared_ptr<Track> get_track_at_position(Track::Address address) override;
|
2016-08-01 11:09:15 +00:00
|
|
|
|
|
|
|
private:
|
2017-11-03 02:32:00 +00:00
|
|
|
Storage::FileHolder file_;
|
2017-10-07 01:45:12 +00:00
|
|
|
int number_of_tracks_;
|
2016-11-21 12:14:09 +00:00
|
|
|
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 */
|