2017-08-05 14:02:10 +00:00
|
|
|
//
|
|
|
|
// CPCDSK.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 05/08/2017.
|
|
|
|
// Copyright © 2017 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef CPCDSK_hpp
|
|
|
|
#define CPCDSK_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-05 14:02:10 +00:00
|
|
|
|
2017-08-05 15:44:53 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2017-08-05 14:02:10 +00:00
|
|
|
namespace Storage {
|
|
|
|
namespace Disk {
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Provies a @c Disk containing an Amstrad CPC-stype disk image — some arrangement of sectors with status bits.
|
|
|
|
*/
|
2017-09-23 00:28:11 +00:00
|
|
|
class CPCDSK: public DiskImage, public Storage::FileHolder {
|
2017-08-05 14:02:10 +00:00
|
|
|
public:
|
|
|
|
/*!
|
|
|
|
Construct an @c AcornADF containing content from the file with name @c file_name.
|
|
|
|
|
|
|
|
@throws ErrorCantOpen if this file can't be opened.
|
|
|
|
@throws ErrorNotAcornADF if the file doesn't appear to contain an Acorn .ADF format image.
|
|
|
|
*/
|
|
|
|
CPCDSK(const char *file_name);
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ErrorNotCPCDSK,
|
|
|
|
};
|
|
|
|
|
|
|
|
// implemented to satisfy @c Disk
|
2017-10-07 01:45:12 +00:00
|
|
|
int get_head_position_count();
|
|
|
|
int get_head_count();
|
2017-10-03 23:36:06 +00:00
|
|
|
using DiskImage::get_is_read_only;
|
2017-10-07 01:45:12 +00:00
|
|
|
std::shared_ptr<Track> get_track_at_position(Track::Address address);
|
2017-08-05 14:02:10 +00:00
|
|
|
|
|
|
|
private:
|
2017-10-07 01:45:12 +00:00
|
|
|
int head_count_;
|
|
|
|
int head_position_count_;
|
2017-08-05 14:02:10 +00:00
|
|
|
bool is_extended_;
|
2017-08-05 15:44:53 +00:00
|
|
|
|
|
|
|
// Used only for non-extended disks.
|
|
|
|
long size_of_a_track_;
|
|
|
|
|
|
|
|
// Used only for extended disks.
|
|
|
|
std::vector<size_t> track_sizes_;
|
2017-08-05 14:02:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* CPCDSK_hpp */
|