mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-27 15:29:34 +00:00
Add selectable display type.
This commit is contained in:
parent
1300546a52
commit
8463e9ed94
@ -19,6 +19,7 @@
|
|||||||
#include "../../../Processors/6502/6502.hpp"
|
#include "../../../Processors/6502/6502.hpp"
|
||||||
#include "../../../Analyser/Static/Commodore/Target.hpp"
|
#include "../../../Analyser/Static/Commodore/Target.hpp"
|
||||||
#include "../../../Outputs/Speaker/Implementation/LowpassSpeaker.hpp"
|
#include "../../../Outputs/Speaker/Implementation/LowpassSpeaker.hpp"
|
||||||
|
#include "../../../Configurable/StandardOptions.hpp"
|
||||||
|
|
||||||
#include "../../../Storage/Tape/Tape.hpp"
|
#include "../../../Storage/Tape/Tape.hpp"
|
||||||
#include "../SerialBus.hpp"
|
#include "../SerialBus.hpp"
|
||||||
@ -124,6 +125,7 @@ private:
|
|||||||
class ConcreteMachine:
|
class ConcreteMachine:
|
||||||
public Activity::Source,
|
public Activity::Source,
|
||||||
public BusController,
|
public BusController,
|
||||||
|
public Configurable::Device,
|
||||||
public CPU::MOS6502::BusHandler,
|
public CPU::MOS6502::BusHandler,
|
||||||
public MachineTypes::AudioProducer,
|
public MachineTypes::AudioProducer,
|
||||||
public MachineTypes::MappedKeyboardMachine,
|
public MachineTypes::MappedKeyboardMachine,
|
||||||
@ -467,6 +469,14 @@ private:
|
|||||||
return video_.get_scaled_scan_status();
|
return video_.get_scaled_scan_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_display_type(const Outputs::Display::DisplayType display_type) final {
|
||||||
|
video_.set_display_type(display_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
Outputs::Display::DisplayType get_display_type() const final {
|
||||||
|
return video_.get_display_type();
|
||||||
|
}
|
||||||
|
|
||||||
void run_for(const Cycles cycles) final {
|
void run_for(const Cycles cycles) final {
|
||||||
m6502_.run_for(cycles);
|
m6502_.run_for(cycles);
|
||||||
|
|
||||||
@ -549,7 +559,26 @@ private:
|
|||||||
SerialPort serial_port_;
|
SerialPort serial_port_;
|
||||||
|
|
||||||
std::unique_ptr<Storage::Tape::BinaryTapePlayer> tape_player_;
|
std::unique_ptr<Storage::Tape::BinaryTapePlayer> tape_player_;
|
||||||
|
bool allow_fast_tape_hack_ = false; // TODO: implement fast-tape hack.
|
||||||
|
void set_use_fast_tape() {}
|
||||||
|
|
||||||
uint8_t io_direction_ = 0x00, io_output_ = 0x00;
|
uint8_t io_direction_ = 0x00, io_output_ = 0x00;
|
||||||
|
|
||||||
|
// MARK: - Configuration options.
|
||||||
|
std::unique_ptr<Reflection::Struct> get_options() const final {
|
||||||
|
auto options = std::make_unique<Options>(Configurable::OptionsType::UserFriendly);
|
||||||
|
options->output = get_video_signal_configurable();
|
||||||
|
options->quickload = allow_fast_tape_hack_;
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
allow_fast_tape_hack_ = options->quickload;
|
||||||
|
set_use_fast_tape();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "../../../Configurable/Configurable.hpp"
|
||||||
|
#include "../../../Configurable/StandardOptions.hpp"
|
||||||
#include "../../../Analyser/Static/StaticAnalyser.hpp"
|
#include "../../../Analyser/Static/StaticAnalyser.hpp"
|
||||||
#include "../../ROMMachine.hpp"
|
#include "../../ROMMachine.hpp"
|
||||||
|
|
||||||
@ -15,10 +17,36 @@
|
|||||||
|
|
||||||
namespace Commodore::Plus4 {
|
namespace Commodore::Plus4 {
|
||||||
|
|
||||||
|
std::unique_ptr<Reflection::Struct> get_options();
|
||||||
|
|
||||||
struct Machine {
|
struct Machine {
|
||||||
virtual ~Machine() = default;
|
virtual ~Machine() = default;
|
||||||
|
|
||||||
static std::unique_ptr<Machine> Plus4(const Analyser::Static::Target *, const ROMMachine::ROMFetcher &);
|
static std::unique_ptr<Machine> Plus4(const Analyser::Static::Target *, const ROMMachine::ROMFetcher &);
|
||||||
|
|
||||||
|
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::SVideo : Configurable::Display::CompositeColour),
|
||||||
|
Configurable::QuickloadOption<Options>(type == Configurable::OptionsType::UserFriendly) {
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
Options() : Options(Configurable::OptionsType::UserFriendly) {}
|
||||||
|
|
||||||
|
friend Reflection::StructImpl<Options>;
|
||||||
|
void declare_fields() {
|
||||||
|
declare_display_option();
|
||||||
|
declare_quickload_option();
|
||||||
|
limit_enum(&output, Configurable::Display::SVideo, Configurable::Display::CompositeColour, -1);
|
||||||
|
}
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -570,6 +570,14 @@ public:
|
|||||||
return crt_.get_scaled_scan_status();
|
return crt_.get_scaled_scan_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_display_type(const Outputs::Display::DisplayType display_type) {
|
||||||
|
crt_.set_display_type(display_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
Outputs::Display::DisplayType get_display_type() const {
|
||||||
|
return crt_.get_display_type();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Outputs::CRT::CRT crt_;
|
Outputs::CRT::CRT crt_;
|
||||||
Cycles subcycles_;
|
Cycles subcycles_;
|
||||||
|
@ -235,7 +235,7 @@ std::map<std::string, std::unique_ptr<Reflection::Struct>> Machine::AllOptionsBy
|
|||||||
Emplace(MasterSystem, Sega::MasterSystem::Machine);
|
Emplace(MasterSystem, Sega::MasterSystem::Machine);
|
||||||
Emplace(MSX, MSX::Machine);
|
Emplace(MSX, MSX::Machine);
|
||||||
Emplace(Oric, Oric::Machine);
|
Emplace(Oric, Oric::Machine);
|
||||||
// Emplace(Plus4, Commodore::Plus4::Machine); // There are no options yet.
|
Emplace(Plus4, Commodore::Plus4::Machine);
|
||||||
Emplace(PCCompatible, PCCompatible::Machine);
|
Emplace(PCCompatible, PCCompatible::Machine);
|
||||||
Emplace(Vic20, Commodore::Vic20::Machine);
|
Emplace(Vic20, Commodore::Vic20::Machine);
|
||||||
Emplace(ZX8081, Sinclair::ZX8081::Machine);
|
Emplace(ZX8081, Sinclair::ZX8081::Machine);
|
||||||
|
@ -402,6 +402,7 @@ static Analyser::Static::ZX8081::Target::MemoryModel ZX8081MemoryModelFromSize(K
|
|||||||
case Analyser::Machine::MasterSystem: return @"CompositeOptions";
|
case Analyser::Machine::MasterSystem: return @"CompositeOptions";
|
||||||
case Analyser::Machine::MSX: return @"QuickLoadCompositeOptions";
|
case Analyser::Machine::MSX: return @"QuickLoadCompositeOptions";
|
||||||
case Analyser::Machine::Oric: return @"OricOptions";
|
case Analyser::Machine::Oric: return @"OricOptions";
|
||||||
|
case Analyser::Machine::Plus4: return @"QuickLoadCompositeOptions";
|
||||||
case Analyser::Machine::PCCompatible: return @"CompositeOptions";
|
case Analyser::Machine::PCCompatible: return @"CompositeOptions";
|
||||||
case Analyser::Machine::Vic20: return @"QuickLoadCompositeOptions";
|
case Analyser::Machine::Vic20: return @"QuickLoadCompositeOptions";
|
||||||
case Analyser::Machine::ZX8081: return @"ZX8081Options";
|
case Analyser::Machine::ZX8081: return @"ZX8081Options";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user