diff options
| author | 2017-09-22 10:59:41 -0400 | |
|---|---|---|
| committer | 2017-09-22 10:59:52 -0400 | |
| commit | 90d52a80ebe9f0b8dd1b5a85a1e70188f57dc5b7 (patch) | |
| tree | e464dff5b7b7dcb65abd618b2198b4cae2af1fe6 /src | |
| parent | 165da5efa4d52b550ff224b1f207a8baa0fa1ab6 (diff) | |
am9513: Fix load command (nw)
Diffstat (limited to 'src')
| -rw-r--r-- | src/devices/machine/am9513.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/devices/machine/am9513.cpp b/src/devices/machine/am9513.cpp index 1432c879ca9..3b9dbd8f1d4 100644 --- a/src/devices/machine/am9513.cpp +++ b/src/devices/machine/am9513.cpp @@ -710,10 +710,10 @@ void am9513_device::step_counter(int c, bool force_load) if (m_count[c] == 0) { - LOGMASKED(LOG_TC, "Counter %d: Terminal count\n", c + 1); set_tc(c, true); m_count[c] = reload_from_hold(c) ? m_counter_hold[c] : m_counter_load[c]; m_alternate_count[c] = !m_alternate_count[c]; + LOGMASKED(LOG_TC, "Counter %d: Terminal count (%u reloaded)\n", c + 1, m_count[c]); // Modes A, B, C, N & O: disarm counter after counting to TC once if ((m_counter_mode[c] & 0x0060) == 0x0000) @@ -728,16 +728,20 @@ void am9513_device::step_counter(int c, bool force_load) if ((m_counter_mode[c] & 0xc000) == 0xc000 && ((m_counter_mode[c] & 0x00c0) != 0x0040 || !m_alternate_count[c])) m_counter_running[c] = false; } - else if (m_tc[c]) + else { - set_tc(c, false); + // Drive counter out of TC + if (m_tc[c]) + set_tc(c, false); + + // Load if requested if (force_load) + { m_count[c] = reload_from_hold(c) ? m_counter_hold[c] : m_counter_load[c]; + LOGMASKED(LOG_GENERAL, "Counter %d: %u loaded\n", c + 1, m_count[c]); + } } - if (force_load) - LOGMASKED(LOG_GENERAL, "Counter %d: %u loaded\n", c + 1, m_count[c]); - // Active comparators if (c < 2 && BIT(m_mmr, c + 2)) { @@ -777,14 +781,14 @@ void am9513_device::gate_count(int c, bool state) if (counter_is_mode_x(c)) m_counter_hold[c] = m_count[c]; - // Modes N, O, Q, R: hardware retriggering + // Modes N, O, Q & R: hardware retriggering if ((m_counter_mode[c] & 0x00c0) == 0x0080) { m_counter_hold[c] = m_count[c]; m_count[c] = m_counter_load[c]; } - // Modes C, F, I, L, O, R, X: start count on active gate edge + // Modes C, F, I, L, O, R & X: start count on active gate edge if ((m_counter_mode[c] & 0xc000) == 0xc000) m_counter_running[c] = true; } |
