summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/68230pit.cpp
diff options
context:
space:
mode:
author Joakim Larsson Edstrom <joakimlarsson42@gmail.com>2017-01-11 20:04:12 +0100
committer Joakim Larsson Edstrom <joakimlarsson42@gmail.com>2017-01-12 10:44:09 +0100
commit905af3fee7b91d52e9fcd6db08ade2b8c68cae78 (patch)
treec5abf1e7d85fe1c160fee33324f840a3c3651e78 /src/devices/machine/68230pit.cpp
parent8290a9849496ade37802a2174b1e4a90c06a56e3 (diff)
Improved LOG system
Diffstat (limited to 'src/devices/machine/68230pit.cpp')
-rw-r--r--src/devices/machine/68230pit.cpp221
1 files changed, 117 insertions, 104 deletions
diff --git a/src/devices/machine/68230pit.cpp b/src/devices/machine/68230pit.cpp
index 0a12e56e43a..922e9e4c743 100644
--- a/src/devices/machine/68230pit.cpp
+++ b/src/devices/machine/68230pit.cpp
@@ -23,25 +23,34 @@
#include "68230pit.h"
-#define VERBOSE 0
-
-#define LOGPRINT(x) { do { if (VERBOSE) logerror x; } while (0); }
-#define LOG(x) {} LOGPRINT(x)
-#define LOGR(x) {} LOGPRINT(x)
-#define LOGBIT(x) {} LOGPRINT(x)
-#define LOGDR(x) {} LOGPRINT(x)
-#define LOGINT(x) {} LOGPRINT(x)
-#define LOGSETUP(x) {} LOGPRINT(x)
-#if VERBOSE > 1
+#define LOG_GENERAL 0x01
+#define LOG_SETUP 0x02
+#define LOG_PRINTF 0x04
+#define LOG_READ 0x08
+#define LOG_BIT 0x10
+#define LOG_DR 0x20
+#define LOG_INT 0x40
+
+#define VERBOSE 0 // (LOG_PRINTF | LOG_SETUP | LOG_GENERAL | LOG_INT | LOG_BIT | LOG_DR)
+
+#define LOGMASK(mask, ...) do { if (VERBOSE & mask) logerror(__VA_ARGS__); } while (0)
+#define LOGLEVEL(mask, level, ...) do { if ((VERBOSE & mask) >= level) logerror(__VA_ARGS__); } while (0)
+
+#define LOG(...) LOGMASK(LOG_GENERAL, __VA_ARGS__)
+#define LOGSETUP(...) LOGMASK(LOG_SETUP, __VA_ARGS__)
+#define LOGR(...) LOGMASK(LOG_READ, __VA_ARGS__)
+#define LOGBIT(...) LOGMASK(LOG_BIT, __VA_ARGS__)
+#define LOGDR(...) LOGMASK(LOG_DR, __VA_ARGS__)
+#define LOGINT(...) LOGMASK(LOG_INT, __VA_ARGS__)
+
+#if VERBOSE & LOG_PRINTF
#define logerror printf
#endif
#ifdef _MSC_VER
#define FUNCNAME __func__
-#define LLFORMAT "%I64%"
#else
#define FUNCNAME __PRETTY_FUNCTION__
-#define LLFORMAT "%lld"
#endif
//**************************************************************************
@@ -133,7 +142,7 @@ pit68230_device::pit68230_device(const machine_config &mconfig, const char *tag,
//-------------------------------------------------
void pit68230_device::device_start ()
{
- LOG(("%s\n", FUNCNAME));
+ LOG("%s\n", FUNCNAME);
// resolve callbacks
m_pa_out_cb.resolve_safe();
@@ -177,7 +186,7 @@ void pit68230_device::device_start ()
//-------------------------------------------------
void pit68230_device::device_reset ()
{
- LOG(("%s %s \n",tag(), FUNCNAME));
+ LOG("%s %s \n",tag(), FUNCNAME);
m_pgcr = 0;
m_psrr = 0;
@@ -201,7 +210,7 @@ void pit68230_device::device_reset ()
*/
uint8_t pit68230_device::irq_piack()
{
- LOGINT(("%s %s <- %02x\n",tag(), FUNCNAME, m_pivr));
+ LOGINT("%s %s <- %02x\n",tag(), FUNCNAME, m_pivr);
return m_pivr;
}
@@ -210,7 +219,7 @@ uint8_t pit68230_device::irq_piack()
*/
uint8_t pit68230_device::irq_tiack()
{
- LOGINT(("%s %s <- %02x\n",tag(), FUNCNAME, m_tivr));
+ LOGINT("%s %s <- %02x\n",tag(), FUNCNAME, m_tivr);
return m_tivr;
}
@@ -220,7 +229,7 @@ uint8_t pit68230_device::irq_tiack()
*/
void pit68230_device::trigger_interrupt(int source)
{
- LOGINT(("%s %s Source: %02x\n",tag(), FUNCNAME, source));
+ LOGINT("%s %s Source: %02x\n",tag(), FUNCNAME, source);
if (source == INT_TIMER)
{
@@ -244,7 +253,7 @@ void pit68230_device::tick_clock()
{
if (m_cntr-- == 0) // Zero detect
{
- LOGINT(("Timer reached zero!\n"));
+ LOGINT("Timer reached zero!\n");
if ((m_tcr & REG_TCR_ZD) == 0)
m_cntr = m_cpr;
else // mask off to 24 bit on rollover
@@ -266,7 +275,7 @@ void pit68230_device::device_timer (emu_timer &timer, device_timer_id id, int32_
tick_clock();
break;
default:
- LOG(("Unhandled Timer ID %d\n", id));
+ LOG("Unhandled Timer ID %d\n", id);
break;
}
}
@@ -284,11 +293,11 @@ void pit68230_device::portb_setbit(uint8_t bit, uint8_t state)
void pit68230_device::pa_update_bit(uint8_t bit, uint8_t state)
{
- LOGBIT(("%s %s bit %d to %d\n",tag(), FUNCNAME, bit, state));
+ LOGBIT("%s %s bit %d to %d\n",tag(), FUNCNAME, bit, state);
// Check if requested bit is an output bit and can't be affected
if (m_paddr & (1 << bit))
{
- LOG(("- 68230 PIT: tried to set input bit at port A that is programmed as output!\n"));
+ LOG("- 68230 PIT: tried to set input bit at port A that is programmed as output!\n");
return;
}
if (state)
@@ -305,11 +314,11 @@ void pit68230_device::pa_update_bit(uint8_t bit, uint8_t state)
void pit68230_device::pb_update_bit(uint8_t bit, uint8_t state)
{
- LOGBIT(("%s %s bit %d to %d\n",tag(), FUNCNAME, bit, state));
+ LOGBIT("%s %s bit %d to %d\n",tag(), FUNCNAME, bit, state);
// Check if requested bit is an output bit and can't be affected
if (m_pbddr & (1 << bit))
{
- LOG(("- 68230 PIT: tried to set input bit at port B that is programmed as output!\n"));
+ LOG("- 68230 PIT: tried to set input bit at port B that is programmed as output!\n");
return;
}
if (state)
@@ -327,11 +336,11 @@ void pit68230_device::pb_update_bit(uint8_t bit, uint8_t state)
// TODO: Make sure port C is in the right alternate mode
void pit68230_device::pc_update_bit(uint8_t bit, uint8_t state)
{
- LOGBIT(("%s %s bit %d to %d\n",tag(), FUNCNAME, bit, state));
+ LOGBIT("%s %s bit %d to %d\n",tag(), FUNCNAME, bit, state);
// Check if requested bit is an output bit and can't be affected
if (m_pcddr & (1 << bit))
{
- LOG(("- 68230 PIT: tried to set input bit at port C that is programmed as output!\n"));
+ LOG("- 68230 PIT: tried to set input bit at port C that is programmed as output!\n");
return;
}
if (state)
@@ -365,53 +374,55 @@ static int32_t ow_ofs = 0;
void pit68230_device::wr_pitreg_pgcr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
- LOGSETUP(("PGCR - Mode %d,", (data >> 6) & 3 ));
- LOGSETUP((" H34:%s, H12:%s,", (data & 0x20) ? "enabled" : "disabled", (data & 0x10) ? "enabled" : "disabled" ));
- LOGSETUP((" Sense assert H4:%s, H3:%s, H2:%s, H1:%s\n",
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
+ LOGSETUP("PGCR - Mode %d,", (data >> 6) & 3 );
+ LOGSETUP(" H34:%s, H12:%s,", (data & 0x20) ? "enabled" : "disabled", (data & 0x10) ? "enabled" : "disabled" );
+ LOGSETUP(" Sense assert H4:%s, H3:%s, H2:%s, H1:%s\n",
data & 0x04 ? "Hi" : "Lo", data & 0x03 ? "Hi" : "Lo",
- data & 0x02 ? "Hi" : "Lo", data & 0x01 ? "Hi" : "Lo"));
+ data & 0x02 ? "Hi" : "Lo", data & 0x01 ? "Hi" : "Lo");
m_pgcr = data;
}
void pit68230_device::wr_pitreg_psrr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
- LOGSETUP(("PSSR - %s pin activated,", data & 0x40 ? "DMA" : "PC4"));
- LOGSETUP((" %s pin support %s interrupts,", data & 0x80 ? "PIRQ" : "PC5",
- data & 0x08 ? "no" : (data & 0x10 ? "vectored" : "autovectored" ) ));
- LOGSETUP((" H prio mode:%d\n", data & 0x03 ));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
+ LOGSETUP("PSSR - %s pin activated,", data & 0x40 ? "DMA" : "PC4");
+ LOGSETUP(" %s pin support %s interrupts,", data & 0x80 ? "PIRQ" : "PC5",
+ data & 0x08 ? "no" : (data & 0x10 ? "vectored" : "autovectored" ) );
+ LOGSETUP(" H prio mode:%d\n", data & 0x03 );
m_psrr = data;
}
void pit68230_device::wr_pitreg_paddr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
- LOGSETUP(("PADDR"));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
+ LOGSETUP("%s PADDR: %02x\n", tag(), data);
m_paddr = data;
}
void pit68230_device::wr_pitreg_pbddr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
+ LOGSETUP("%s PBDDR: %02x\n", tag(), data);
m_pbddr = data;
}
void pit68230_device::wr_pitreg_pcddr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
+ LOGSETUP("%s PCDDR: %02x\n", tag(), data);
m_pcddr = data;
}
void pit68230_device::wr_pitreg_pivr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": Not implemented yet\n", FUNCNAME, data, tag()));
+ LOG("%s(%02x) \"%s\": Not implemented yet\n", FUNCNAME, data, tag());
}
void pit68230_device::wr_pitreg_pacr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
+ LOGSETUP("%s PACR", tag());
m_pacr = data;
// callbacks
/*PACR in Mode 0
@@ -436,18 +447,18 @@ void pit68230_device::wr_pitreg_pacr(uint8_t data)
switch(m_pacr & REG_PACR_H2_CTRL_MASK)
{
case REG_PACR_H2_CTRL_OUT_00:
- LOG((" - H2 cleared\n"));
+ LOGSETUP(" - H2 cleared\n");
m_h2_out_cb(CLEAR_LINE);
break;
case REG_PACR_H2_CTRL_OUT_01:
- LOG((" - H2 asserted\n"));
+ LOGSETUP(" - H2 asserted\n");
m_h2_out_cb(ASSERT_LINE);
break;
case REG_PACR_H2_CTRL_OUT_10:
- LOGSETUP((" - interlocked handshake not implemented\n"));
+ LOGSETUP(" - interlocked handshake not implemented\n");
break;
case REG_PACR_H2_CTRL_OUT_11:
- LOGSETUP((" - pulsed handshake not implemented\n"));
+ LOGSETUP(" - pulsed handshake not implemented\n");
break;
default: logerror(("Undefined H2 mode, broken driver - please report!\n"));
}
@@ -455,7 +466,7 @@ void pit68230_device::wr_pitreg_pacr(uint8_t data)
}
else
{
- LOG((" - H2 cleared because being disabled in PGCR\n"));
+ LOGSETUP(" - H2 cleared because being disabled in PGCR\n");
m_h2_out_cb(CLEAR_LINE);
}
}
@@ -463,7 +474,7 @@ void pit68230_device::wr_pitreg_pacr(uint8_t data)
// TODO add support for sense status
void pit68230_device::wr_pitreg_pbcr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
m_pbcr = data;
if ((m_pgcr & REG_PGCR_H34_ENABLE) || ((m_pbcr & REG_PBCR_SUBMODE_MASK) == REG_PBCR_SUBMODE_1X))
{
@@ -472,18 +483,18 @@ void pit68230_device::wr_pitreg_pbcr(uint8_t data)
switch(m_pbcr & REG_PBCR_H4_CTRL_MASK)
{
case REG_PBCR_H4_CTRL_OUT_00:
- LOG((" - H4 cleared\n"));
+ LOG(" - H4 cleared\n");
m_h4_out_cb(CLEAR_LINE);
break;
case REG_PBCR_H4_CTRL_OUT_01:
- LOG((" - H4 asserted\n"));
+ LOG(" - H4 asserted\n");
m_h4_out_cb(ASSERT_LINE);
break;
case REG_PBCR_H4_CTRL_OUT_10:
- LOGSETUP((" - interlocked handshake not implemented\n"));
+ LOGSETUP(" - interlocked handshake not implemented\n");
break;
case REG_PBCR_H4_CTRL_OUT_11:
- LOGSETUP((" - pulsed handshake not implemented\n"));
+ LOGSETUP(" - pulsed handshake not implemented\n");
break;
default: logerror(("Undefined H4 mode, broken driver - please report!\n"));
}
@@ -491,14 +502,14 @@ void pit68230_device::wr_pitreg_pbcr(uint8_t data)
}
else
{
- LOG((" - H4 cleared because being disabled in PGCR\n"));
+ LOG(" - H4 cleared because being disabled in PGCR\n");
m_h4_out_cb(CLEAR_LINE);
}
}
void pit68230_device::wr_pitreg_padr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
m_padr = (data & m_paddr);
// callback
@@ -507,7 +518,7 @@ void pit68230_device::wr_pitreg_padr(uint8_t data)
void pit68230_device::wr_pitreg_pbdr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
m_pbdr = (data & m_pbddr);
// callback
@@ -516,7 +527,7 @@ void pit68230_device::wr_pitreg_pbdr(uint8_t data)
void pit68230_device::wr_pitreg_pcdr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
m_pcdr = (data & m_pcddr);
// callback
@@ -525,7 +536,7 @@ void pit68230_device::wr_pitreg_pcdr(uint8_t data)
void pit68230_device::wr_pitreg_psr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
m_psr = data;
}
@@ -601,43 +612,43 @@ void pit68230_device::wr_pitreg_tcr(uint8_t data)
int pen = 0;
int sqr = 0;
- LOG(("%s(%02x) %s\n", FUNCNAME, data, tag()));
+ LOG("%s(%02x) %s\n", FUNCNAME, data, tag());
m_tcr = data;
switch (m_tcr & REG_TCR_TOUT_TIACK_MASK)
{
case REG_TCR_PC3_PC7:
- case REG_TCR_PC3_PC7_DC: LOG(("- PC3 and PC7 used as I/O pins\n")); break;
+ case REG_TCR_PC3_PC7_DC: LOG("- PC3 and PC7 used as I/O pins\n"); break;
case REG_TCR_TOUT_PC7_SQ:
- case REG_TCR_TOUT_PC7_SQ_DC: LOG(("- PC3 used as SQuare wave TOUT and PC7 used as I/O pin - not implemented yet\n")); sqr = 1; break;
- case REG_TCR_TOUT_TIACK: LOG(("- PC3 used as TOUT and PC7 used as TIACK - not implemented yet\n")); tout = 1; tiack = 1; break;
- case REG_TCR_TOUT_TIACK_INT: LOG(("- PC3 used as TOUT and PC7 used as TIACK, Interrupts enabled\n")); tout = 1; tiack = 1; irq = 1; break;
- case REG_TCR_TOUT_PC7: LOG(("- PC3 used as TOUT and PC7 used as I/O pin - not implemented yet\n")); break;
- case REG_TCR_TOUT_PC7_INT: LOG(("- PC3 used as TOUT and PC7 used as I/O pin, Interrupts enabled\n")); tout = 1; irq = 1; break;
+ case REG_TCR_TOUT_PC7_SQ_DC: LOG("- PC3 used as SQuare wave TOUT and PC7 used as I/O pin - not implemented yet\n"); sqr = 1; break;
+ case REG_TCR_TOUT_TIACK: LOG("- PC3 used as TOUT and PC7 used as TIACK - not implemented yet\n"); tout = 1; tiack = 1; break;
+ case REG_TCR_TOUT_TIACK_INT: LOG("- PC3 used as TOUT and PC7 used as TIACK, Interrupts enabled\n"); tout = 1; tiack = 1; irq = 1; break;
+ case REG_TCR_TOUT_PC7: LOG("- PC3 used as TOUT and PC7 used as I/O pin - not implemented yet\n"); break;
+ case REG_TCR_TOUT_PC7_INT: LOG("- PC3 used as TOUT and PC7 used as I/O pin, Interrupts enabled\n"); tout = 1; irq = 1; break;
}
switch (m_tcr & REG_TCR_CC_MASK)
{
- case REG_TCR_CC_PC2_CLK_PSC: LOG(("- PC2 used as I/O pin,CLK and x32 prescaler are used\n")); clk = 1; psc = 1; break;
- case REG_TCR_CC_TEN_CLK_PSC: LOG(("- PC2 used as Timer enable/disable, CLK and presacaler are used - not implemented\n")); pen = 1; clk = 1; psc = 1; break;
- case REG_TCR_CC_TIN_PSC: LOG(("- PC2 used as Timer clock and the presacaler is used - not implemented\n")); psc = 1; break;
- case REG_TCR_CC_TIN_RAW: LOG(("- PC2 used as Timer clock and the presacaler is NOT used\n")); break;
+ case REG_TCR_CC_PC2_CLK_PSC: LOG("- PC2 used as I/O pin,CLK and x32 prescaler are used\n"); clk = 1; psc = 1; break;
+ case REG_TCR_CC_TEN_CLK_PSC: LOG("- PC2 used as Timer enable/disable, CLK and presacaler are used - not implemented\n"); pen = 1; clk = 1; psc = 1; break;
+ case REG_TCR_CC_TIN_PSC: LOG("- PC2 used as Timer clock and the presacaler is used - not implemented\n"); psc = 1; break;
+ case REG_TCR_CC_TIN_RAW: LOG("- PC2 used as Timer clock and the presacaler is NOT used\n"); break;
}
- LOG(("%s", m_tcr & REG_TCR_ZR ? "- Spec violation, should always be 0!\n" : ""));
- LOG(("- Timer %s when reaching 0 (zero)\n", m_tcr & REG_TCR_ZD ? "rolls over" : "reload the preload values"));
- LOG(("- Timer is %s\n", m_tcr & REG_TCR_ENABLE ? "enabled" : "disabled"));
+ LOG("%s", m_tcr & REG_TCR_ZR ? "- Spec violation, should always be 0!\n" : "");
+ LOG("- Timer %s when reaching 0 (zero)\n", m_tcr & REG_TCR_ZD ? "rolls over" : "reload the preload values");
+ LOG("- Timer is %s\n", m_tcr & REG_TCR_ENABLE ? "enabled" : "disabled");
if (m_tcr & REG_TCR_ENABLE)
{
m_cntr = 0;
if (pen == 1)
{
- LOG(("PC2 enable/disable TBD\n"));
+ LOG("PC2 enable/disable TBD\n");
}
if (clk == 1)
{
int rate = clock() / (psc == 1 ? 32 : 1);
pit_timer->adjust(attotime::from_hz(rate), TIMER_ID_PIT, attotime::from_hz(rate));
- LOG(("PIT timer started @ rate: %d and CLK: %d,\n", rate, clock()));
+ LOG("PIT timer started @ rate: %d and CLK: %d,\n", rate, clock());
}
}
else
@@ -649,34 +660,34 @@ void pit68230_device::wr_pitreg_tcr(uint8_t data)
void pit68230_device::wr_pitreg_tivr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": \n", FUNCNAME, data, tag()));
+ LOG("%s(%02x) \"%s\": \n", FUNCNAME, data, tag());
m_tivr = data;
}
void pit68230_device::wr_pitreg_cprh(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
m_cpr &= ~0xff0000;
m_cpr |= ((data << 16) & 0xff0000);
}
void pit68230_device::wr_pitreg_cprm(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
m_cpr &= ~0x00ff00;
m_cpr |= ((data << 8) & 0x00ff00);
}
void pit68230_device::wr_pitreg_cprl(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data));
+ LOG("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data);
m_cpr &= ~0x0000ff;
m_cpr |= ((data << 0) & 0x0000ff);
}
void pit68230_device::wr_pitreg_tsr(uint8_t data)
{
- LOG(("%s(%02x) \"%s\": \n", FUNCNAME, data, tag()));
+ LOG("%s(%02x) \"%s\": \n", FUNCNAME, data, tag());
if (data & 1)
{
m_tsr = 0; // A write resets the TSR;
@@ -686,8 +697,8 @@ void pit68230_device::wr_pitreg_tsr(uint8_t data)
WRITE8_MEMBER (pit68230_device::write)
{
- LOG(("\"%s\" %s: Register write '%02x' -> [%02x]\n", tag(), FUNCNAME, data, offset ));
- LOGSETUP((" * %s Reg %02x <- %02x \n", tag(), offset, data));
+ LOG("\"%s\" %s: Register write '%02x' -> [%02x]\n", tag(), FUNCNAME, data, offset );
+ LOGSETUP(" * %s Reg %02x <- %02x \n", tag(), offset, data);
switch (offset) {
case PIT_68230_PGCR: wr_pitreg_pgcr(data); break;
case PIT_68230_PSRR: wr_pitreg_psrr(data); break;
@@ -713,7 +724,7 @@ WRITE8_MEMBER (pit68230_device::write)
case PIT_68230_CNTRL: break; // Ignores write per spec, read only register
case PIT_68230_TSR: wr_pitreg_tsr(data); break;
default:
- LOG (("Unhandled Write of %02x to register %02x", data, offset));
+ LOG("Unhandled Write of %02x to register %02x", data, offset);
}
#if VERBOSE > 2
@@ -741,49 +752,49 @@ static int32_t or_ofs = 0;
uint8_t pit68230_device::rr_pitreg_pgcr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pgcr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_pgcr);
return m_pgcr;
}
uint8_t pit68230_device::rr_pitreg_psrr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_psrr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_psrr);
return m_psrr & 0x7f; // mask out unused bits
}
uint8_t pit68230_device::rr_pitreg_paddr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_paddr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_paddr);
return m_paddr;
}
uint8_t pit68230_device::rr_pitreg_pbddr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pbddr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_pbddr);
return m_pbddr;
}
uint8_t pit68230_device::rr_pitreg_pcddr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pcddr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_pcddr);
return m_pcddr;
}
uint8_t pit68230_device::rr_pitreg_pivr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pivr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_pivr);
return m_pivr;
}
uint8_t pit68230_device::rr_pitreg_pacr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pacr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_pacr);
return m_pacr;
}
uint8_t pit68230_device::rr_pitreg_pbcr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pbcr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_pbcr);
return m_pbcr;
}
@@ -798,7 +809,7 @@ uint8_t pit68230_device::rr_pitreg_padr()
{
m_padr |= (m_pail & ~m_paddr);
}
- LOGDR(("%s %s <- %02x\n",tag(), FUNCNAME, m_padr));
+ LOGDR("%s %s <- %02x\n",tag(), FUNCNAME, m_padr);
return m_padr;
}
@@ -821,7 +832,8 @@ uint8_t pit68230_device::rr_pitreg_pbdr()
m_pbdr |= (m_pbil & ~m_pbddr);
}
- //LOGDR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pbdr));
+ LOGDR("%s %s <- %02x\n",tag(), FUNCNAME, m_pbdr);
+
return m_pbdr;
}
@@ -838,6 +850,7 @@ uint8_t pit68230_device::rr_pitreg_pcdr()
}
if (m_pcdr != 0) { LOGDR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pcdr)); }
+
return m_pcdr;
}
@@ -850,7 +863,7 @@ uint8_t pit68230_device::rr_pitreg_paar()
// NOTE: no side effect emulated so using ..padr
uint8_t ret;
ret = m_pa_in_cb();
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, ret));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, ret);
return ret;
}
@@ -863,7 +876,7 @@ uint8_t pit68230_device::rr_pitreg_pbar()
// NOTE: no side effect emulated so using ..pbdr
uint8_t ret;
ret = m_pb_in_cb();
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, ret));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, ret);
return ret;
}
@@ -875,61 +888,61 @@ uint8_t pit68230_device::rr_pitreg_pbar()
* 3-0 a one is the active or asserted state. */
uint8_t pit68230_device::rr_pitreg_psr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_psr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_psr);
return m_psr;
}
uint8_t pit68230_device::rr_pitreg_tcr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_tcr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_tcr);
return m_tcr;
}
uint8_t pit68230_device::rr_pitreg_tivr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_tivr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_tivr);
return m_tivr;
}
uint8_t pit68230_device::rr_pitreg_cprh()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 16) & 0xff));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 16) & 0xff);
return (m_cpr >> 16) & 0xff;
}
uint8_t pit68230_device::rr_pitreg_cprm()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 8) & 0xff));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 8) & 0xff);
return (m_cpr >> 8) & 0xff;
}
uint8_t pit68230_device::rr_pitreg_cprl()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 0) & 0xff));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 0) & 0xff);
return (m_cpr >> 0) & 0xff;
}
uint8_t pit68230_device::rr_pitreg_cntrh()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 16) & 0xff));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 16) & 0xff);
return (m_cntr >> 16) & 0xff;
}
uint8_t pit68230_device::rr_pitreg_cntrm()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 8) & 0xff));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 8) & 0xff);
return (m_cntr >> 8) & 0xff;
}
uint8_t pit68230_device::rr_pitreg_cntrl()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 0) & 0xff));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 0) & 0xff);
return (m_cntr >> 0) & 0xff;
}
uint8_t pit68230_device::rr_pitreg_tsr()
{
- LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_tsr));
+ LOGR("%s %s <- %02x\n",tag(), FUNCNAME, m_tsr);
return m_tsr;
}
@@ -961,13 +974,13 @@ READ8_MEMBER (pit68230_device::read){
case PIT_68230_CNTRL: data = rr_pitreg_cntrl(); break;
case PIT_68230_TSR: data = rr_pitreg_tsr(); break;
default:
- LOG (("Unhandled read register %02x returning 0x00\n", offset));
+ LOG("Unhandled read register %02x returning 0x00\n", offset);
data = 0;
}
#if VERBOSE > 2
if (offset != or_ofs || data != or_data || or_cnt >= 1000) {
- LOGSETUP((" * %s Reg %02x -> %02x \n", tag(), offset, data));
+ LOGSETUP(" * %s Reg %02x -> %02x \n", tag(), offset, data);
if (or_cnt > 1)
{
logerror ("\npit68230_device::read: previous identical operation performed %02x times\n", or_cnt);