mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-23 20:29:42 +00:00
Converted the Oric's video output into a ClockReceiver
.
This commit is contained in:
parent
c2a7dffa7d
commit
6369138bd1
@ -142,7 +142,7 @@ void Machine::flush() {
|
||||
}
|
||||
|
||||
void Machine::update_video() {
|
||||
video_output_->run_for_cycles(cycles_since_video_update_);
|
||||
video_output_->run_for(Cycles(cycles_since_video_update_));
|
||||
cycles_since_video_update_ = 0;
|
||||
}
|
||||
|
||||
|
@ -74,13 +74,14 @@ std::shared_ptr<Outputs::CRT::CRT> VideoOutput::get_crt() {
|
||||
return crt_;
|
||||
}
|
||||
|
||||
void VideoOutput::run_for_cycles(int number_of_cycles) {
|
||||
void VideoOutput::run_for(const Cycles &cycles) {
|
||||
// Vertical: 0–39: pixels; otherwise blank; 48–53 sync, 54–56 colour burst
|
||||
// Horizontal: 0–223: pixels; otherwise blank; 256–259 sync
|
||||
|
||||
#define clamp(action) \
|
||||
if(cycles_run_for <= number_of_cycles) { action; } else cycles_run_for = number_of_cycles;
|
||||
|
||||
int number_of_cycles = int(cycles);
|
||||
while(number_of_cycles) {
|
||||
int h_counter = counter_ & 63;
|
||||
int cycles_run_for = 0;
|
||||
|
@ -10,14 +10,15 @@
|
||||
#define Machines_Oric_Video_hpp
|
||||
|
||||
#include "../../Outputs/CRT/CRT.hpp"
|
||||
#include "../../Components/ClockReceiver.hpp"
|
||||
|
||||
namespace Oric {
|
||||
|
||||
class VideoOutput {
|
||||
class VideoOutput: public ClockReceiver<VideoOutput> {
|
||||
public:
|
||||
VideoOutput(uint8_t *memory);
|
||||
std::shared_ptr<Outputs::CRT::CRT> get_crt();
|
||||
void run_for_cycles(int number_of_cycles);
|
||||
void run_for(const Cycles &cycles);
|
||||
void set_colour_rom(const std::vector<uint8_t> &rom);
|
||||
void set_output_device(Outputs::CRT::OutputDevice output_device);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user