summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/x68k_crtc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/x68k_crtc.cpp')
-rw-r--r--src/mame/video/x68k_crtc.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/mame/video/x68k_crtc.cpp b/src/mame/video/x68k_crtc.cpp
index 5fa05e74499..a5f0131da62 100644
--- a/src/mame/video/x68k_crtc.cpp
+++ b/src/mame/video/x68k_crtc.cpp
@@ -186,11 +186,29 @@ void x68k_crtc_device::refresh_mode()
// LOG("CRTC regs - %i %i %i %i - %i %i %i %i - %i - %i\n", m_reg[0], m_reg[1], m_reg[2], m_reg[3],
// m_reg[4], m_reg[5], m_reg[6], m_reg[7], m_reg[8], m_reg[9]);
- unsigned div = (m_reg[20] & 0x03) == 0 ? 4 : 2;
- if (BIT(m_reg[20], 4) && !BIT(m_reg[20], 1))
- div = BIT(m_reg[20], 0) ? 3 : 6;
- if (!(m_reg[20] & 0x1f))
- div = 8;
+ int div;
+ switch (m_reg[20] & 0x1f)
+ {
+ case 0:
+ div = 8;
+ break;
+ default:
+ logerror("Invalid mode %d", m_reg[20] & 0x1f); [[fallthrough]];
+ case 1:
+ case 5:
+ div = 4;
+ break;
+ case 0x16:
+ div = 2;
+ break;
+ case 0x10:
+ div = 6;
+ break;
+ case 0x11:
+ case 0x15:
+ div = 3;
+ break;
+ }
attotime refresh = attotime::from_hz((BIT(m_reg[20], 4) ? clock_69m() : clock_39m()) / div) * (scr.max_x * scr.max_y);
LOG("screen().configure(%i,%i,[%i,%i,%i,%i],%f)\n", scr.max_x, scr.max_y, visiblescr.min_x, visiblescr.min_y, visiblescr.max_x, visiblescr.max_y, refresh.as_hz());
screen().configure(scr.max_x, scr.max_y, visiblescr, refresh.as_attoseconds());