1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-12 15:31:09 +00:00

Eliminates the Oric's non-reflective inputs for selections, and the Oric-specific ROM setter.

This commit is contained in:
Thomas Harte 2017-11-24 16:59:00 -05:00
parent bc65ba3f9b
commit a8ac51da73
3 changed files with 18 additions and 21 deletions

View File

@ -25,10 +25,16 @@
#include "../../ClockReceiver/ForceInline.hpp"
#include "../../Configurable/StandardOptions.hpp"
#include <cstdint>
#include <memory>
#include <vector>
namespace Oric {
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::DisplayRGBComposite | Configurable::QuickLoadTape)
@ -198,7 +204,7 @@ class ConcreteMachine:
Memory::Fuzz(ram_, sizeof(ram_));
}
void set_rom(ROM rom, const std::vector<uint8_t> &data) override final {
void set_rom(ROM rom, const std::vector<uint8_t> &data) {
switch(rom) {
case BASIC11: basic11_rom_ = std::move(data); break;
case BASIC10: basic10_rom_ = std::move(data); break;
@ -240,11 +246,11 @@ class ConcreteMachine:
keyboard_.clear_all_keys();
}
void set_use_fast_tape_hack(bool activate) override final {
void set_use_fast_tape_hack(bool activate) {
use_fast_tape_hack_ = activate;
}
void set_output_device(Outputs::CRT::OutputDevice output_device) override final {
void set_output_device(Outputs::CRT::OutputDevice output_device) {
video_output_->set_output_device(output_device);
}

View File

@ -14,15 +14,8 @@
#include "../CRTMachine.hpp"
#include "../KeyboardMachine.hpp"
#include <cstdint>
#include <vector>
namespace Oric {
enum ROM {
BASIC10 = 0, BASIC11, Microdisc, Colour
};
/// @returns The options available for an Oric.
std::vector<std::unique_ptr<Configurable::Option>> get_options();
@ -39,15 +32,6 @@ class Machine:
/// Creates and returns an Oric.
static Machine *Oric();
/// Sets the contents of @c rom to @c data. Assumed to be a setup step; has no effect once a machine is running.
virtual void set_rom(ROM rom, const std::vector<uint8_t> &data) = 0;
/// Enables or disables turbo-speed tape loading.
virtual void set_use_fast_tape_hack(bool activate) = 0;
/// Sets the type of display the Oric is connected to.
virtual void set_output_device(Outputs::CRT::OutputDevice output_device) = 0;
};
}

View File

@ -9,6 +9,7 @@
#import "CSOric.h"
#include "Oric.hpp"
#include "StandardOptions.hpp"
@implementation CSOric {
std::unique_ptr<Oric::Machine> _oric;
@ -29,14 +30,20 @@
- (void)setUseFastLoadingHack:(BOOL)useFastLoadingHack {
@synchronized(self) {
_useFastLoadingHack = useFastLoadingHack;
_oric->set_use_fast_tape_hack(useFastLoadingHack ? true : false);
Configurable::SelectionSet selection_set;
append_quick_load_tape_selection(selection_set, useFastLoadingHack ? true : false);
_oric->set_selections(selection_set);
}
}
- (void)setUseCompositeOutput:(BOOL)useCompositeOutput {
@synchronized(self) {
_useCompositeOutput = useCompositeOutput;
_oric->set_output_device(useCompositeOutput ? Outputs::CRT::OutputDevice::Television : Outputs::CRT::OutputDevice::Monitor);
Configurable::SelectionSet selection_set;
append_display_selection(selection_set, useCompositeOutput ? Configurable::Display::Composite : Configurable::Display::RGB);
_oric->set_selections(selection_set);
}
}