2017-06-04 17:55:19 -04:00
|
|
|
//
|
|
|
|
// ZX8081.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 04/06/2017.
|
2018-05-13 15:19:52 -04:00
|
|
|
// Copyright 2017 Thomas Harte. All rights reserved.
|
2017-06-04 17:55:19 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ZX8081_hpp
|
|
|
|
#define ZX8081_hpp
|
|
|
|
|
2020-03-16 23:25:05 -04:00
|
|
|
#include "../../Configurable/Configurable.hpp"
|
2020-03-17 23:52:55 -04:00
|
|
|
#include "../../Configurable/StandardOptions.hpp"
|
2018-03-09 15:19:02 -05:00
|
|
|
#include "../../Analyser/Static/StaticAnalyser.hpp"
|
2018-07-10 20:00:46 -04:00
|
|
|
#include "../ROMMachine.hpp"
|
2017-06-04 17:55:19 -04:00
|
|
|
|
2020-03-15 23:48:53 -04:00
|
|
|
#include <memory>
|
|
|
|
|
2017-06-04 17:55:19 -04:00
|
|
|
namespace ZX8081 {
|
|
|
|
|
2020-03-16 23:25:05 -04:00
|
|
|
/// The ZX80/81 machine.
|
2018-03-09 15:19:02 -05:00
|
|
|
class Machine {
|
2017-06-04 17:55:19 -04:00
|
|
|
public:
|
2017-08-11 12:11:01 -04:00
|
|
|
virtual ~Machine();
|
2017-07-08 20:40:19 -04:00
|
|
|
|
2018-07-10 20:00:46 -04:00
|
|
|
static Machine *ZX8081(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);
|
2017-06-22 20:20:31 -04:00
|
|
|
|
2017-08-02 22:12:59 -04:00
|
|
|
virtual void set_tape_is_playing(bool is_playing) = 0;
|
2018-02-14 21:46:50 -05:00
|
|
|
virtual bool get_tape_is_playing() = 0;
|
2020-03-16 23:25:05 -04:00
|
|
|
|
|
|
|
/// Defines the runtime options available for a ZX80/81.
|
2020-03-17 23:52:55 -04:00
|
|
|
class Options: public Reflection::StructImpl<Options>, public Configurable::QuickloadOption<Options> {
|
|
|
|
friend Configurable::QuickloadOption<Options>;
|
2020-03-16 23:25:05 -04:00
|
|
|
public:
|
|
|
|
bool automatic_tape_motor_control;
|
|
|
|
|
|
|
|
Options(Configurable::OptionsType type):
|
2020-03-19 18:58:36 -04:00
|
|
|
Configurable::QuickloadOption<Options>(type == Configurable::OptionsType::UserFriendly),
|
|
|
|
automatic_tape_motor_control(type == Configurable::OptionsType::UserFriendly) {
|
2020-03-16 23:25:05 -04:00
|
|
|
|
|
|
|
// Declare fields if necessary.
|
|
|
|
if(needs_declare()) {
|
|
|
|
DeclareField(automatic_tape_motor_control);
|
2020-03-17 23:52:55 -04:00
|
|
|
declare_quickload_option();
|
2020-03-16 23:25:05 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2017-06-04 17:55:19 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* ZX8081_hpp */
|