summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/sh2
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/devices/cpu/sh2
parent5eefcfdb684b94cbe41d41a7dcfd8b712bf86c6a (diff)
Changed disassembler infrastructure to not use char buffers internally
Diffstat (limited to 'src/devices/cpu/sh2')
-rw-r--r--src/devices/cpu/sh2/sh2.cpp4
-rw-r--r--src/devices/cpu/sh2/sh2.h2
-rw-r--r--src/devices/cpu/sh2/sh2dasm.cpp6
3 files changed, 4 insertions, 8 deletions
diff --git a/src/devices/cpu/sh2/sh2.cpp b/src/devices/cpu/sh2/sh2.cpp
index 78bf317d3e2..ad000212a13 100644
--- a/src/devices/cpu/sh2/sh2.cpp
+++ b/src/devices/cpu/sh2/sh2.cpp
@@ -248,10 +248,10 @@ const address_space_config *sh2_device::memory_space_config(address_spacenum spa
}
}
-offs_t sh2_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t sh2_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
{
extern CPU_DISASSEMBLE( sh2 );
- return CPU_DISASSEMBLE_NAME( sh2 )(this, buffer, pc, oprom, opram, options);
+ return CPU_DISASSEMBLE_NAME( sh2 )(this, stream, pc, oprom, opram, options);
}
diff --git a/src/devices/cpu/sh2/sh2.h b/src/devices/cpu/sh2/sh2.h
index cf38bea2526..b13ce13f618 100644
--- a/src/devices/cpu/sh2/sh2.h
+++ b/src/devices/cpu/sh2/sh2.h
@@ -135,7 +135,7 @@ protected:
// device_disasm_interface overrides
virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }
virtual uint32_t disasm_max_opcode_bytes() const override { return 2; }
- virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
address_space *m_program, *m_decrypted_program;
private:
diff --git a/src/devices/cpu/sh2/sh2dasm.cpp b/src/devices/cpu/sh2/sh2dasm.cpp
index a484c2a9cb4..ef823ee28a5 100644
--- a/src/devices/cpu/sh2/sh2dasm.cpp
+++ b/src/devices/cpu/sh2/sh2dasm.cpp
@@ -606,9 +606,5 @@ unsigned DasmSH2(std::ostream &stream, unsigned pc, uint16_t opcode)
CPU_DISASSEMBLE(sh2)
{
- std::ostringstream stream;
- offs_t result = DasmSH2(stream, pc, (oprom[0] << 8) | oprom[1]);
- std::string stream_str = stream.str();
- strcpy(buffer, stream_str.c_str());
- return result;
+ return DasmSH2(stream, pc, (oprom[0] << 8) | oprom[1]);
}