summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2022-02-25 05:47:34 +1100
committer Vas Crabb <vas@vastheman.com>2022-02-25 05:47:34 +1100
commitc5230c145fd27e38042503cec46a312e8152da98 (patch)
tree1bedfb2e9841ec5fb6ae315c588522bd53b71c8f
parent81640f15874cb703dbb6f8b08426621cfe02c393 (diff)
machine/53c7xx.cpp: Don't use static buffers for messages, don't clash with the LOG_GENERAL constant.
-rw-r--r--src/devices/machine/53c7xx.cpp25
-rw-r--r--src/devices/machine/53c7xx.h2
2 files changed, 12 insertions, 15 deletions
diff --git a/src/devices/machine/53c7xx.cpp b/src/devices/machine/53c7xx.cpp
index 7c15d1edee8..00d111f54e9 100644
--- a/src/devices/machine/53c7xx.cpp
+++ b/src/devices/machine/53c7xx.cpp
@@ -23,10 +23,10 @@
// DEBUGGERY
//**************************************************************************
-#define LOG_UNHANDLED (1U << 0)
-#define LOG_HOST (1U << 1)
-#define LOG_STATE (1U << 2)
-#define LOG_SCRIPTS (1U << 3)
+#define LOG_UNHANDLED (1U << 1)
+#define LOG_HOST (1U << 2)
+#define LOG_STATE (1U << 3)
+#define LOG_SCRIPTS (1U << 4)
#define VERBOSE (0)
#include "logmacro.h"
@@ -1735,7 +1735,7 @@ void ncr53c7xx_device::tc_int()
// disassemble_scripts -
//-------------------------------------------------
-const char* ncr53c7xx_device::disassemble_scripts()
+std::string ncr53c7xx_device::disassemble_scripts()
{
static char const *const phases[] =
{
@@ -1749,14 +1749,13 @@ const char* ncr53c7xx_device::disassemble_scripts()
"Message In"
};
- static char buffer[64];
- char opstring[64];
+ std::string opstring;
switch ((m_dcmd >> 6) & 3)
{
case 0:
{
- sprintf(opstring, "BMOV: %s [%x] %d bytes\n", phases[m_dcmd & 7], m_dnad, m_dbc);
+ opstring = util::string_format("BMOV: %s [%x] %d bytes\n", phases[m_dcmd & 7], m_dnad, m_dbc);
break;
}
case 1:
@@ -1773,7 +1772,7 @@ const char* ncr53c7xx_device::disassemble_scripts()
"ILLEGAL",
};
- sprintf(opstring, "IO: %s (%x)\n", ops[(m_dcmd >> 3) & 7], m_dnad);
+ opstring = util::string_format("IO: %s (%x)\n", ops[(m_dcmd >> 3) & 7], m_dnad);
break;
}
case 2:
@@ -1790,17 +1789,15 @@ const char* ncr53c7xx_device::disassemble_scripts()
"ILLEGAL",
};
- sprintf(opstring, "TC: %s %c (%s) (%x)\n", ops[(m_dcmd >> 3) & 7], m_dbc & (1 << 19) ? 'T' : 'F', phases[m_dcmd & 7], m_dnad);
+ opstring = util::string_format("TC: %s %c (%s) (%x)\n", ops[(m_dcmd >> 3) & 7], m_dbc & (1 << 19) ? 'T' : 'F', phases[m_dcmd & 7], m_dnad);
break;
}
case 3:
{
- sprintf(opstring, "ILLEGAL");
+ opstring = "ILLEGAL";
break;
}
}
- sprintf(buffer, "SCRIPTS [%08x]: %s", m_dsp - 8, opstring);
-
- return buffer;
+ return util::string_format("SCRIPTS [%08x]: %s", m_dsp - 8, opstring);
}
diff --git a/src/devices/machine/53c7xx.h b/src/devices/machine/53c7xx.h
index 91999bf7b75..4abefb15403 100644
--- a/src/devices/machine/53c7xx.h
+++ b/src/devices/machine/53c7xx.h
@@ -122,7 +122,7 @@ private:
void tc_return();
void tc_int();
void illegal();
- const char* disassemble_scripts();
+ std::string disassemble_scripts();
// SCSI registers