mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-10 12:29:01 +00:00
Reduces code duplication slightly.
This commit is contained in:
parent
388b136980
commit
6482303063
@ -103,36 +103,14 @@ template <VideoTiming timing> class Video {
|
|||||||
if(line < 3) {
|
if(line < 3) {
|
||||||
// Output sync line.
|
// Output sync line.
|
||||||
crt_.output_sync(cycles_this_line);
|
crt_.output_sync(cycles_this_line);
|
||||||
} else if((line < first_line) || (line >= first_line+192)) {
|
} else {
|
||||||
|
if((line < first_line) || (line >= first_line+192)) {
|
||||||
// Output plain border line.
|
// Output plain border line.
|
||||||
if(offset < sync_position) {
|
if(offset < sync_position) {
|
||||||
const int border_duration = std::min(sync_position, end_offset) - offset;
|
const int border_duration = std::min(sync_position, end_offset) - offset;
|
||||||
output_border(border_duration);
|
output_border(border_duration);
|
||||||
offset += border_duration;
|
offset += border_duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(offset >= sync_position && offset < sync_position + sync_length && end_offset > offset) {
|
|
||||||
const int sync_duration = std::min(sync_position + sync_length, end_offset) - offset;
|
|
||||||
crt_.output_sync(sync_duration);
|
|
||||||
offset += sync_duration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(offset >= sync_position + sync_length && offset < burst_position && end_offset > offset) {
|
|
||||||
const int blank_duration = std::min(burst_position, end_offset) - offset;
|
|
||||||
crt_.output_blank(blank_duration);
|
|
||||||
offset += blank_duration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(offset >= burst_position && offset < burst_position+burst_length && end_offset > offset) {
|
|
||||||
const int burst_duration = std::min(burst_position + burst_length, end_offset) - offset;
|
|
||||||
crt_.output_colour_burst(burst_duration, line, is_alternate_line_);
|
|
||||||
offset += burst_duration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(offset >= burst_position+burst_length && end_offset > offset) {
|
|
||||||
const int border_duration = end_offset - offset;
|
|
||||||
output_border(border_duration);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// Output pixel line.
|
// Output pixel line.
|
||||||
if(offset < 256) {
|
if(offset < 256) {
|
||||||
@ -187,6 +165,9 @@ template <VideoTiming timing> class Video {
|
|||||||
output_border(border_duration);
|
output_border(border_duration);
|
||||||
offset += border_duration;
|
offset += border_duration;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Output the common tail to border and pixel lines: sync, blank, colour burst, border.
|
||||||
|
|
||||||
if(offset >= sync_position && offset < sync_position + sync_length && end_offset > offset) {
|
if(offset >= sync_position && offset < sync_position + sync_length && end_offset > offset) {
|
||||||
const int sync_duration = std::min(sync_position + sync_length, end_offset) - offset;
|
const int sync_duration = std::min(sync_position + sync_length, end_offset) - offset;
|
||||||
|
Loading…
Reference in New Issue
Block a user