1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-11 08:30:55 +00:00

Reintroduces Oric runtime options.

This commit is contained in:
Thomas Harte 2020-03-18 18:31:31 -04:00
parent ead2823322
commit ffc1b0ff29
5 changed files with 34 additions and 47 deletions

View File

@ -50,20 +50,6 @@ enum ROM {
BASIC10 = 0, BASIC11, Microdisc, Colour
};
//std::vector<std::unique_ptr<Configurable::Option>> get_options() {
// return Configurable::standard_options(
// static_cast<Configurable::StandardOptions>(
// Configurable::DisplayRGB |
// Configurable::DisplayCompositeColour |
// Configurable::DisplayCompositeMonochrome |
// Configurable::QuickLoadTape)
// );
//}
std::unique_ptr<Reflection::Struct> get_options() {
return nullptr;
}
/*!
Models the Oric's keyboard: eight key rows, containing a bitfield of keys set.
@ -569,6 +555,10 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
video_output_.set_display_type(display_type);
}
Outputs::Display::DisplayType get_display_type() final {
return video_output_.get_display_type();
}
Outputs::Speaker::Speaker *get_speaker() final {
return &speaker_;
}
@ -628,40 +618,17 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
// MARK: - Configuration options.
std::unique_ptr<Reflection::Struct> get_options() final {
return nullptr;
auto options = std::make_unique<Options>(Configurable::OptionsType::UserFriendly);
options->output = get_video_signal_configurable();
options->quickload = use_fast_tape_hack_;
return options;
}
void set_options(const std::unique_ptr<Reflection::Struct> &options) final {
void set_options(const std::unique_ptr<Reflection::Struct> &str) final {
const auto options = dynamic_cast<Options *>(str.get());
set_video_signal_configurable(options->output);
set_use_fast_tape_hack(options->quickload);
}
// std::vector<std::unique_ptr<Configurable::Option>> get_options() final {
// return Oric::get_options();
// }
//
// void set_selections(const Configurable::SelectionSet &selections_by_option) final {
// bool quickload;
// if(Configurable::get_quick_load_tape(selections_by_option, quickload)) {
// set_use_fast_tape_hack(quickload);
// }
//
// Configurable::Display display;
// if(Configurable::get_display(selections_by_option, display)) {
// set_video_signal_configurable(display);
// }
// }
//
// Configurable::SelectionSet get_accurate_selections() final {
// Configurable::SelectionSet selection_set;
// Configurable::append_quick_load_tape_selection(selection_set, false);
// Configurable::append_display_selection(selection_set, Configurable::Display::CompositeColour);
// return selection_set;
// }
//
// Configurable::SelectionSet get_user_friendly_selections() final {
// Configurable::SelectionSet selection_set;
// Configurable::append_quick_load_tape_selection(selection_set, true);
// Configurable::append_display_selection(selection_set, Configurable::Display::RGB);
// return selection_set;
// }
void set_activity_observer(Activity::Observer *observer) final {
switch(disk_interface) {

View File

@ -9,7 +9,8 @@
#ifndef Oric_hpp
#define Oric_hpp
#include "../../Reflection/Struct.h"
#include "../../Configurable/Configurable.hpp"
#include "../../Configurable/StandardOptions.hpp"
#include "../../Analyser/Static/StaticAnalyser.hpp"
#include "../ROMMachine.hpp"
@ -29,6 +30,20 @@ class Machine {
/// Creates and returns an Oric.
static Machine *Oric(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);
class Options: public Reflection::StructImpl<Options>, public Configurable::DisplayOption<Options>, public Configurable::QuickloadOption<Options> {
friend Configurable::DisplayOption<Options>;
friend Configurable::QuickloadOption<Options>;
public:
Options(Configurable::OptionsType type) :
Configurable::DisplayOption<Options>(type == Configurable::OptionsType::UserFriendly ? Configurable::Display::RGB : Configurable::Display::CompositeColour),
Configurable::QuickloadOption<Options>(type == Configurable::OptionsType::UserFriendly) {
if(needs_declare()) {
declare_display_option();
declare_quickload_option();
}
}
};
};
}

View File

@ -67,6 +67,10 @@ void VideoOutput::set_display_type(Outputs::Display::DisplayType display_type) {
}
}
Outputs::Display::DisplayType VideoOutput::get_display_type() {
return crt_.get_display_type();
}
void VideoOutput::set_scan_target(Outputs::Display::ScanTarget *scan_target) {
crt_.set_scan_target(scan_target);
}

View File

@ -27,6 +27,7 @@ class VideoOutput {
void set_scan_target(Outputs::Display::ScanTarget *scan_target);
void set_display_type(Outputs::Display::DisplayType display_type);
Outputs::Display::DisplayType get_display_type();
Outputs::Display::ScanStatus get_scaled_scan_status() const;
void register_crt_frequency_mismatch();

View File

@ -177,7 +177,6 @@ std::map<std::string, std::unique_ptr<Reflection::Struct>> Machine::AllOptionsBy
std::map<std::string, std::unique_ptr<Reflection::Struct>> options;
// options.emplace(std::make_pair(LongNameForTargetMachine(Analyser::Machine::Macintosh), Apple::Macintosh::get_options()));
// options.emplace(std::make_pair(LongNameForTargetMachine(Analyser::Machine::Oric), Oric::get_options()));
// options.emplace(std::make_pair(LongNameForTargetMachine(Analyser::Machine::Vic20), Commodore::Vic20::get_options()));
#define Emplace(machine, class) \
@ -190,6 +189,7 @@ std::map<std::string, std::unique_ptr<Reflection::Struct>> Machine::AllOptionsBy
Emplace(Electron, Electron::Machine);
Emplace(MasterSystem, Sega::MasterSystem::Machine);
Emplace(MSX, MSX::Machine);
Emplace(Oric, Oric::Machine);
Emplace(ZX8081, ZX8081::Machine);
#undef Emplace