mc6846 - fix the timer modes.

The bit definitions for the timer modes were backwards.
This commit is contained in:
68bit 2019-07-25 22:51:12 +10:00
parent db0110d12b
commit d100c6a1ef

View File

@ -199,12 +199,12 @@ inline void mc6846_device::timer_launch()
m_cto = 0; m_cto = 0;
break; break;
case 0x20: /* single-shot */ case 0x20: /* cascaded single-shot */
m_cto = 0;
m_one_shot->reset(clocks_to_attotime(FACTOR));
break; break;
case 0x30: /* cascaded single-shot */ case 0x30: /* single-shot */
m_cto = 0;
m_one_shot->reset(clocks_to_attotime(FACTOR));
break; break;
default: default:
@ -245,12 +245,12 @@ TIMER_CALLBACK_MEMBER( mc6846_device::timer_expire )
m_cto = 1 ^ m_cto; m_cto = 1 ^ m_cto;
break; break;
case 0x20: /* single-shot */ case 0x20: /* cascaded single-shot */
m_cto = 0; m_cto = ( m_tcr & 0x80 ) ? 1 : 0;
break; break;
case 0x30: /* cascaded single-shot */ case 0x30: /* single-shot */
m_cto = ( m_tcr & 0x80 ) ? 1 : 0; m_cto = 0;
break; break;
default: default:
@ -439,14 +439,14 @@ WRITE8_MEMBER(mc6846_device::write)
{ {
static const char *const mode[8] = static const char *const mode[8] =
{ {
"continuous", "cascaded", "continuous", "one-shot", "continuous", "freq-cmp", "continuous", "pulse-cmp",
"freq-cmp", "freq-cmp", "pulse-cmp", "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", 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, machine().describe_context(), machine().time().as_double(), data,
(data >> 7) & 1, (data & 0x40) ? "extern" : "sys", data & 1, (data & 2) ? "sys" : "extern",
(data & 0x40) ? 1 : 8, mode[ (data >> 1) & 7 ], (data & 4) ? 8 : 1, mode[ (data >> 3) & 7 ],
(data & 1) ? "enabled" : "0" ); (data & 0x80) ? "enabled" : "0" );
m_tcr = data; m_tcr = data;
if ( m_tcr & 1 ) if ( m_tcr & 1 )
@ -454,7 +454,7 @@ WRITE8_MEMBER(mc6846_device::write)
/* timer preset = initialization without launch */ /* timer preset = initialization without launch */
m_preset = m_latch; m_preset = m_latch;
m_csr &= ~1; m_csr &= ~1;
if ( MODE != 0x30 ) if ( MODE != 0x20 )
m_cto = 0; m_cto = 0;
update_cto(); update_cto();
m_interval->reset(); m_interval->reset();