summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/am9513.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/am9513.cpp')
-rw-r--r--src/devices/machine/am9513.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/devices/machine/am9513.cpp b/src/devices/machine/am9513.cpp
index 1960bac555d..5baf568ca3b 100644
--- a/src/devices/machine/am9513.cpp
+++ b/src/devices/machine/am9513.cpp
@@ -27,7 +27,7 @@
**********************************************************************/
#include "emu.h"
-#include "machine/am9513.h"
+#include "am9513.h"
#define LOG_MODE (1U << 1)
#define LOG_INPUT (1U << 2)
@@ -442,13 +442,13 @@ void am9513_device::set_counter_mode(int c, u16 data)
else if (source >= 6 && source <= 10)
LOGMASKED(LOG_MODE, "Counter %d: Count on %s edge of GATE %d\n", c + 1, BIT(data, 12) ? "falling" : "rising", source - 5);
else if (source == 0)
- LOGMASKED(LOG_MODE, "Counter %d: Count on %s edge of TC%d\n", c + 1, BIT(data, 12) ? "falling" : "rising", c - 1);
+ LOGMASKED(LOG_MODE, "Counter %d: Count on %s edge of TC%d\n", c + 1, BIT(data, 12) ? "falling" : "rising", c);
else
LOGMASKED(LOG_MODE, "Counter %d: Count on %s edge of SRC %d\n", c + 1, BIT(data, 12) ? "falling" : "rising", source);
}
if ((data & 0x0018) != (m_counter_mode[c] & 0x0018))
- LOGMASKED(LOG_MODE, "Counter %d: %s %s count\n", c + 1, BIT(data, 4) ? "BCD" : "Binary", BIT(data, 3) ? "up" : "down");
+ LOGMASKED(LOG_MODE, "Counter %d: %s %s count %s\n", c + 1, BIT(data, 4) ? "BCD" : "Binary", BIT(data, 3) ? "up" : "down", BIT(data, 5) ? "repetitively" : "once");
if ((data & 0x0007) != (m_counter_mode[c] & 0x0007))
{
@@ -620,8 +620,13 @@ void am9513_device::set_tc(int c, bool state)
// TC cascading
if ((m_counter_mode[d] & 0x1f00) == (state ? 0x0000 : 0x1000))
+ {
+ LOGMASKED(LOG_TC, "Counter %d: TC cascade Next Count %u \n", c + 1, m_count[d]);
+
count_edge(d);
+ }
+
// TC gating
if ((m_counter_mode[d] & 0xe000) == 0x2000)
gate_count(d, state && (bus_is_16_bit() || m_gate_alt[d]));
@@ -1238,7 +1243,10 @@ void am9513_device::command_write(u8 data)
if (BIT(data, 6))
step_counter(c, true);
if (BIT(data, 5))
+ {
+ LOGMASKED(LOG_MODE, "Arm Counter %d\n", c + 1);
arm_counter(c);
+ }
}
}
break;
@@ -1251,9 +1259,15 @@ void am9513_device::command_write(u8 data)
if (BIT(data, c))
{
if (!BIT(data, 5))
+ {
+ LOGMASKED(LOG_MODE, "Disarm Counter %d\n", c + 1);
disarm_counter(c);
+ }
if (!BIT(data, 6))
+ {
+ LOGMASKED(LOG_MODE, "Save Counter %d\n", c + 1);
save_counter(c);
+ }
}
}
break;
@@ -1270,6 +1284,7 @@ void am9513_device::command_write(u8 data)
case 0xe3: case 0xeb: // Clear/set toggle out for counter 3
case 0xe4: case 0xec: // Clear/set toggle out for counter 4
case 0xe5: case 0xed: // Clear/set toggle out for counter 5
+ LOGMASKED(LOG_MODE, "Counter %d: %s output\n", data & 7, BIT(data, 3) ? "Set" : "Clear");
set_toggle((data & 7) - 1, BIT(data, 3));
break;
case 0xe6: case 0xee: // Clear/set MM12 (FOUT gate on/FOUT gate off)
@@ -1277,6 +1292,7 @@ void am9513_device::command_write(u8 data)
m_mmr = ((m_mmr & ~(1 << 12)) | BIT(data, 3) << 12);
break;
case 0xe7: case 0xef: // Clear/set MM13 (8-bit bus/16-bit bus)
+ LOGMASKED(LOG_MODE, "Data Bus Width = %d-Bit\n", BIT(data, 3) ? 16 : 8);
m_mmr = ((m_mmr & ~(1 << 13)) | BIT(data, 3) << 13);
break;
case 0xf1: // Step counter 1
@@ -1284,6 +1300,7 @@ void am9513_device::command_write(u8 data)
case 0xf3: // Step counter 3
case 0xf4: // Step counter 4
case 0xf5: // Step counter 5
+ LOGMASKED(LOG_MODE, "Counter %d: Step\n", data & 7);
step_counter((data & 7) - 1, false);
break;
case 0xff: // Master reset