summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio/cmi01a.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/audio/cmi01a.cpp')
-rw-r--r--src/mame/audio/cmi01a.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mame/audio/cmi01a.cpp b/src/mame/audio/cmi01a.cpp
index 0ec40b75a69..2f733ed72f7 100644
--- a/src/mame/audio/cmi01a.cpp
+++ b/src/mame/audio/cmi01a.cpp
@@ -10,6 +10,9 @@
#include "audio/cmi01a.h"
#include "machine/input_merger.h"
+#define VERBOSE (0)
+#include "logmacro.h"
+
#define MASTER_OSCILLATOR XTAL(34'291'712)
@@ -179,7 +182,7 @@ void cmi01a_device::zx_timer_cb()
if (m_zx_flag == 0)
{
/* Low to high transition - clock flip flop */
- int op = m_ptm_o1;
+ int op = m_ptm->get_output_state(0);
/* Set /ZCINT */
if (op != m_zx_ff)
@@ -255,8 +258,6 @@ WRITE_LINE_MEMBER( cmi01a_device::pia_0_cb2_w )
m_ptm->set_g2(1);
m_ptm->set_g3(1);
- //printf("Stop %d\n", m_channel);
-
m_zx_timer->adjust(attotime::never);
m_active = false;
m_zx_flag = 0; // TEST
@@ -306,7 +307,7 @@ READ_LINE_MEMBER( cmi01a_device::zx_r )
void cmi01a_device::write(offs_t offset, uint8_t data)
{
- //printf("C%d W: %02x = %02x\n", m_channel, offset, data);
+ LOG("%s: channel card %d write: %02x = %02x\n", machine().describe_context(), m_channel, offset, data);
switch (offset)
{
@@ -346,7 +347,7 @@ void cmi01a_device::write(offs_t offset, uint8_t data)
{
/* PTM addressing is a little funky */
int a0 = offset & 1;
- int a1 = (m_ptm_o1 && BIT(offset, 3)) || (!BIT(offset, 3) && BIT(offset, 2));
+ int a1 = (m_ptm->get_output_state(0) && BIT(offset, 3)) || (!BIT(offset, 3) && BIT(offset, 2));
int a2 = BIT(offset, 1);
//printf("CH%d PTM W: [%x] = %02x\n", m_channel, (a2 << 2) | (a1 << 1) | a0, data);
@@ -355,7 +356,7 @@ void cmi01a_device::write(offs_t offset, uint8_t data)
}
default:
- logerror("Unknown channel card write to E0%02X = %02X\n", offset, data);
+ LOG("%s: Unknown channel card write to E0%02X = %02X\n", machine().describe_context(), offset, data);
break;
}
}
@@ -402,7 +403,7 @@ uint8_t cmi01a_device::read(offs_t offset)
case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
{
int a0 = offset & 1;
- int a1 = (m_ptm_o1 && BIT(offset, 3)) || (!BIT(offset, 3) && BIT(offset, 2));
+ int a1 = ((m_ptm_o1 && BIT(offset, 3)) || (!BIT(offset, 3) && BIT(offset, 2))) ? 1 : 0;
int a2 = BIT(offset, 1);
data = m_ptm->read((a2 << 2) | (a1 << 1) | a0);
@@ -412,11 +413,11 @@ uint8_t cmi01a_device::read(offs_t offset)
}
default:
- logerror("Unknown channel card read from E0%02X\n", offset);
+ LOG("%s: Unknown channel card %d read from E0%02X\n", machine().describe_context(), m_channel, offset);
break;
}
- //printf("C%d R: %02x = %02x\n", m_channel, offset, data);
+ LOG("%s: channel card %d read: %02x = %02x\n", machine().describe_context(), m_channel, offset, data);
return data;
}