diff options
author | cracyc <cracyc@users.noreply.github.com> | 2021-05-26 21:17:09 -0500 |
---|---|---|
committer | cracyc <cracyc@users.noreply.github.com> | 2021-05-26 21:17:09 -0500 |
commit | 3ade0ad948b40e2d613aa456d22ba24d2cdeda9f (patch) | |
tree | 0d63984bba10714e43af2faabdec5b842cad49fc | |
parent | 37e85b45187c09ba790e983e960e4f155ffdeebc (diff) |
x68k_crtc: fix visarea
-rw-r--r-- | src/mame/video/x68k_crtc.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/mame/video/x68k_crtc.cpp b/src/mame/video/x68k_crtc.cpp index 685f9b141e4..b3dd9bb62fb 100644 --- a/src/mame/video/x68k_crtc.cpp +++ b/src/mame/video/x68k_crtc.cpp @@ -175,19 +175,9 @@ void x68k_crtc_device::refresh_mode() scr.max_x = m_hend + 2; rectangle visiblescr(m_hbegin, m_hend, m_vbegin, m_vend); - // expand visible area to the size indicated by CRTC reg 20 - int length = m_hend - m_hbegin; - if (length < m_width) - { - visiblescr.min_x = m_hbegin - ((m_width - length)/2); - visiblescr.max_x = m_hend + ((m_width - length)/2); - } - length = m_vend - m_vbegin; - if (length < m_height) - { - visiblescr.min_y = m_vbegin - ((m_height - length)/2); - visiblescr.max_y = m_vend + ((m_height - length)/2); - } + if ((visiblescr.max_y > m_height) || (visiblescr.max_x > m_width)) + logerror("visarea larger then reg[20]: %dx%d, %dx%d", visiblescr.max_x, visiblescr.max_y, m_width, m_height); + // bounds check if (visiblescr.min_x < 0) visiblescr.min_x = 0; |