summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/didisasm.cpp
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2016-11-20 08:49:30 -0500
committer Nathan Woods <npwoods@mess.org>2016-11-20 08:49:30 -0500
commita29891d2e5b750e47a1237929c42fc2afdd8f094 (patch)
treea601af0a86b6076311a7af4494a7b66bb8d24667 /src/emu/didisasm.cpp
parent5eefcfdb684b94cbe41d41a7dcfd8b712bf86c6a (diff)
Changed disassembler infrastructure to not use char buffers internally
Diffstat (limited to 'src/emu/didisasm.cpp')
-rw-r--r--src/emu/didisasm.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/emu/didisasm.cpp b/src/emu/didisasm.cpp
index 56777ea79bb..ae8e0e7047d 100644
--- a/src/emu/didisasm.cpp
+++ b/src/emu/didisasm.cpp
@@ -64,20 +64,15 @@ void device_disasm_interface::static_set_dasm_override(device_t &device, dasm_ov
// disassemble - interface for disassembly
//-------------------------------------------------
-offs_t device_disasm_interface::disassemble(char *buffer, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
+offs_t device_disasm_interface::disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
offs_t result = 0;
// check for disassembler override
if (!m_dasm_override.isnull())
- {
- std::ostringstream stream;
result = m_dasm_override(device(), stream, pc, oprom, opram, options);
- std::string stream_str = stream.str();
- strcpy(buffer, stream_str.c_str());
- }
if (result == 0)
- result = disasm_disassemble(buffer, pc, oprom, opram, options);
+ result = disasm_disassemble(stream, pc, oprom, opram, options);
// make sure we get good results
assert((result & DASMFLAG_LENGTHMASK) != 0);
@@ -95,3 +90,16 @@ offs_t device_disasm_interface::disassemble(char *buffer, offs_t pc, const u8 *o
return result;
}
+
+
+//-------------------------------------------------
+// disassemble - interface for disassembly
+//-------------------------------------------------
+
+offs_t device_disasm_interface::disassemble(std::string &buffer, offs_t pc, const u8 *oprom, const u8 *opram, uint32_t options)
+{
+ std::stringstream stream;
+ offs_t result = disassemble(stream, pc, oprom, opram, options);
+ buffer = stream.str();
+ return result;
+}