1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-16 22:28:57 +00:00
CLK/Machines/Apple/Macintosh/Video.hpp
Thomas Harte 41740fb45e Implements video position feedback.
At a substantial performance cost for now, but I'll worry about that once things are working.
2019-05-08 16:54:19 -04:00

43 lines
857 B
C++

//
// Video.hpp
// Clock Signal
//
// Created by Thomas Harte on 03/05/2019.
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#ifndef Video_hpp
#define Video_hpp
#include "../../../Outputs/CRT/CRT.hpp"
#include "../../../ClockReceiver/ClockReceiver.hpp"
namespace Apple {
namespace Macintosh {
class Video {
public:
Video(uint16_t *ram);
void set_scan_target(Outputs::Display::ScanTarget *scan_target);
void run_for(HalfCycles duration);
void set_use_alternate_screen_buffer(bool use_alternate_screen_buffer);
// TODO: feedback on blanks and syncs.
bool vsync();
bool is_outputting();
private:
Outputs::CRT::CRT crt_;
HalfCycles frame_position_;
size_t video_address_ = 0;
uint16_t *ram_ = nullptr;
uint8_t *pixel_buffer_ = nullptr;
bool use_alternate_screen_buffer_ = false;
};
}
}
#endif /* Video_hpp */