diff --git a/Analyser/Static/PCCompatible/StaticAnalyser.cpp b/Analyser/Static/PCCompatible/StaticAnalyser.cpp new file mode 100644 index 000000000..dbac1dd0b --- /dev/null +++ b/Analyser/Static/PCCompatible/StaticAnalyser.cpp @@ -0,0 +1,25 @@ +// +// StaticAnalyser.cpp +// Clock Signal +// +// Created by Thomas Harte on 03/10/2019. +// Copyright © 2019 Thomas Harte. All rights reserved. +// + +#include "StaticAnalyser.hpp" +#include "Target.hpp" + +Analyser::Static::TargetList Analyser::Static::PCCompatible::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) { + // This analyser can comprehend disks only. + if(media.disks.empty()) return {}; + + // No analysis is applied yet. + Analyser::Static::TargetList targets; + + using Target = Analyser::Static::PCCompatible::Target; + auto *const target = new Target(); + target->media = media; + targets.push_back(std::unique_ptr(target)); + + return targets; +} diff --git a/Analyser/Static/PCCompatible/StaticAnalyser.hpp b/Analyser/Static/PCCompatible/StaticAnalyser.hpp new file mode 100644 index 000000000..40a08bea7 --- /dev/null +++ b/Analyser/Static/PCCompatible/StaticAnalyser.hpp @@ -0,0 +1,22 @@ +// +// StaticAnalyser.hpp +// Clock Signal +// +// Created by Thomas Harte on 29/11/2019. +// Copyright © 2023 Thomas Harte. All rights reserved. +// + +#ifndef Analyser_Static_PCCompatible_StaticAnalyser_hpp +#define Analyser_Static_PCCompatible_StaticAnalyser_hpp + +#include "../StaticAnalyser.hpp" +#include "../../../Storage/TargetPlatforms.hpp" +#include + +namespace Analyser::Static::PCCompatible { + +TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms); + +} + +#endif /* Analyser_Static_PCCompatible_StaticAnalyser_hpp */ diff --git a/Analyser/Static/PCCompatible/Target.hpp b/Analyser/Static/PCCompatible/Target.hpp new file mode 100644 index 000000000..ef8e9deb0 --- /dev/null +++ b/Analyser/Static/PCCompatible/Target.hpp @@ -0,0 +1,33 @@ +// +// Target.hpp +// Clock Signal +// +// Created by Thomas Harte on 29/11/2023. +// Copyright © 2023 Thomas Harte. All rights reserved. +// + +#ifndef Analyser_Static_PCCompatible_Target_h +#define Analyser_Static_PCCompatible_Target_h + +#include "../../../Reflection/Struct.hpp" +#include "../StaticAnalyser.hpp" + +namespace Analyser::Static::PCCompatible { + +struct Target: public Analyser::Static::Target, public Reflection::StructImpl { + ReflectableEnum(VideoAdaptor, + MDA, + CGA); + VideoAdaptor adaptor = VideoAdaptor::MDA; + + Target() : Analyser::Static::Target(Machine::PCCompatible) { + if(needs_declare()) { + DeclareField(adaptor); + AnnounceEnum(VideoAdaptor); + } + } +}; + +} + +#endif /* Analyser_Static_PCCompatible_Target_h */