mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Adds configuration options to the Vic-20, Oric and ZX80/81.
This commit is contained in:
parent
073e439518
commit
82ad0354c4
@ -636,6 +636,30 @@ class ConcreteMachine:
|
||||
return keyboard_mapper_;
|
||||
}
|
||||
|
||||
// MARK: - Configuration options.
|
||||
std::vector<std::unique_ptr<Configurable::Option>> get_options() override {
|
||||
std::vector<std::unique_ptr<Configurable::Option>> options;
|
||||
options.emplace_back(new Configurable::BooleanOption("Load Tapes Quickly", "quickload"));
|
||||
return options;
|
||||
}
|
||||
|
||||
void set_selections(const Configurable::SelectionSet &selections_by_option) override {
|
||||
auto quickload = Configurable::selection<Configurable::BooleanSelection>(selections_by_option, "quickload");
|
||||
if(quickload) set_use_fast_tape_hack(quickload->value);
|
||||
}
|
||||
|
||||
Configurable::SelectionSet get_accurate_selections() override {
|
||||
Configurable::SelectionSet selection_set;
|
||||
selection_set["quickload"] = std::unique_ptr<Configurable::Selection>(new Configurable::BooleanSelection(false));
|
||||
return selection_set;
|
||||
}
|
||||
|
||||
Configurable::SelectionSet get_user_friendly_selections() override {
|
||||
Configurable::SelectionSet selection_set;
|
||||
selection_set["quickload"] = std::unique_ptr<Configurable::Selection>(new Configurable::BooleanSelection(true));
|
||||
return selection_set;
|
||||
}
|
||||
|
||||
private:
|
||||
CPU::MOS6502::Processor<ConcreteMachine, false> m6502_;
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#ifndef Vic20_hpp
|
||||
#define Vic20_hpp
|
||||
|
||||
#include "../../../Configurable/Configurable.hpp"
|
||||
#include "../../ConfigurationTarget.hpp"
|
||||
#include "../../CRTMachine.hpp"
|
||||
#include "../../KeyboardMachine.hpp"
|
||||
@ -44,7 +45,8 @@ class Machine:
|
||||
public CRTMachine::Machine,
|
||||
public ConfigurationTarget::Machine,
|
||||
public KeyboardMachine::Machine,
|
||||
public JoystickMachine::Machine {
|
||||
public JoystickMachine::Machine,
|
||||
public Configurable::Device {
|
||||
public:
|
||||
virtual ~Machine();
|
||||
|
||||
|
@ -416,6 +416,7 @@ class ConcreteMachine:
|
||||
return keyboard_mapper_;
|
||||
}
|
||||
|
||||
// MARK: - Configuration options.
|
||||
std::vector<std::unique_ptr<Configurable::Option>> get_options() override {
|
||||
std::vector<std::unique_ptr<Configurable::Option>> options;
|
||||
options.emplace_back(new Configurable::BooleanOption("Load Tapes Quickly", "quickload"));
|
||||
@ -446,6 +447,7 @@ class ConcreteMachine:
|
||||
}
|
||||
|
||||
private:
|
||||
// MARK: - Work deferral updates.
|
||||
inline void update_display() {
|
||||
if(cycles_since_display_update_ > 0) {
|
||||
video_output_->run_for(cycles_since_display_update_.flush());
|
||||
|
@ -427,6 +427,36 @@ class ConcreteMachine:
|
||||
return keyboard_mapper_;
|
||||
}
|
||||
|
||||
// MARK: - Configuration options.
|
||||
std::vector<std::unique_ptr<Configurable::Option>> get_options() override {
|
||||
std::vector<std::unique_ptr<Configurable::Option>> options;
|
||||
options.emplace_back(new Configurable::BooleanOption("Load Tapes Quickly", "quickload"));
|
||||
options.emplace_back(new Configurable::ListOption("Display", "display", {"composite", "rgb"}));
|
||||
return options;
|
||||
}
|
||||
|
||||
void set_selections(const Configurable::SelectionSet &selections_by_option) override {
|
||||
auto quickload = Configurable::selection<Configurable::BooleanSelection>(selections_by_option, "quickload");
|
||||
if(quickload) set_use_fast_tape_hack(quickload->value);
|
||||
|
||||
auto display = Configurable::selection<Configurable::ListSelection>(selections_by_option, "display");
|
||||
if(display) get_crt()->set_output_device((display->value == "rgb") ? Outputs::CRT::OutputDevice::Monitor : Outputs::CRT::OutputDevice::Television);
|
||||
}
|
||||
|
||||
Configurable::SelectionSet get_accurate_selections() override {
|
||||
Configurable::SelectionSet selection_set;
|
||||
selection_set["quickload"] = std::unique_ptr<Configurable::Selection>(new Configurable::BooleanSelection(false));
|
||||
selection_set["display"] = std::unique_ptr<Configurable::Selection>(new Configurable::ListSelection("composite"));
|
||||
return selection_set;
|
||||
}
|
||||
|
||||
Configurable::SelectionSet get_user_friendly_selections() override {
|
||||
Configurable::SelectionSet selection_set;
|
||||
selection_set["quickload"] = std::unique_ptr<Configurable::Selection>(new Configurable::BooleanSelection(true));
|
||||
selection_set["display"] = std::unique_ptr<Configurable::Selection>(new Configurable::ListSelection("rgb"));
|
||||
return selection_set;
|
||||
}
|
||||
|
||||
private:
|
||||
CPU::MOS6502::Processor<ConcreteMachine, false> m6502_;
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#ifndef Oric_hpp
|
||||
#define Oric_hpp
|
||||
|
||||
#include "../../Configurable/Configurable.hpp"
|
||||
#include "../ConfigurationTarget.hpp"
|
||||
#include "../CRTMachine.hpp"
|
||||
#include "../KeyboardMachine.hpp"
|
||||
@ -28,7 +29,8 @@ enum ROM {
|
||||
class Machine:
|
||||
public CRTMachine::Machine,
|
||||
public ConfigurationTarget::Machine,
|
||||
public KeyboardMachine::Machine {
|
||||
public KeyboardMachine::Machine,
|
||||
public Configurable::Device {
|
||||
public:
|
||||
virtual ~Machine();
|
||||
|
||||
|
@ -308,8 +308,7 @@ template<bool is_zx81> class ConcreteMachine:
|
||||
return true;
|
||||
}
|
||||
|
||||
// MARK: - Keyboard
|
||||
|
||||
// MARK: - Keyboard
|
||||
void set_key_state(uint16_t key, bool isPressed) override final {
|
||||
if(isPressed)
|
||||
key_states_[key >> 8] &= static_cast<uint8_t>(~key);
|
||||
@ -321,8 +320,7 @@ template<bool is_zx81> class ConcreteMachine:
|
||||
memset(key_states_, 0xff, 8);
|
||||
}
|
||||
|
||||
// MARK: - Tape control
|
||||
|
||||
// MARK: - Tape control
|
||||
void set_use_fast_tape_hack(bool activate) override final {
|
||||
use_fast_tape_hack_ = activate;
|
||||
}
|
||||
@ -337,8 +335,7 @@ template<bool is_zx81> class ConcreteMachine:
|
||||
tape_player_.set_motor_control(is_playing);
|
||||
}
|
||||
|
||||
// MARK: - Typer timing
|
||||
|
||||
// MARK: - Typer timing
|
||||
HalfCycles get_typer_delay() override final { return Cycles(7000000); }
|
||||
HalfCycles get_typer_frequency() override final { return Cycles(390000); }
|
||||
|
||||
@ -346,6 +343,36 @@ template<bool is_zx81> class ConcreteMachine:
|
||||
return keyboard_mapper_;
|
||||
}
|
||||
|
||||
// MARK: - Configuration options.
|
||||
std::vector<std::unique_ptr<Configurable::Option>> get_options() override {
|
||||
std::vector<std::unique_ptr<Configurable::Option>> options;
|
||||
options.emplace_back(new Configurable::BooleanOption("Load Tapes Quickly", "quickload"));
|
||||
options.emplace_back(new Configurable::BooleanOption("Automatic Tape Motor Control", "autotapemotor"));
|
||||
return options;
|
||||
}
|
||||
|
||||
void set_selections(const Configurable::SelectionSet &selections_by_option) override {
|
||||
auto quickload = Configurable::selection<Configurable::BooleanSelection>(selections_by_option, "quickload");
|
||||
if(quickload) set_use_fast_tape_hack(quickload->value);
|
||||
|
||||
auto autotapemotor = Configurable::selection<Configurable::BooleanSelection>(selections_by_option, "autotapemotor");
|
||||
if(autotapemotor) set_use_automatic_tape_motor_control(autotapemotor->value);
|
||||
}
|
||||
|
||||
Configurable::SelectionSet get_accurate_selections() override {
|
||||
Configurable::SelectionSet selection_set;
|
||||
selection_set["quickload"] = std::unique_ptr<Configurable::Selection>(new Configurable::BooleanSelection(false));
|
||||
selection_set["autotapemotor"] = std::unique_ptr<Configurable::Selection>(new Configurable::BooleanSelection(false));
|
||||
return selection_set;
|
||||
}
|
||||
|
||||
Configurable::SelectionSet get_user_friendly_selections() override {
|
||||
Configurable::SelectionSet selection_set;
|
||||
selection_set["quickload"] = std::unique_ptr<Configurable::Selection>(new Configurable::BooleanSelection(true));
|
||||
selection_set["autotapemotor"] = std::unique_ptr<Configurable::Selection>(new Configurable::BooleanSelection(true));
|
||||
return selection_set;
|
||||
}
|
||||
|
||||
private:
|
||||
CPU::Z80::Processor<ConcreteMachine, false, is_zx81> z80_;
|
||||
|
||||
@ -383,8 +410,7 @@ template<bool is_zx81> class ConcreteMachine:
|
||||
bool use_automatic_tape_motor_control_;
|
||||
HalfCycles tape_advance_delay_ = 0;
|
||||
|
||||
// MARK: - Video
|
||||
|
||||
// MARK: - Video
|
||||
inline void set_vsync(bool sync) {
|
||||
vsync_ = sync;
|
||||
update_sync();
|
||||
|
@ -9,6 +9,7 @@
|
||||
#ifndef ZX8081_hpp
|
||||
#define ZX8081_hpp
|
||||
|
||||
#include "../../Configurable/Configurable.hpp"
|
||||
#include "../ConfigurationTarget.hpp"
|
||||
#include "../CRTMachine.hpp"
|
||||
#include "../KeyboardMachine.hpp"
|
||||
@ -25,7 +26,8 @@ enum ROMType: uint8_t {
|
||||
class Machine:
|
||||
public CRTMachine::Machine,
|
||||
public ConfigurationTarget::Machine,
|
||||
public KeyboardMachine::Machine {
|
||||
public KeyboardMachine::Machine,
|
||||
public Configurable::Device {
|
||||
public:
|
||||
static Machine *ZX8081(const StaticAnalyser::Target &target_hint);
|
||||
virtual ~Machine();
|
||||
|
Loading…
x
Reference in New Issue
Block a user