2016-01-04 23:12:47 -05:00
|
|
|
//
|
|
|
|
// Electron.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 03/01/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Electron_hpp
|
|
|
|
#define Electron_hpp
|
|
|
|
|
2017-11-17 23:02:00 -05:00
|
|
|
#include "../../Configurable/Configurable.hpp"
|
2016-09-08 05:32:17 -04:00
|
|
|
#include "../ConfigurationTarget.hpp"
|
2016-05-31 21:23:44 -04:00
|
|
|
#include "../CRTMachine.hpp"
|
2017-08-16 15:33:40 -04:00
|
|
|
#include "../KeyboardMachine.hpp"
|
2016-06-19 17:25:35 -04:00
|
|
|
|
|
|
|
#include <cstdint>
|
2016-09-20 07:36:57 -04:00
|
|
|
#include <vector>
|
2016-01-04 23:12:47 -05:00
|
|
|
|
|
|
|
namespace Electron {
|
|
|
|
|
2016-01-07 21:01:13 -05:00
|
|
|
enum ROMSlot: uint8_t {
|
2016-01-07 22:26:49 -05:00
|
|
|
ROMSlot0 = 0,
|
|
|
|
ROMSlot1, ROMSlot2, ROMSlot3,
|
|
|
|
ROMSlot4, ROMSlot5, ROMSlot6, ROMSlot7,
|
2016-01-07 21:01:13 -05:00
|
|
|
|
|
|
|
ROMSlotKeyboard = 8, ROMSlot9,
|
|
|
|
ROMSlotBASIC = 10, ROMSlot11,
|
|
|
|
|
2016-01-07 22:26:49 -05:00
|
|
|
ROMSlot12, ROMSlot13, ROMSlot14, ROMSlot15,
|
2016-01-07 21:01:13 -05:00
|
|
|
|
2017-11-06 22:14:15 -05:00
|
|
|
ROMSlotOS, ROMSlotDFS,
|
|
|
|
ROMSlotADFS1, ROMSlotADFS2
|
2016-01-06 21:09:49 -05:00
|
|
|
};
|
|
|
|
|
2017-11-20 21:55:32 -05:00
|
|
|
/// @returns The options available for an Electron.
|
|
|
|
std::vector<std::unique_ptr<Configurable::Option>> get_options();
|
|
|
|
|
2016-01-23 00:14:44 -05:00
|
|
|
/*!
|
2016-01-20 21:55:38 -05:00
|
|
|
@abstract Represents an Acorn Electron.
|
2017-11-07 22:54:22 -05:00
|
|
|
|
2016-01-20 21:55:38 -05:00
|
|
|
@discussion An instance of Electron::Machine represents the current state of an
|
|
|
|
Acorn Electron.
|
|
|
|
*/
|
2016-06-19 17:25:35 -04:00
|
|
|
class Machine:
|
|
|
|
public CRTMachine::Machine,
|
2017-08-16 15:33:40 -04:00
|
|
|
public ConfigurationTarget::Machine,
|
2017-11-17 23:02:00 -05:00
|
|
|
public KeyboardMachine::Machine,
|
|
|
|
public Configurable::Device {
|
2016-01-04 23:12:47 -05:00
|
|
|
public:
|
2017-08-16 15:33:40 -04:00
|
|
|
virtual ~Machine();
|
|
|
|
|
|
|
|
/// Creates and returns an Electron.
|
|
|
|
static Machine *Electron();
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Sets the contents of @c slot to @c data. If @c is_writeable is @c true then writing to the slot
|
|
|
|
is enabled — it acts as if it were sideways RAM. Otherwise the slot is modelled as containing ROM.
|
|
|
|
*/
|
2017-11-07 21:19:51 -05:00
|
|
|
virtual void set_rom(ROMSlot slot, const std::vector<uint8_t> &data, bool is_writeable) = 0;
|
2016-01-04 23:12:47 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Electron_hpp */
|