1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-01 13:58:20 +00:00

Adds a CRT. Not yet clocked.

This commit is contained in:
Thomas Harte 2021-03-18 21:54:42 -04:00
parent ab2ad70885
commit f2620e6afb
2 changed files with 22 additions and 4 deletions

View File

@ -9,7 +9,7 @@
#ifndef Video_hpp
#define Video_hpp
#include "../../../Outputs/CRT/CRT.hpp"
#include "../../../ClockReceiver/ClockReceiver.hpp"
namespace Sinclair {
@ -86,6 +86,14 @@ template <VideoTiming timing> class Video {
static constexpr int interrupt_duration = 48;
public:
Video() :
crt_(227 * 2, 1, Outputs::Display::Type::PAL50, Outputs::Display::InputDataType::Red2Green2Blue2)
{
// Show only the centre 80% of the TV frame.
crt_.set_display_type(Outputs::Display::DisplayType::RGB);
crt_.set_visible_area(Outputs::Display::Rect(0.1f, 0.1f, 0.8f, 0.8f));
}
HalfCycles get_next_sequence_point() {
if(time_since_interrupt_ < interrupt_duration) {
@ -114,8 +122,19 @@ template <VideoTiming timing> class Video {
return timings.delays[line_position & 7];
}
/// Sets the scan target.
void set_scan_target(Outputs::Display::ScanTarget *scan_target) {
crt_.set_scan_target(scan_target);
}
/// Gets the current scan status.
Outputs::Display::ScanStatus get_scaled_scan_status() const {
return crt_.get_scaled_scan_status();
}
private:
int time_since_interrupt_ = 0;
Outputs::CRT::CRT crt_;
};
}

View File

@ -90,12 +90,11 @@ template<Model model> class ConcreteMachine:
// MARK: - ScanProducer
void set_scan_target(Outputs::Display::ScanTarget *scan_target) final {
(void)scan_target;
video_->set_scan_target(scan_target);
}
Outputs::Display::ScanStatus get_scaled_scan_status() const final {
// TODO.
return Outputs::Display::ScanStatus();
return video_->get_scaled_scan_status();
}
// MARK: - BusHandler