1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Reinstitute cursor.

This commit is contained in:
Thomas Harte 2024-10-07 21:13:44 -04:00
parent 60987ae4a7
commit 2d90868f5c

View File

@ -193,15 +193,16 @@ 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.
perform_bus_cycle_phase1(); perform_bus_cycle_phase1();
perform_bus_cycle_phase2(); perform_bus_cycle_phase2();
//
// Shared, stateless signals.
// //
const bool character_total_hit = character_counter_ == layout_.horizontal.total; const bool character_total_hit = character_counter_ == layout_.horizontal.total;
const uint8_t lines_per_row = layout_.interlace_mode_ == InterlaceMode::InterlaceSyncAndVideo ? layout_.vertical.end_row & ~1 : layout_.vertical.end_row; const uint8_t lines_per_row = layout_.interlace_mode_ == InterlaceMode::InterlaceSyncAndVideo ? layout_.vertical.end_row & ~1 : layout_.vertical.end_row;
@ -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.
// //