mc6845.cpp: Check if vsync should be enabled when frame is reset

Fix MT 06927
This commit is contained in:
AmatCoder 2019-03-07 16:08:14 +01:00
parent ed341b1c1b
commit 12d8a146aa
2 changed files with 28 additions and 14 deletions

View File

@ -657,6 +657,28 @@ void mc6845_device::update_upd_adr_timer()
}
bool mc6845_device::match_line()
{
/* Check if we've reached the end of active display */
if ( m_line_counter == m_vert_disp )
{
m_line_enable_ff = false;
m_current_disp_addr = m_disp_start_addr;
}
/* Check if VSYNC should be enabled */
if ( m_line_counter == m_vert_sync_pos )
{
m_vsync_width_counter = 0;
m_vsync_ff = 1;
return true;
}
return false;
}
void mc6845_device::handle_line_timer()
{
bool new_vsync = m_vsync;
@ -696,22 +718,9 @@ void mc6845_device::handle_line_timer()
m_line_counter = ( m_line_counter + 1 ) & 0x7F;
m_line_address = ( m_line_address + m_horiz_disp ) & 0x3fff;
/* Check if we've reached the end of active display */
if ( m_line_counter == m_vert_disp )
{
m_line_enable_ff = false;
m_current_disp_addr = m_disp_start_addr;
}
/* Check if VSYNC should be enabled */
if ( m_line_counter == m_vert_sync_pos )
{
m_vsync_width_counter = 0;
m_vsync_ff = 1;
if (match_line())
new_vsync = true;
}
}
else
{
// For rudimentary 'interlace and video' support, m_raster_counter increments by 1 rather than the correct 2.
@ -729,6 +738,10 @@ void mc6845_device::handle_line_timer()
m_line_counter = 0;
m_line_address = m_disp_start_addr;
m_line_enable_ff = true;
if (match_line())
new_vsync = true;
/* also update the cursor state now */
update_cursor_state();

View File

@ -211,6 +211,7 @@ protected:
void set_hsync(int state);
void set_vsync(int state);
void set_cur(int state);
bool match_line();
void handle_line_timer();
virtual void update_cursor_state();
virtual uint8_t draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect);