diff --git a/Machines/PCCompatible/CGA.hpp b/Machines/PCCompatible/CGA.hpp index a72028d5d..6edbe5764 100644 --- a/Machines/PCCompatible/CGA.hpp +++ b/Machines/PCCompatible/CGA.hpp @@ -73,6 +73,16 @@ class CGA { } } + /// Sets the type of display. + 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(); + } + // MARK: - Call-ins for ScanProducer. void set_scan_target(Outputs::Display::ScanTarget *scan_target) { @@ -92,8 +102,9 @@ class CGA { CRTCOutputter() : crt(910, 8, Outputs::Display::Type::NTSC60, Outputs::Display::InputDataType::Red2Green2Blue2) { -// crt.set_visible_area(Outputs::Display::Rect(0.1072f, 0.1f, 0.842105263157895f, 0.842105263157895f)); + crt.set_visible_area(Outputs::Display::Rect(0.097f, 0.095f, 0.82f, 0.82f)); crt.set_display_type(Outputs::Display::DisplayType::CompositeColour); // TODO: needs to be a user option. +// crt.set_display_type(Outputs::Display::DisplayType::RGB); // TODO: needs to be a user option. } void set_mode(uint8_t control) { @@ -341,7 +352,7 @@ class CGA { } outputter_; Motorola::CRTC::CRTC6845 crtc_; - int full_clock_; + int full_clock_ = 0; }; } diff --git a/Machines/PCCompatible/MDA.hpp b/Machines/PCCompatible/MDA.hpp index 39c450aa3..4a7e12ce1 100644 --- a/Machines/PCCompatible/MDA.hpp +++ b/Machines/PCCompatible/MDA.hpp @@ -222,7 +222,7 @@ class MDA { } outputter_; Motorola::CRTC::CRTC6845 crtc_; - int full_clock_; + int full_clock_ = 0; }; } diff --git a/Machines/PCCompatible/PCCompatible.hpp b/Machines/PCCompatible/PCCompatible.hpp index 0362a414c..d2b8c9c41 100644 --- a/Machines/PCCompatible/PCCompatible.hpp +++ b/Machines/PCCompatible/PCCompatible.hpp @@ -9,6 +9,8 @@ #ifndef PCCompatible_hpp #define PCCompatible_hpp +#include "../../Configurable/Configurable.hpp" +#include "../../Configurable/StandardOptions.hpp" #include "../../Analyser/Static/StaticAnalyser.hpp" #include "../ROMMachine.hpp" @@ -26,6 +28,23 @@ class Machine { const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher ); + + /// Defines the runtime options [sometimes] available for a PC. + class Options: + public Reflection::StructImpl, + public Configurable::DisplayOption + { + friend Configurable::DisplayOption; + public: + Options(Configurable::OptionsType) : + Configurable::DisplayOption(Configurable::Display::RGB) + { + if(needs_declare()) { + declare_display_option(); + limit_enum(&output, Configurable::Display::RGB, Configurable::Display::CompositeColour, -1); + } + } + }; }; } diff --git a/Machines/Utility/MachineForTarget.cpp b/Machines/Utility/MachineForTarget.cpp index 8bde43eba..73f82c9cf 100644 --- a/Machines/Utility/MachineForTarget.cpp +++ b/Machines/Utility/MachineForTarget.cpp @@ -222,6 +222,7 @@ std::map> Machine::AllOptionsBy Emplace(MasterSystem, Sega::MasterSystem::Machine); Emplace(MSX, MSX::Machine); Emplace(Oric, Oric::Machine); + Emplace(PCCompatible, PCCompatible::Machine); Emplace(Vic20, Commodore::Vic20::Machine); Emplace(ZX8081, Sinclair::ZX8081::Machine); Emplace(ZXSpectrum, Sinclair::ZXSpectrum::Machine);