2017-07-31 01:15:20 +00:00
|
|
|
//
|
|
|
|
// AmstradCPC.cpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 30/07/2017.
|
|
|
|
// Copyright © 2017 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "StaticAnalyser.hpp"
|
2017-08-10 21:10:21 +00:00
|
|
|
#include "../../Storage/Disk/Parsers/CPM.hpp"
|
2017-07-31 01:15:20 +00:00
|
|
|
|
|
|
|
void StaticAnalyser::AmstradCPC::AddTargets(
|
|
|
|
const std::list<std::shared_ptr<Storage::Disk::Disk>> &disks,
|
|
|
|
const std::list<std::shared_ptr<Storage::Tape::Tape>> &tapes,
|
|
|
|
const std::list<std::shared_ptr<Storage::Cartridge::Cartridge>> &cartridges,
|
|
|
|
std::list<StaticAnalyser::Target> &destination) {
|
|
|
|
Target target;
|
|
|
|
target.machine = Target::AmstradCPC;
|
|
|
|
target.probability = 1.0;
|
|
|
|
target.disks = disks;
|
|
|
|
target.tapes = tapes;
|
|
|
|
target.cartridges = cartridges;
|
2017-08-05 23:20:38 +00:00
|
|
|
|
2017-08-08 20:01:56 +00:00
|
|
|
target.amstradcpc.model = target.disks.empty() ? AmstradCPCModel::CPC464 : AmstradCPCModel::CPC6128;
|
2017-08-05 23:20:38 +00:00
|
|
|
|
2017-08-10 21:10:21 +00:00
|
|
|
if(!target.disks.empty()) {
|
|
|
|
// This is CPC data format.
|
|
|
|
Storage::Disk::CPM::ParameterBlock parameters;
|
|
|
|
parameters.sectors_per_track = 9;
|
2017-08-11 02:33:08 +00:00
|
|
|
parameters.block_size = 1024;
|
2017-08-10 21:10:21 +00:00
|
|
|
parameters.first_sector = 0xc1;
|
|
|
|
parameters.catalogue_allocation_bitmap = 0xc000;
|
2017-08-11 02:33:08 +00:00
|
|
|
parameters.logic_extents_per_physical = 1;
|
2017-08-10 21:10:21 +00:00
|
|
|
parameters.reserved_tracks = 0;
|
|
|
|
|
|
|
|
Storage::Disk::CPM::GetCatalogue(target.disks.front(), parameters);
|
|
|
|
}
|
|
|
|
|
2017-07-31 01:15:20 +00:00
|
|
|
destination.push_back(target);
|
|
|
|
}
|