Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

am9513.cpp: more logging for LOG_MODE and LOG_TC #13406

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/devices/machine/am9513.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ void am9513_device::set_counter_mode(int c, u16 data)
}

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))
{
Expand Down Expand Up @@ -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]));
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -1270,20 +1284,23 @@ 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)
LOGMASKED(LOG_MODE, "FOUT: Gate %s\n", BIT(data, 3) ? "Off" : "On");
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
case 0xf2: // Step counter 2
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
Expand Down
Loading