1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-17 06:29:28 +00:00

Include the PC target and analyser.

This commit is contained in:
Thomas Harte 2023-11-29 15:59:42 -05:00
parent f7acecfbff
commit edc36bf3f4
3 changed files with 80 additions and 0 deletions

View File

@ -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<Analyser::Static::Target>(target));
return targets;
}

View File

@ -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 <string>
namespace Analyser::Static::PCCompatible {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* Analyser_Static_PCCompatible_StaticAnalyser_hpp */

View File

@ -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<Target> {
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 */