2019-08-25 19:09:27 +00:00
|
|
|
//
|
|
|
|
// HFV.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 25/08/2019.
|
|
|
|
// Copyright © 2019 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef HFV_hpp
|
|
|
|
#define HFV_hpp
|
|
|
|
|
|
|
|
#include "../MassStorageDevice.hpp"
|
|
|
|
#include "../../FileHolder.hpp"
|
2019-08-26 03:03:54 +00:00
|
|
|
#include "../Encodings/MacintoshVolume.hpp"
|
2019-08-25 19:09:27 +00:00
|
|
|
|
2019-09-16 02:06:45 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
|
|
|
|
2019-08-25 19:09:27 +00:00
|
|
|
namespace Storage {
|
|
|
|
namespace MassStorage {
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Provides a @c MassStorageDevice containing an HFV image, which is a sector dump of
|
2019-08-26 03:03:54 +00:00
|
|
|
the HFS volume of a Macintosh drive that is not the correct size to be a floppy disk.
|
2019-08-25 19:09:27 +00:00
|
|
|
*/
|
2019-08-26 03:03:54 +00:00
|
|
|
class HFV: public MassStorageDevice, public Encodings::Macintosh::Volume {
|
2019-08-25 19:09:27 +00:00
|
|
|
public:
|
2019-08-26 03:03:54 +00:00
|
|
|
/*!
|
|
|
|
Constructs an HFV with the contents of the file named @c file_name.
|
|
|
|
Raises an exception if the file name doesn't appear to identify a valid
|
|
|
|
Macintosh mass storage image.
|
|
|
|
*/
|
2019-08-25 19:09:27 +00:00
|
|
|
HFV(const std::string &file_name);
|
|
|
|
|
|
|
|
private:
|
|
|
|
FileHolder file_;
|
2019-08-26 03:03:54 +00:00
|
|
|
Encodings::Macintosh::Mapper mapper_;
|
2019-08-25 19:09:27 +00:00
|
|
|
|
2019-08-26 03:03:54 +00:00
|
|
|
/* MassStorageDevices overrides. */
|
2019-08-25 19:09:27 +00:00
|
|
|
size_t get_block_size() final;
|
|
|
|
size_t get_number_of_blocks() final;
|
|
|
|
std::vector<uint8_t> get_block(size_t address) final;
|
2019-08-25 19:16:35 +00:00
|
|
|
void set_block(size_t address, const std::vector<uint8_t> &) final;
|
2019-08-25 19:09:27 +00:00
|
|
|
|
2019-08-26 03:03:54 +00:00
|
|
|
/* Encodings::Macintosh::Volume overrides. */
|
|
|
|
void set_drive_type(Encodings::Macintosh::DriveType) final;
|
2019-09-16 02:06:45 +00:00
|
|
|
|
|
|
|
std::map<size_t, std::vector<uint8_t>> writes_;
|
2019-08-25 19:09:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* HFV_hpp */
|