mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Reinstitute cursor.
This commit is contained in:
parent
60987ae4a7
commit
2d90868f5c
@ -193,9 +193,8 @@ template <class BusHandlerT, Personality personality, CursorType cursor_type> cl
|
|||||||
|
|
||||||
|
|
||||||
// Do bus work.
|
// Do bus work.
|
||||||
// bus_state_.cursor = is_cursor_line_ &&
|
bus_state_.cursor = is_cursor_line_ &&
|
||||||
// bus_state_.refresh_address == layout_.cursor_address;
|
bus_state_.refresh_address == layout_.cursor_address;
|
||||||
|
|
||||||
bus_state_.display_enable = character_is_visible_ && line_is_visible_;
|
bus_state_.display_enable = character_is_visible_ && line_is_visible_;
|
||||||
|
|
||||||
// TODO: considate the two below.
|
// TODO: considate the two below.
|
||||||
@ -203,16 +202,18 @@ template <class BusHandlerT, Personality personality, CursorType cursor_type> cl
|
|||||||
perform_bus_cycle_phase2();
|
perform_bus_cycle_phase2();
|
||||||
|
|
||||||
//
|
//
|
||||||
const bool character_total_hit = character_counter_ == layout_.horizontal.total;
|
// Shared, stateless signals.
|
||||||
const uint8_t lines_per_row = layout_.interlace_mode_ == InterlaceMode::InterlaceSyncAndVideo ? layout_.vertical.end_row & ~1 : layout_.vertical.end_row;
|
//
|
||||||
const bool row_end_hit = bus_state_.row_address == lines_per_row && !is_in_adjustment_period_;
|
const bool character_total_hit = character_counter_ == layout_.horizontal.total;
|
||||||
const bool new_frame =
|
const uint8_t lines_per_row = layout_.interlace_mode_ == InterlaceMode::InterlaceSyncAndVideo ? layout_.vertical.end_row & ~1 : layout_.vertical.end_row;
|
||||||
character_total_hit && eof_latched_ &&
|
const bool row_end_hit = bus_state_.row_address == lines_per_row && !is_in_adjustment_period_;
|
||||||
(
|
const bool new_frame =
|
||||||
layout_.interlace_mode_ == InterlaceMode::Off ||
|
character_total_hit && eof_latched_ &&
|
||||||
!(bus_state_.field_count&1) ||
|
(
|
||||||
extra_scanline_
|
layout_.interlace_mode_ == InterlaceMode::Off ||
|
||||||
);
|
!(bus_state_.field_count&1) ||
|
||||||
|
extra_scanline_
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Horizontal.
|
// Horizontal.
|
||||||
@ -319,6 +320,29 @@ template <class BusHandlerT, Personality personality, CursorType cursor_type> cl
|
|||||||
odd_field_ ^= true;
|
odd_field_ ^= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Cursor.
|
||||||
|
if constexpr (cursor_type != CursorType::None) {
|
||||||
|
// Check for cursor enable.
|
||||||
|
is_cursor_line_ |= bus_state_.row_address == layout_.vertical.start_cursor;
|
||||||
|
is_cursor_line_ &= bus_state_.row_address != layout_.vertical.end_cursor;
|
||||||
|
|
||||||
|
switch(cursor_type) {
|
||||||
|
// MDA-style blinking.
|
||||||
|
// https://retrocomputing.stackexchange.com/questions/27803/what-are-the-blinking-rates-of-the-caret-and-of-blinking-text-on-pc-graphics-car
|
||||||
|
// gives an 8/8 pattern for regular blinking though mode 11 is then just a guess.
|
||||||
|
case CursorType::MDA:
|
||||||
|
switch(layout_.cursor_flags) {
|
||||||
|
case 0b11: is_cursor_line_ &= (bus_state_.field_count & 8) < 3; break;
|
||||||
|
case 0b00: is_cursor_line_ &= bool(bus_state_.field_count & 8); break;
|
||||||
|
case 0b01: is_cursor_line_ = false; break;
|
||||||
|
case 0b10: is_cursor_line_ = true; break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Addressing.
|
// Addressing.
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user