summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/tms9900/tms9980a.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/tms9900/tms9980a.cpp')
-rw-r--r--src/devices/cpu/tms9900/tms9980a.cpp41
1 files changed, 19 insertions, 22 deletions
diff --git a/src/devices/cpu/tms9900/tms9980a.cpp b/src/devices/cpu/tms9900/tms9980a.cpp
index befeb346481..0931dde0f6e 100644
--- a/src/devices/cpu/tms9900/tms9980a.cpp
+++ b/src/devices/cpu/tms9900/tms9980a.cpp
@@ -64,21 +64,18 @@
#include "9900dasm.h"
/*
- The following defines can be set to 0 or 1 to disable or enable certain
- output in the log.
+ Logging (also see tms9900.cpp)
*/
-// Memory operation
-#define TRACE_MEM 0
+#define LOG_OP (1U<<1) // Current instruction
+#define LOG_MEM (1U<<6) // Memory access
+#define LOG_INT (1U<<8) // Interrupts
+#define LOG_ADDRESSBUS (1U<<11) // Address bus operation
-// Address bus operation
-#define TRACE_ADDRESSBUS 0
+// Minimum log should be warnings
+#define VERBOSE ( LOG_GENERAL )
-// Log operation
-#define TRACE_OP 0
-
-// Interrupts
-#define TRACE_INT 0
+#include "logmacro.h"
/****************************************************************************
Constructor
@@ -168,7 +165,7 @@ void tms9980a_device::execute_set_input(int irqline, int state)
// Clear all interrupts
m_load_state = false;
m_irq_state = false;
- if (TRACE_INT) logerror("tms9980a: clear interrupts\n");
+ LOGMASKED(LOG_INT, "Clear interrupts\n");
break;
}
@@ -183,7 +180,7 @@ void tms9980a_device::execute_set_input(int irqline, int state)
m_load_state = true;
}
else m_irq_state = true;
- if (TRACE_INT) logerror("tms9980a: interrupt level=%d, ST=%04x\n", m_irq_level, ST);
+ LOGMASKED(LOG_INT, "Interrupt level=%d, ST=%04x\n", m_irq_level, ST);
}
}
@@ -203,25 +200,25 @@ void tms9980a_device::mem_read()
if (!m_dbin_line.isnull()) m_dbin_line(ASSERT_LINE);
if (m_setaddr)
m_setaddr->write_word(ASSERT_LINE, m_address & m_prgaddr_mask & ~1);
- if (TRACE_ADDRESSBUS) logerror("tms9980a: set address bus %04x\n", m_address & m_prgaddr_mask & ~1);
+ LOGMASKED(LOG_ADDRESSBUS, "Set address bus %04x\n", m_address & m_prgaddr_mask & ~1);
m_check_ready = true;
break;
case 2:
// Sample the value on the data bus (high byte)
value = m_prgspace->read_byte(m_address & m_prgaddr_mask & ~1);
- if (TRACE_MEM) logerror("tms9980a: memory read high byte %04x -> %02x\n", m_address & m_prgaddr_mask & ~1, value);
+ LOGMASKED(LOG_MEM, "Memory read high byte %04x -> %02x\n", m_address & m_prgaddr_mask & ~1, value);
m_current_value = (value << 8) & 0xff00;
break;
case 3:
if (m_setaddr)
m_setaddr->write_word(ASSERT_LINE, (m_address & m_prgaddr_mask) | 1);
- if (TRACE_ADDRESSBUS) logerror("tms9980a: set address bus %04x\n", (m_address & m_prgaddr_mask) | 1);
+ LOGMASKED(LOG_ADDRESSBUS, "Set address bus %04x\n", (m_address & m_prgaddr_mask) | 1);
break;
case 4:
// Sample the value on the data bus (low byte)
value = m_prgspace->read_byte((m_address & m_prgaddr_mask) | 1);
m_current_value = m_current_value | (value & 0x00ff);
- if (TRACE_MEM) logerror("tms9980a: memory read low byte %04x -> %02x -> complete word %04x\n", (m_address & m_prgaddr_mask) | 1, value, m_current_value);
+ LOGMASKED(LOG_MEM, "Memory read low byte %04x -> %02x -> complete word %04x\n", (m_address & m_prgaddr_mask) | 1, value, m_current_value);
break;
}
pulse_clock(1);
@@ -238,9 +235,9 @@ void tms9980a_device::mem_write()
if (!m_dbin_line.isnull()) m_dbin_line(CLEAR_LINE);
if (m_setaddr)
m_setaddr->write_word(CLEAR_LINE, m_address & m_prgaddr_mask & ~1);
- if (TRACE_ADDRESSBUS) logerror("tms9980a: set address bus %04x\n", m_address & m_prgaddr_mask & ~1);
+ LOGMASKED(LOG_ADDRESSBUS, "Set address bus %04x\n", m_address & m_prgaddr_mask & ~1);
m_prgspace->write_byte(m_address & 0x3ffe & ~1, (m_current_value >> 8)&0xff);
- if (TRACE_MEM) logerror("tms9980a: memory write high byte %04x <- %02x\n", m_address & m_prgaddr_mask & ~1, (m_current_value >> 8)&0xff);
+ LOGMASKED(LOG_MEM, "Memory write high byte %04x <- %02x\n", m_address & m_prgaddr_mask & ~1, (m_current_value >> 8)&0xff);
m_check_ready = true;
break;
case 2:
@@ -249,9 +246,9 @@ void tms9980a_device::mem_write()
case 3:
if (m_setaddr)
m_setaddr->write_word(CLEAR_LINE, (m_address & m_prgaddr_mask) | 1);
- if (TRACE_ADDRESSBUS) logerror("tms9980a: set address bus %04x\n", (m_address & m_prgaddr_mask) | 1);
+ LOGMASKED(LOG_ADDRESSBUS, "Set address bus %04x\n", (m_address & m_prgaddr_mask) | 1);
m_prgspace->write_byte((m_address & m_prgaddr_mask) | 1, m_current_value & 0xff);
- if (TRACE_MEM) logerror("tms9980a: memory write low byte %04x <- %02x\n", (m_address & m_prgaddr_mask) | 1, m_current_value & 0xff);
+ LOGMASKED(LOG_MEM, "Memory write low byte %04x <- %02x\n", (m_address & m_prgaddr_mask) | 1, m_current_value & 0xff);
break;
case 4:
// no action here, just wait for READY
@@ -274,7 +271,7 @@ void tms9980a_device::acquire_instruction()
if (m_mem_phase == 1) // changed by mem_read and wrapped
{
decode(m_current_value);
- if (TRACE_OP) logerror("tms9980a: ===== Next operation %04x (%s) at %04x =====\n", IR, opname[m_command], PC);
+ LOGMASKED(LOG_OP, "===== Next operation %04x (%s) at %04x =====\n", IR, opname[m_command], PC);
debugger_instruction_hook(PC);
PC = (PC + 2) & 0xfffe & m_prgaddr_mask;
}