2016-01-05 04:12:47 +00:00
|
|
|
//
|
|
|
|
// Electron.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 03/01/2016.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2016 Thomas Harte. All rights reserved.
|
2016-01-05 04:12:47 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Electron_hpp
|
|
|
|
#define Electron_hpp
|
|
|
|
|
2020-03-18 02:06:20 +00:00
|
|
|
#include "../../Configurable/Configurable.hpp"
|
|
|
|
#include "../../Configurable/StandardOptions.hpp"
|
2018-07-11 00:00:46 +00:00
|
|
|
#include "../../Analyser/Static/StaticAnalyser.hpp"
|
|
|
|
#include "../ROMMachine.hpp"
|
2016-06-19 21:25:35 +00:00
|
|
|
|
2018-06-10 22:28:29 +00:00
|
|
|
#include <memory>
|
2016-01-05 04:12:47 +00:00
|
|
|
|
|
|
|
namespace Electron {
|
|
|
|
|
2016-01-23 05:14:44 +00:00
|
|
|
/*!
|
2016-01-21 02:55:38 +00:00
|
|
|
@abstract Represents an Acorn Electron.
|
2017-11-08 03:54:22 +00:00
|
|
|
|
2016-01-21 02:55:38 +00:00
|
|
|
@discussion An instance of Electron::Machine represents the current state of an
|
|
|
|
Acorn Electron.
|
|
|
|
*/
|
2018-03-09 20:19:02 +00:00
|
|
|
class Machine {
|
2016-01-05 04:12:47 +00:00
|
|
|
public:
|
2017-08-16 19:33:40 +00:00
|
|
|
virtual ~Machine();
|
|
|
|
|
|
|
|
/// Creates and returns an Electron.
|
2018-07-11 00:00:46 +00:00
|
|
|
static Machine *Electron(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);
|
2020-03-18 02:06:20 +00:00
|
|
|
|
|
|
|
/// Defines the runtime options available for an Electron.
|
2020-03-18 03:52:55 +00:00
|
|
|
class Options: public Reflection::StructImpl<Options>, public Configurable::DisplayOption<Options>, public Configurable::QuickloadOption<Options> {
|
|
|
|
friend Configurable::DisplayOption<Options>;
|
|
|
|
friend Configurable::QuickloadOption<Options>;
|
2020-03-18 02:06:20 +00:00
|
|
|
public:
|
|
|
|
Options(Configurable::OptionsType type) :
|
2020-03-18 03:52:55 +00:00
|
|
|
Configurable::DisplayOption<Options>(type == Configurable::OptionsType::UserFriendly ? Configurable::Display::RGB : Configurable::Display::CompositeColour),
|
|
|
|
Configurable::QuickloadOption<Options>(type == Configurable::OptionsType::UserFriendly) {
|
2020-03-18 02:06:20 +00:00
|
|
|
if(needs_declare()) {
|
2020-03-18 03:52:55 +00:00
|
|
|
declare_display_option();
|
|
|
|
declare_quickload_option();
|
2020-03-19 00:23:55 +00:00
|
|
|
limit_enum(&output, Configurable::Display::RGB, Configurable::Display::CompositeColour, Configurable::Display::CompositeMonochrome, -1);
|
2020-03-18 02:06:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2016-01-05 04:12:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Electron_hpp */
|