2016-09-06 10:39:40 +00:00
|
|
|
//
|
|
|
|
// CommodoreAnalyser.cpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 06/09/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "CommodoreAnalyser.hpp"
|
|
|
|
|
|
|
|
#include "Tape.hpp"
|
|
|
|
|
|
|
|
using namespace StaticAnalyser::Commodore;
|
|
|
|
|
|
|
|
void StaticAnalyser::Commodore::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::Vic20; // TODO: machine estimation
|
|
|
|
target.probability = 1.0; // TODO: a proper estimation
|
|
|
|
|
|
|
|
// strip out inappropriate cartridges
|
|
|
|
// target.cartridges = AcornCartridgesFrom(cartridges);
|
|
|
|
|
|
|
|
// if there are any tapes, attempt to get data from the first
|
|
|
|
if(tapes.size() > 0)
|
|
|
|
{
|
|
|
|
std::shared_ptr<Storage::Tape::Tape> tape = tapes.front();
|
|
|
|
tape->reset();
|
|
|
|
std::list<File> files = GetFiles(tape);
|
|
|
|
tape->reset();
|
2016-09-07 11:39:47 +00:00
|
|
|
|
|
|
|
// continue if there are any files
|
|
|
|
if(files.size())
|
|
|
|
{
|
|
|
|
// TODO: decide between ,1 (don't relocate; for machine code) and ,0 (relocate; for BASIC)
|
|
|
|
// TODO: decide memory model (based on extents and sizes)
|
|
|
|
// TODO: decide machine (disassemble?)
|
|
|
|
}
|
2016-09-06 10:39:40 +00:00
|
|
|
}
|
2016-09-07 11:39:47 +00:00
|
|
|
|
|
|
|
if(target.tapes.size() || target.cartridges.size() || target.disks.size())
|
|
|
|
destination.push_back(target);
|
2016-09-06 10:39:40 +00:00
|
|
|
}
|