2018-09-21 02:04:28 +00:00
|
|
|
//
|
|
|
|
// StaticAnalyser.cpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 20/09/2018.
|
|
|
|
// Copyright © 2018 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "StaticAnalyser.hpp"
|
|
|
|
|
2018-09-23 20:34:47 +00:00
|
|
|
#include "Target.hpp"
|
|
|
|
|
2018-09-21 02:04:28 +00:00
|
|
|
Analyser::Static::TargetList Analyser::Static::Sega::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) {
|
|
|
|
TargetList targets;
|
|
|
|
std::unique_ptr<Target> target(new Target);
|
2018-09-23 20:34:47 +00:00
|
|
|
|
2018-09-21 02:04:28 +00:00
|
|
|
target->machine = Machine::MasterSystem;
|
2018-09-23 20:34:47 +00:00
|
|
|
|
|
|
|
// Files named .sg are treated as for the SG1000; otherwise assume a Master System.
|
|
|
|
if(file_name.size() >= 2 && *(file_name.end() - 2) == 's' && *(file_name.end() - 1) == 'g') {
|
|
|
|
target->model = Target::Model::SG1000;
|
|
|
|
} else {
|
|
|
|
target->model = Target::Model::MasterSystem;
|
|
|
|
}
|
|
|
|
|
2018-09-21 02:04:28 +00:00
|
|
|
target->media.cartridges = media.cartridges;
|
2018-09-23 20:34:47 +00:00
|
|
|
|
2018-09-21 02:04:28 +00:00
|
|
|
if(!target->media.empty())
|
|
|
|
targets.push_back(std::move(target));
|
2018-09-23 20:34:47 +00:00
|
|
|
|
2018-09-21 02:04:28 +00:00
|
|
|
return targets;
|
|
|
|
}
|