2019-06-02 17:39:25 +00:00
|
|
|
//
|
|
|
|
// StaticAnalyser.cpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 02/06/2019.
|
|
|
|
// Copyright © 2019 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "StaticAnalyser.hpp"
|
2019-06-03 18:50:36 +00:00
|
|
|
#include "Target.hpp"
|
2019-06-02 17:39:25 +00:00
|
|
|
|
2024-11-30 02:08:35 +00:00
|
|
|
Analyser::Static::TargetList Analyser::Static::Macintosh::GetTargets(
|
|
|
|
const Media &media,
|
|
|
|
const std::string &,
|
|
|
|
TargetPlatform::IntType
|
|
|
|
) {
|
2019-08-25 19:10:09 +00:00
|
|
|
// This analyser can comprehend disks and mass-storage devices only.
|
|
|
|
if(media.disks.empty() && media.mass_storage_devices.empty()) return {};
|
2019-06-02 17:39:25 +00:00
|
|
|
|
2019-08-25 19:10:09 +00:00
|
|
|
// As there is at least one usable media image, wave it through.
|
2019-06-02 17:39:25 +00:00
|
|
|
Analyser::Static::TargetList targets;
|
|
|
|
|
2019-06-03 18:50:36 +00:00
|
|
|
using Target = Analyser::Static::Macintosh::Target;
|
2020-05-10 03:49:37 +00:00
|
|
|
auto *const target = new Target;
|
2019-06-02 17:39:25 +00:00
|
|
|
target->media = media;
|
2021-02-27 02:22:35 +00:00
|
|
|
|
|
|
|
// If this is a single-sided floppy disk, guess the Macintosh 512kb.
|
|
|
|
if(media.mass_storage_devices.empty()) {
|
|
|
|
bool has_800kb_disks = false;
|
|
|
|
for(const auto &disk: media.disks) {
|
|
|
|
has_800kb_disks |= disk->get_head_count() > 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!has_800kb_disks) {
|
|
|
|
target->model = Target::Model::Mac512k;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-02 17:39:25 +00:00
|
|
|
targets.push_back(std::unique_ptr<Analyser::Static::Target>(target));
|
|
|
|
|
|
|
|
return targets;
|
|
|
|
}
|