From d100c6a1effd23f607e259457ca760a22c5ca33b Mon Sep 17 00:00:00 2001 From: 68bit Date: Thu, 25 Jul 2019 22:51:12 +1000 Subject: mc6846 - fix the timer modes. The bit definitions for the timer modes were backwards. --- src/devices/machine/mc6846.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/devices/machine/mc6846.cpp b/src/devices/machine/mc6846.cpp index 75c76b8d283..31e562fd849 100644 --- a/src/devices/machine/mc6846.cpp +++ b/src/devices/machine/mc6846.cpp @@ -199,12 +199,12 @@ inline void mc6846_device::timer_launch() m_cto = 0; break; - case 0x20: /* single-shot */ - m_cto = 0; - m_one_shot->reset(clocks_to_attotime(FACTOR)); + case 0x20: /* cascaded single-shot */ break; - case 0x30: /* cascaded single-shot */ + case 0x30: /* single-shot */ + m_cto = 0; + m_one_shot->reset(clocks_to_attotime(FACTOR)); break; default: @@ -245,12 +245,12 @@ TIMER_CALLBACK_MEMBER( mc6846_device::timer_expire ) m_cto = 1 ^ m_cto; break; - case 0x20: /* single-shot */ - m_cto = 0; + case 0x20: /* cascaded single-shot */ + m_cto = ( m_tcr & 0x80 ) ? 1 : 0; break; - case 0x30: /* cascaded single-shot */ - m_cto = ( m_tcr & 0x80 ) ? 1 : 0; + case 0x30: /* single-shot */ + m_cto = 0; break; default: @@ -439,14 +439,14 @@ WRITE8_MEMBER(mc6846_device::write) { static const char *const mode[8] = { - "continuous", "cascaded", "continuous", "one-shot", - "freq-cmp", "freq-cmp", "pulse-cmp", "pulse-cmp" + "continuous", "freq-cmp", "continuous", "pulse-cmp", + "cascaded", "freq-cmp", "one-shot", "pulse-cmp" }; LOG( "%s %f: mc6846 TCR write $%02X reset=%i clock=%s scale=%i mode=%s out=%s\n", machine().describe_context(), machine().time().as_double(), data, - (data >> 7) & 1, (data & 0x40) ? "extern" : "sys", - (data & 0x40) ? 1 : 8, mode[ (data >> 1) & 7 ], - (data & 1) ? "enabled" : "0" ); + data & 1, (data & 2) ? "sys" : "extern", + (data & 4) ? 8 : 1, mode[ (data >> 3) & 7 ], + (data & 0x80) ? "enabled" : "0" ); m_tcr = data; if ( m_tcr & 1 ) @@ -454,7 +454,7 @@ WRITE8_MEMBER(mc6846_device::write) /* timer preset = initialization without launch */ m_preset = m_latch; m_csr &= ~1; - if ( MODE != 0x30 ) + if ( MODE != 0x20 ) m_cto = 0; update_cto(); m_interval->reset(); -- cgit v1.2.3