1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Expands to take an already-accrued list of potential platforms, as that may indicate that one or the other of the ZX80 and ZX81 is already out of contention and therefore save the need to attempt analysis.

This commit is contained in:
Thomas Harte 2017-08-27 15:20:22 -04:00
parent 4465098157
commit 437023bff6
2 changed files with 14 additions and 3 deletions

View File

@ -27,14 +27,24 @@ static std::vector<Storage::Data::ZX8081::File> GetFiles(const std::shared_ptr<S
return files; return files;
} }
void StaticAnalyser::ZX8081::AddTargets(const Media &media, std::list<Target> &destination) { void StaticAnalyser::ZX8081::AddTargets(const Media &media, std::list<Target> &destination, TargetPlatform::IntType potential_platforms) {
if(!media.tapes.empty()) { if(!media.tapes.empty()) {
std::vector<Storage::Data::ZX8081::File> files = GetFiles(media.tapes.front()); std::vector<Storage::Data::ZX8081::File> files = GetFiles(media.tapes.front());
media.tapes.front()->reset(); media.tapes.front()->reset();
if(!files.empty()) { if(!files.empty()) {
StaticAnalyser::Target target; StaticAnalyser::Target target;
target.machine = Target::ZX8081; target.machine = Target::ZX8081;
// Guess the machine type from the file only if it isn't already known.
switch(potential_platforms & (TargetPlatform::ZX80 | TargetPlatform::ZX81)) {
default:
target.zx8081.isZX81 = files.front().isZX81; target.zx8081.isZX81 = files.front().isZX81;
break;
case TargetPlatform::ZX80: target.zx8081.isZX81 = false; break;
case TargetPlatform::ZX81: target.zx8081.isZX81 = true; break;
}
/*if(files.front().data.size() > 16384) { /*if(files.front().data.size() > 16384) {
target.zx8081.memory_model = ZX8081MemoryModel::SixtyFourKB; target.zx8081.memory_model = ZX8081MemoryModel::SixtyFourKB;
} else*/ if(files.front().data.size() > 1024) { } else*/ if(files.front().data.size() > 1024) {

View File

@ -10,11 +10,12 @@
#define StaticAnalyser_ZX8081_StaticAnalyser_hpp #define StaticAnalyser_ZX8081_StaticAnalyser_hpp
#include "../StaticAnalyser.hpp" #include "../StaticAnalyser.hpp"
#include "../../Storage/TargetPlatforms.hpp"
namespace StaticAnalyser { namespace StaticAnalyser {
namespace ZX8081 { namespace ZX8081 {
void AddTargets(const Media &media, std::list<Target> &destination); void AddTargets(const Media &media, std::list<Target> &destination, TargetPlatform::IntType potential_platforms);
} }
} }