summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2019-03-08 16:12:05 -0500
committer GitHub <noreply@github.com>2019-03-08 16:12:05 -0500
commit5978a133fdb49a10bd2a7bff324c71c05a22e10e (patch)
tree4c4c9c6dcd8d4e47e174af17d29496bf0dad3ba1
parentd4843a7b57aadcb20f12e9393b04ee4605941e8b (diff)
parent12d8a146aa09ba3a2540bc190bc133095aaf74c1 (diff)
Merge pull request #4730 from AmatCoder/AmatCoder-mc6845-2
mc6845.cpp: Check if vsync should be enabled when frame is reset
-rw-r--r--src/devices/video/mc6845.cpp41
-rw-r--r--src/devices/video/mc6845.h1
2 files changed, 28 insertions, 14 deletions
diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp
index 1e9f7fe7b66..7cec011be11 100644
--- a/src/devices/video/mc6845.cpp
+++ b/src/devices/video/mc6845.cpp
@@ -659,6 +659,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;
@@ -698,21 +720,8 @@ 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
{
@@ -731,6 +740,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();
diff --git a/src/devices/video/mc6845.h b/src/devices/video/mc6845.h
index 0fa337789e0..1bb0683ee85 100644
--- a/src/devices/video/mc6845.h
+++ b/src/devices/video/mc6845.h
@@ -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);