2019-05-04 03:25:42 +00:00
|
|
|
//
|
|
|
|
// 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"
|
2019-05-05 02:27:58 +00:00
|
|
|
#include "../../../ClockReceiver/ClockReceiver.hpp"
|
2019-06-01 19:03:15 +00:00
|
|
|
#include "DeferredAudio.hpp"
|
2019-06-01 23:31:32 +00:00
|
|
|
#include "DriveSpeedAccumulator.hpp"
|
2019-05-04 03:25:42 +00:00
|
|
|
|
|
|
|
namespace Apple {
|
|
|
|
namespace Macintosh {
|
|
|
|
|
|
|
|
class Video {
|
|
|
|
public:
|
2019-06-01 23:31:32 +00:00
|
|
|
Video(uint16_t *ram, DeferredAudio &audio, DriveSpeedAccumulator &drive_speed_accumulator);
|
2019-05-04 03:25:42 +00:00
|
|
|
void set_scan_target(Outputs::Display::ScanTarget *scan_target);
|
2019-05-05 02:27:58 +00:00
|
|
|
void run_for(HalfCycles duration);
|
2019-06-01 19:03:15 +00:00
|
|
|
|
|
|
|
void set_use_alternate_buffers(bool use_alternate_screen_buffer, bool use_alternate_audio_buffer);
|
2019-05-05 02:27:58 +00:00
|
|
|
|
|
|
|
// TODO: feedback on blanks and syncs.
|
2019-05-08 20:54:19 +00:00
|
|
|
bool vsync();
|
|
|
|
bool is_outputting();
|
2019-05-04 03:25:42 +00:00
|
|
|
|
2019-06-03 18:50:36 +00:00
|
|
|
void set_ram_mask(uint32_t);
|
|
|
|
|
2019-05-04 03:25:42 +00:00
|
|
|
private:
|
2019-06-01 19:03:15 +00:00
|
|
|
DeferredAudio &audio_;
|
2019-06-01 23:31:32 +00:00
|
|
|
DriveSpeedAccumulator &drive_speed_accumulator_;
|
2019-06-01 19:03:15 +00:00
|
|
|
|
2019-05-04 03:25:42 +00:00
|
|
|
Outputs::CRT::CRT crt_;
|
2019-06-01 23:31:32 +00:00
|
|
|
uint16_t *ram_ = nullptr;
|
2019-06-03 18:50:36 +00:00
|
|
|
uint32_t ram_mask_ = 0;
|
2019-05-05 02:27:58 +00:00
|
|
|
|
|
|
|
HalfCycles frame_position_;
|
2019-06-01 19:03:15 +00:00
|
|
|
|
2019-05-08 18:54:54 +00:00
|
|
|
size_t video_address_ = 0;
|
2019-06-01 19:03:15 +00:00
|
|
|
size_t audio_address_ = 0;
|
|
|
|
|
2019-05-08 18:54:54 +00:00
|
|
|
uint8_t *pixel_buffer_ = nullptr;
|
2019-06-01 19:03:15 +00:00
|
|
|
|
2019-05-06 03:05:24 +00:00
|
|
|
bool use_alternate_screen_buffer_ = false;
|
2019-06-01 19:03:15 +00:00
|
|
|
bool use_alternate_audio_buffer_ = false;
|
2019-05-04 03:25:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Video_hpp */
|