summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/6821pia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/6821pia.cpp')
-rw-r--r--src/devices/machine/6821pia.cpp55
1 files changed, 27 insertions, 28 deletions
diff --git a/src/devices/machine/6821pia.cpp b/src/devices/machine/6821pia.cpp
index d2c9b183c9f..9d3167506d3 100644
--- a/src/devices/machine/6821pia.cpp
+++ b/src/devices/machine/6821pia.cpp
@@ -17,8 +17,7 @@
#define LOG_SETUP 0x02
#define LOG_CA1 0x08
-//#define VERBOSE (LOG_SETUP )
-//#define LOG_OUTPUT_STREAM std::cout
+//#define VERBOSE (LOG_SETUP | LOG_GENERAL)
#include "logmacro.h"
#define LOGSETUP(...) LOGMASKED(LOG_SETUP, __VA_ARGS__)
@@ -417,7 +416,7 @@ uint8_t pia6821_device::port_a_r()
}
}
- LOG("%s PIA port A read = %02X\n", tag(), ret);
+ LOG("PIA port A read = %02X\n", ret);
return ret;
}
@@ -431,7 +430,7 @@ uint8_t pia6821_device::ddr_a_r()
{
uint8_t ret = m_ddr_a;
- LOG("%s PIA DDR A read = %02X\n", tag(), ret);
+ LOG("PIA DDR A read = %02X\n", ret);
return ret;
}
@@ -459,7 +458,7 @@ uint8_t pia6821_device::port_b_r()
m_irq_b2 = false;
update_interrupts();
- LOG("%s PIA port B read = %02X\n", tag(), ret);
+ LOG("PIA port B read = %02X\n", ret);
return ret;
}
@@ -473,7 +472,7 @@ uint8_t pia6821_device::ddr_b_r()
{
uint8_t ret = m_ddr_b;
- LOG("%s PIA DDR B read = %02X\n", tag(), ret);
+ LOG("PIA DDR B read = %02X\n", ret);
return ret;
}
@@ -522,7 +521,7 @@ uint8_t pia6821_device::control_a_r()
ret |= PIA_IRQ2;
}
- LOG("%s PIA control A read = %02X\n", tag(), ret);
+ LOG("PIA control A read = %02X\n", ret);
return ret;
}
@@ -567,7 +566,7 @@ uint8_t pia6821_device::control_b_r()
ret |= PIA_IRQ2;
}
- LOG("%s PIA control B read = %02X\n", tag(), ret);
+ LOG("PIA control B read = %02X\n", ret);
return ret;
}
@@ -629,7 +628,7 @@ void pia6821_device::send_to_out_a_func(const char* message)
// input pins are pulled high
uint8_t data = get_out_a_value();
- LOG("%s PIA %s = %02X\n", tag(), message, data);
+ LOG("PIA %s = %02X\n", message, data);
if(!m_out_a_handler.isnull())
{
@@ -656,7 +655,7 @@ void pia6821_device::send_to_out_b_func(const char* message)
// input pins are high-impedance - we just send them as zeros for backwards compatibility
uint8_t data = get_out_b_value();
- LOG("%s PIA %s = %02X\n", tag(), message, data);
+ LOG("PIA %s = %02X\n", message, data);
if(!m_out_b_handler.isnull())
{
@@ -695,15 +694,15 @@ void pia6821_device::ddr_a_w(uint8_t data)
{
if(data == 0x00)
{
- LOGSETUP("%s PIA DDR A write = %02X (input mode)\n", tag(), data);
+ LOGSETUP("PIA DDR A write = %02X (input mode)\n", data);
}
else if(data == 0xff)
{
- LOGSETUP("%s PIA DDR A write = %02X (output mode)\n", tag(), data);
+ LOGSETUP("PIA DDR A write = %02X (output mode)\n", data);
}
else
{
- LOGSETUP("%s PIA DDR A write = %02X (mixed mode)\n", tag(), data);
+ LOGSETUP("PIA DDR A write = %02X (mixed mode)\n", data);
}
if(m_ddr_a != data)
@@ -750,15 +749,15 @@ void pia6821_device::ddr_b_w(uint8_t data)
{
if (data == 0x00)
{
- LOGSETUP("%s PIA DDR B write = %02X (input mode)\n", tag(), data);
+ LOGSETUP("PIA DDR B write = %02X (input mode)\n", data);
}
else if (data == 0xff)
{
- LOGSETUP("%s PIA DDR B write = %02X (output mode)\n", tag(), data);
+ LOGSETUP("PIA DDR B write = %02X (output mode)\n", data);
}
else
{
- LOGSETUP("%s PIA DDR B write = %02X (mixed mode)\n", tag(), data);
+ LOGSETUP("PIA DDR B write = %02X (mixed mode)\n", data);
}
if(m_ddr_b != data)
@@ -780,7 +779,7 @@ void pia6821_device::control_a_w(uint8_t data)
// bit 7 and 6 are read only
data &= 0x3f;
- LOGSETUP("%s PIA control A write = %02X\n", tag(), data);
+ LOGSETUP("PIA control A write = %02X\n", data);
// update the control register
m_ctl_a = data;
@@ -820,7 +819,7 @@ void pia6821_device::control_b_w(uint8_t data)
// bit 7 and 6 are read only
data &= 0x3f;
- LOGSETUP("%s PIA control B write = %02X\n", tag(), data);
+ LOGSETUP("PIA control B write = %02X\n", data);
// update the control register
m_ctl_b = data;
@@ -893,7 +892,7 @@ void pia6821_device::set_a_input(uint8_t data, uint8_t z_mask)
{
assert_always(m_in_a_handler.isnull(), "pia6821_porta_w() called when in_a_func implemented");
- LOG("%s Set PIA input port A = %02X\n", tag(), data);
+ LOG("Set PIA input port A = %02X\n", data);
m_in_a = data;
m_port_a_z_mask = z_mask;
@@ -929,12 +928,12 @@ uint8_t pia6821_device::a_output()
WRITE_LINE_MEMBER( pia6821_device::ca1_w )
{
- LOGCA1("%s Set PIA input CA1 = %d\n", tag(), state);
+ LOGCA1("Set PIA input CA1 = %d\n", state);
// the new state has caused a transition
if((m_in_ca1 != state) && ((state && c1_low_to_high(m_ctl_a)) || (!state && c1_high_to_low(m_ctl_a))))
{
- LOGCA1("%s CA1 triggering\n", tag());
+ LOGCA1("CA1 triggering\n");
// mark the IRQ
m_irq_a1 = true;
@@ -961,12 +960,12 @@ WRITE_LINE_MEMBER( pia6821_device::ca1_w )
WRITE_LINE_MEMBER( pia6821_device::ca2_w )
{
- LOG("%s Set PIA input CA2 = %d\n", tag(), state);
+ LOG("Set PIA input CA2 = %d\n", state);
// if input mode and the new state has caused a transition
if(c2_input(m_ctl_a) && (m_in_ca2 != state) && ((state && c2_low_to_high(m_ctl_a)) || (!state && c2_high_to_low(m_ctl_a))))
{
- LOG("%s CA2 triggering\n", tag());
+ LOG("CA2 triggering\n");
// mark the IRQ
m_irq_a2 = true;
@@ -1016,7 +1015,7 @@ void pia6821_device::portb_w(uint8_t data)
{
assert_always(m_in_b_handler.isnull(), "pia_set_input_b() called when in_b_func implemented");
- LOG("%s Set PIA input port B = %02X\n", tag(), data);
+ LOG("Set PIA input port B = %02X\n", data);
m_in_b = data;
m_in_b_pushed = true;
@@ -1041,12 +1040,12 @@ uint8_t pia6821_device::b_output()
WRITE_LINE_MEMBER( pia6821_device::cb1_w )
{
- LOG("%s Set PIA input CB1 = %d\n", tag(), state);
+ LOG("Set PIA input CB1 = %d\n", state);
// the new state has caused a transition
if((m_in_cb1 != state) && ((state && c1_low_to_high(m_ctl_b)) || (!state && c1_high_to_low(m_ctl_b))))
{
- LOG("%s CB1 triggering\n", tag());
+ LOG("CB1 triggering\n");
// mark the IRQ
m_irq_b1 = 1;
@@ -1072,14 +1071,14 @@ WRITE_LINE_MEMBER( pia6821_device::cb1_w )
WRITE_LINE_MEMBER( pia6821_device::cb2_w )
{
- LOG("%s Set PIA input CB2 = %d\n", tag(), state);
+ LOG("Set PIA input CB2 = %d\n", state);
// if input mode and the new state has caused a transition
if (c2_input(m_ctl_b) &&
(m_in_cb2 != state) &&
((state && c2_low_to_high(m_ctl_b)) || (!state && c2_high_to_low(m_ctl_b))))
{
- LOG("%s CB2 triggering\n", tag());
+ LOG("CB2 triggering\n");
// mark the IRQ
m_irq_b2 = 1;