mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-21 21:33:54 +00:00
Walk further towards user display configuration.
This commit is contained in:
parent
ff000a5792
commit
8645a4b7b1
@ -73,12 +73,11 @@ class CGA {
|
||||
}
|
||||
}
|
||||
|
||||
/// Sets the type of display.
|
||||
// MARK: - Display type configuration.
|
||||
|
||||
void set_display_type(Outputs::Display::DisplayType display_type) {
|
||||
outputter_.crt.set_display_type(display_type);
|
||||
}
|
||||
|
||||
/// Gets the type of display.
|
||||
Outputs::Display::DisplayType get_display_type() const {
|
||||
return outputter_.crt.get_display_type();
|
||||
}
|
||||
|
@ -72,11 +72,17 @@ class MDA {
|
||||
void set_scan_target(Outputs::Display::ScanTarget *scan_target) {
|
||||
outputter_.crt.set_scan_target(scan_target);
|
||||
}
|
||||
|
||||
Outputs::Display::ScanStatus get_scaled_scan_status() const {
|
||||
return outputter_.crt.get_scaled_scan_status() * 596591.0f / 8128500.0f;
|
||||
}
|
||||
|
||||
// MARK: - Display type configuration.
|
||||
|
||||
void set_display_type(Outputs::Display::DisplayType) {}
|
||||
Outputs::Display::DisplayType get_display_type() const {
|
||||
return outputter_.crt.get_display_type();
|
||||
}
|
||||
|
||||
private:
|
||||
struct CRTCOutputter {
|
||||
CRTCOutputter() :
|
||||
|
@ -863,7 +863,8 @@ class ConcreteMachine:
|
||||
public MachineTypes::MappedKeyboardMachine,
|
||||
public MachineTypes::MediaTarget,
|
||||
public MachineTypes::ScanProducer,
|
||||
public Activity::Source
|
||||
public Activity::Source,
|
||||
public Configurable::Device
|
||||
{
|
||||
static constexpr int DriveCount = 1;
|
||||
using Video = typename Adaptor<video>::type;
|
||||
@ -1061,6 +1062,26 @@ class ConcreteMachine:
|
||||
fdc_.set_activity_observer(observer);
|
||||
}
|
||||
|
||||
// MARK: - Configuration options.
|
||||
std::unique_ptr<Reflection::Struct> get_options() override {
|
||||
auto options = std::make_unique<Options>(Configurable::OptionsType::UserFriendly);
|
||||
options->output = get_video_signal_configurable();
|
||||
return options;
|
||||
}
|
||||
|
||||
void set_options(const std::unique_ptr<Reflection::Struct> &str) override {
|
||||
const auto options = dynamic_cast<Options *>(str.get());
|
||||
set_video_signal_configurable(options->output);
|
||||
}
|
||||
|
||||
void set_display_type(Outputs::Display::DisplayType display_type) override {
|
||||
video_.set_display_type(display_type);
|
||||
}
|
||||
|
||||
Outputs::Display::DisplayType get_display_type() const override {
|
||||
return video_.get_display_type();
|
||||
}
|
||||
|
||||
private:
|
||||
PIC pic_;
|
||||
DMA dma_;
|
||||
|
Loading…
Reference in New Issue
Block a user