2017-08-10 21:10:21 +00:00
|
|
|
//
|
|
|
|
// CPM.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 10/08/2017.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2017 Thomas Harte. All rights reserved.
|
2017-08-10 21:10:21 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Storage_Disk_Parsers_CPM_hpp
|
|
|
|
#define Storage_Disk_Parsers_CPM_hpp
|
|
|
|
|
|
|
|
#include "../Disk.hpp"
|
2017-08-11 02:33:08 +00:00
|
|
|
|
|
|
|
#include <cstdint>
|
2017-08-10 21:10:21 +00:00
|
|
|
#include <memory>
|
2017-08-11 02:33:08 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2017-08-10 21:10:21 +00:00
|
|
|
|
|
|
|
namespace Storage {
|
|
|
|
namespace Disk {
|
|
|
|
namespace CPM {
|
|
|
|
|
|
|
|
struct ParameterBlock {
|
|
|
|
int sectors_per_track;
|
2017-08-11 14:46:50 +00:00
|
|
|
int tracks;
|
2017-08-11 02:33:08 +00:00
|
|
|
int block_size;
|
2017-08-10 21:10:21 +00:00
|
|
|
int first_sector;
|
|
|
|
uint16_t catalogue_allocation_bitmap;
|
|
|
|
int reserved_tracks;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct File {
|
2017-08-11 02:33:08 +00:00
|
|
|
uint8_t user_number;
|
|
|
|
std::string name;
|
|
|
|
std::string type;
|
|
|
|
bool read_only;
|
|
|
|
bool system;
|
|
|
|
std::vector<uint8_t> data;
|
2017-08-10 21:10:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Catalogue {
|
2017-08-11 02:33:08 +00:00
|
|
|
std::vector<File> files;
|
2017-08-10 21:10:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
std::unique_ptr<Catalogue> GetCatalogue(const std::shared_ptr<Storage::Disk::Disk> &disk, const ParameterBlock ¶meters);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Storage_Disk_Parsers_CPM_hpp */
|