mirror of
https://github.com/holub/mame
synced 2025-06-29 23:48:56 +03:00
Revert "6821: improved logging"
This reverts commit 6ec6ee3cb7
.
Sorry, but re-adding the tag to the logging like this is not an
improvement. It adds clutter when using logerror as intended, with the
debugger log window or with the -oslog option sending it to stderr.
This commit is contained in:
parent
b312de92a3
commit
dfbe49136f
@ -17,8 +17,7 @@
|
|||||||
#define LOG_SETUP 0x02
|
#define LOG_SETUP 0x02
|
||||||
#define LOG_CA1 0x08
|
#define LOG_CA1 0x08
|
||||||
|
|
||||||
//#define VERBOSE (LOG_SETUP )
|
//#define VERBOSE (LOG_SETUP | LOG_GENERAL)
|
||||||
//#define LOG_OUTPUT_STREAM std::cout
|
|
||||||
|
|
||||||
#include "logmacro.h"
|
#include "logmacro.h"
|
||||||
#define LOGSETUP(...) LOGMASKED(LOG_SETUP, __VA_ARGS__)
|
#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;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -431,7 +430,7 @@ uint8_t pia6821_device::ddr_a_r()
|
|||||||
{
|
{
|
||||||
uint8_t ret = m_ddr_a;
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -459,7 +458,7 @@ uint8_t pia6821_device::port_b_r()
|
|||||||
m_irq_b2 = false;
|
m_irq_b2 = false;
|
||||||
update_interrupts();
|
update_interrupts();
|
||||||
|
|
||||||
LOG("%s PIA port B read = %02X\n", tag(), ret);
|
LOG("PIA port B read = %02X\n", ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -473,7 +472,7 @@ uint8_t pia6821_device::ddr_b_r()
|
|||||||
{
|
{
|
||||||
uint8_t ret = m_ddr_b;
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -522,7 +521,7 @@ uint8_t pia6821_device::control_a_r()
|
|||||||
ret |= PIA_IRQ2;
|
ret |= PIA_IRQ2;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG("%s PIA control A read = %02X\n", tag(), ret);
|
LOG("PIA control A read = %02X\n", ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -567,7 +566,7 @@ uint8_t pia6821_device::control_b_r()
|
|||||||
ret |= PIA_IRQ2;
|
ret |= PIA_IRQ2;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG("%s PIA control B read = %02X\n", tag(), ret);
|
LOG("PIA control B read = %02X\n", ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -629,7 +628,7 @@ void pia6821_device::send_to_out_a_func(const char* message)
|
|||||||
// input pins are pulled high
|
// input pins are pulled high
|
||||||
uint8_t data = get_out_a_value();
|
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())
|
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
|
// input pins are high-impedance - we just send them as zeros for backwards compatibility
|
||||||
uint8_t data = get_out_b_value();
|
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())
|
if(!m_out_b_handler.isnull())
|
||||||
{
|
{
|
||||||
@ -695,15 +694,15 @@ void pia6821_device::ddr_a_w(uint8_t data)
|
|||||||
{
|
{
|
||||||
if(data == 0x00)
|
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)
|
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
|
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)
|
if(m_ddr_a != data)
|
||||||
@ -750,15 +749,15 @@ void pia6821_device::ddr_b_w(uint8_t data)
|
|||||||
{
|
{
|
||||||
if (data == 0x00)
|
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)
|
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
|
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)
|
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
|
// bit 7 and 6 are read only
|
||||||
data &= 0x3f;
|
data &= 0x3f;
|
||||||
|
|
||||||
LOGSETUP("%s PIA control A write = %02X\n", tag(), data);
|
LOGSETUP("PIA control A write = %02X\n", data);
|
||||||
|
|
||||||
// update the control register
|
// update the control register
|
||||||
m_ctl_a = data;
|
m_ctl_a = data;
|
||||||
@ -820,7 +819,7 @@ void pia6821_device::control_b_w(uint8_t data)
|
|||||||
// bit 7 and 6 are read only
|
// bit 7 and 6 are read only
|
||||||
data &= 0x3f;
|
data &= 0x3f;
|
||||||
|
|
||||||
LOGSETUP("%s PIA control B write = %02X\n", tag(), data);
|
LOGSETUP("PIA control B write = %02X\n", data);
|
||||||
|
|
||||||
// update the control register
|
// update the control register
|
||||||
m_ctl_b = data;
|
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");
|
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_in_a = data;
|
||||||
m_port_a_z_mask = z_mask;
|
m_port_a_z_mask = z_mask;
|
||||||
@ -929,12 +928,12 @@ uint8_t pia6821_device::a_output()
|
|||||||
|
|
||||||
WRITE_LINE_MEMBER( pia6821_device::ca1_w )
|
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
|
// 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))))
|
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
|
// mark the IRQ
|
||||||
m_irq_a1 = true;
|
m_irq_a1 = true;
|
||||||
@ -961,12 +960,12 @@ WRITE_LINE_MEMBER( pia6821_device::ca1_w )
|
|||||||
|
|
||||||
WRITE_LINE_MEMBER( pia6821_device::ca2_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 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))))
|
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
|
// mark the IRQ
|
||||||
m_irq_a2 = true;
|
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");
|
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 = data;
|
||||||
m_in_b_pushed = true;
|
m_in_b_pushed = true;
|
||||||
@ -1041,12 +1040,12 @@ uint8_t pia6821_device::b_output()
|
|||||||
|
|
||||||
WRITE_LINE_MEMBER( pia6821_device::cb1_w )
|
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
|
// 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))))
|
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
|
// mark the IRQ
|
||||||
m_irq_b1 = 1;
|
m_irq_b1 = 1;
|
||||||
@ -1072,14 +1071,14 @@ WRITE_LINE_MEMBER( pia6821_device::cb1_w )
|
|||||||
|
|
||||||
WRITE_LINE_MEMBER( pia6821_device::cb2_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 input mode and the new state has caused a transition
|
||||||
if (c2_input(m_ctl_b) &&
|
if (c2_input(m_ctl_b) &&
|
||||||
(m_in_cb2 != state) &&
|
(m_in_cb2 != state) &&
|
||||||
((state && c2_low_to_high(m_ctl_b)) || (!state && c2_high_to_low(m_ctl_b))))
|
((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
|
// mark the IRQ
|
||||||
m_irq_b2 = 1;
|
m_irq_b2 = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user