2019-10-05 01:34:15 +00:00
|
|
|
//
|
|
|
|
// Video.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 04/10/2019.
|
|
|
|
// Copyright © 2019 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2019-10-09 01:18:08 +00:00
|
|
|
#ifndef Atari_ST_Video_hpp
|
|
|
|
#define Atari_ST_Video_hpp
|
2019-10-05 01:34:15 +00:00
|
|
|
|
|
|
|
#include "../../Outputs/CRT/CRT.hpp"
|
|
|
|
#include "../../ClockReceiver/ClockReceiver.hpp"
|
|
|
|
|
|
|
|
namespace Atari {
|
|
|
|
namespace ST {
|
|
|
|
|
|
|
|
class Video {
|
|
|
|
public:
|
|
|
|
Video();
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Sets the target device for video data.
|
|
|
|
*/
|
|
|
|
void set_scan_target(Outputs::Display::ScanTarget *scan_target);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Produces the next @c duration period of pixels.
|
|
|
|
*/
|
|
|
|
void run_for(HalfCycles duration);
|
|
|
|
|
2019-10-09 01:18:08 +00:00
|
|
|
/*!
|
|
|
|
@returns the number of cycles until there is next a change in the hsync,
|
|
|
|
vsync or display_enable outputs.
|
|
|
|
*/
|
|
|
|
HalfCycles get_next_sequence_point();
|
|
|
|
|
|
|
|
bool hsync();
|
|
|
|
bool vsync();
|
|
|
|
bool display_enabled();
|
|
|
|
|
2019-10-11 02:46:58 +00:00
|
|
|
void set_ram(uint16_t *);
|
|
|
|
|
2019-10-10 03:01:11 +00:00
|
|
|
uint8_t read(int address);
|
2019-10-11 03:29:46 +00:00
|
|
|
void write(int address, uint16_t value);
|
2019-10-10 03:01:11 +00:00
|
|
|
|
2019-10-05 01:34:15 +00:00
|
|
|
private:
|
|
|
|
Outputs::CRT::CRT crt_;
|
2019-10-09 01:18:08 +00:00
|
|
|
|
2019-10-10 03:01:11 +00:00
|
|
|
uint16_t palette_[16];
|
2019-10-11 02:46:58 +00:00
|
|
|
int base_address_ = 0;
|
|
|
|
int current_address_ = 0;
|
|
|
|
|
|
|
|
uint16_t *ram_;
|
|
|
|
uint16_t line_buffer_[256];
|
|
|
|
uint16_t *pixel_pointer_;
|
2019-10-10 03:01:11 +00:00
|
|
|
|
2019-10-09 01:18:08 +00:00
|
|
|
int x = 0, y = 0;
|
|
|
|
void output_border(int duration);
|
2019-10-05 01:34:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-09 01:18:08 +00:00
|
|
|
#endif /* Atari_ST_Video_hpp */
|