mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-27 00:30:26 +00:00
Adds a CRT. Not yet clocked.
This commit is contained in:
parent
ab2ad70885
commit
f2620e6afb
@ -9,7 +9,7 @@
|
|||||||
#ifndef Video_hpp
|
#ifndef Video_hpp
|
||||||
#define Video_hpp
|
#define Video_hpp
|
||||||
|
|
||||||
|
#include "../../../Outputs/CRT/CRT.hpp"
|
||||||
#include "../../../ClockReceiver/ClockReceiver.hpp"
|
#include "../../../ClockReceiver/ClockReceiver.hpp"
|
||||||
|
|
||||||
namespace Sinclair {
|
namespace Sinclair {
|
||||||
@ -86,6 +86,14 @@ template <VideoTiming timing> class Video {
|
|||||||
static constexpr int interrupt_duration = 48;
|
static constexpr int interrupt_duration = 48;
|
||||||
|
|
||||||
public:
|
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() {
|
HalfCycles get_next_sequence_point() {
|
||||||
if(time_since_interrupt_ < interrupt_duration) {
|
if(time_since_interrupt_ < interrupt_duration) {
|
||||||
@ -114,8 +122,19 @@ template <VideoTiming timing> class Video {
|
|||||||
return timings.delays[line_position & 7];
|
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:
|
private:
|
||||||
int time_since_interrupt_ = 0;
|
int time_since_interrupt_ = 0;
|
||||||
|
Outputs::CRT::CRT crt_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -90,12 +90,11 @@ template<Model model> class ConcreteMachine:
|
|||||||
// MARK: - ScanProducer
|
// MARK: - ScanProducer
|
||||||
|
|
||||||
void set_scan_target(Outputs::Display::ScanTarget *scan_target) final {
|
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 {
|
Outputs::Display::ScanStatus get_scaled_scan_status() const final {
|
||||||
// TODO.
|
return video_->get_scaled_scan_status();
|
||||||
return Outputs::Display::ScanStatus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - BusHandler
|
// MARK: - BusHandler
|
||||||
|
Loading…
x
Reference in New Issue
Block a user