From 0eab6146fcb174725c8a6a26e19c198f0b8bfdcd Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 11 Dec 2024 21:38:32 -0500 Subject: [PATCH] Introduce a CRT. --- Machines/Commodore/Plus4/Plus4.cpp | 5 +++-- Machines/Commodore/Plus4/Video.hpp | 13 +++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Machines/Commodore/Plus4/Plus4.cpp b/Machines/Commodore/Plus4/Plus4.cpp index 277cacb64..17392510c 100644 --- a/Machines/Commodore/Plus4/Plus4.cpp +++ b/Machines/Commodore/Plus4/Plus4.cpp @@ -230,11 +230,12 @@ public: private: CPU::MOS6502::Processor m6502_; - void set_scan_target(Outputs::Display::ScanTarget *const) final { + void set_scan_target(Outputs::Display::ScanTarget *const target) final { + video_.set_scan_target(target); } Outputs::Display::ScanStatus get_scaled_scan_status() const final { - return {}; + return video_.get_scaled_scan_status(); } void run_for(const Cycles cycles) final { diff --git a/Machines/Commodore/Plus4/Video.hpp b/Machines/Commodore/Plus4/Video.hpp index 944ad8262..3e4cf8f27 100644 --- a/Machines/Commodore/Plus4/Video.hpp +++ b/Machines/Commodore/Plus4/Video.hpp @@ -9,11 +9,14 @@ #pragma once #include "../../../Numeric/UpperBound.hpp" +#include "../../../Outputs/CRT/CRT.hpp" namespace Commodore::Plus4 { struct Video { public: + Video() : crt_(465, 1, Outputs::Display::Type::PAL50, Outputs::Display::InputDataType::Luminance8Phase8) {} + template void write(const uint8_t value) { const auto load_high10 = [&](uint16_t &target) { @@ -218,7 +221,17 @@ public: } } + void set_scan_target(Outputs::Display::ScanTarget *const target) { + crt_.set_scan_target(target); + } + + Outputs::Display::ScanStatus get_scaled_scan_status() const { + return crt_.get_scaled_scan_status(); + } + private: + Outputs::CRT::CRT crt_; + bool extended_colour_mode_ = false; bool bitmap_mode_ = false; bool display_enable_ = false;