From 912a1c1b9d5307cf13dc075ea57708546624eaa2 Mon Sep 17 00:00:00 2001 From: 68bit Date: Wed, 28 Aug 2019 10:23:16 +1000 Subject: [PATCH] MC6845: correct cursor. The MC6845 shows a full cursor if the cursor end raster address is greater than the maximum raster address, restore that case in general. The issue on the BBC, that uses the HD6845S, might be the use of the maximum raster address here, it appears to be programmed differently on the HD6845S and also to depend on the interlaced mode. This patch fixes the BBC while preserving the cursor emulation for the MC6845. --- src/devices/video/mc6845.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp index ec61201648e..fabf80b639e 100644 --- a/src/devices/video/mc6845.cpp +++ b/src/devices/video/mc6845.cpp @@ -705,8 +705,9 @@ bool mc6845_device::check_cursor_visible(uint16_t ra, uint16_t line_addr) } uint16_t cursor_start_ras = m_cursor_start_ras & 0x1f; + uint16_t max_ras_addr = m_max_ras_addr + (MODE_INTERLACE_AND_VIDEO ? m_interlace_adjust : m_noninterlace_adjust); - if (cursor_start_ras > m_max_ras_addr) + if (cursor_start_ras > max_ras_addr) { // No cursor possible. return false; @@ -714,6 +715,11 @@ bool mc6845_device::check_cursor_visible(uint16_t ra, uint16_t line_addr) if (cursor_start_ras <= m_cursor_end_ras) { + if (m_cursor_end_ras > max_ras_addr) + { + // Full cursor. + return true; + } // Cursor from start to end inclusive. return (ra >= cursor_start_ras) && (ra <= m_cursor_end_ras); }