From a29891d2e5b750e47a1237929c42fc2afdd8f094 Mon Sep 17 00:00:00 2001 From: Nathan Woods Date: Sun, 20 Nov 2016 08:49:30 -0500 Subject: Changed disassembler infrastructure to not use char buffers internally --- src/devices/cpu/sh2/sh2.cpp | 4 ++-- src/devices/cpu/sh2/sh2.h | 2 +- src/devices/cpu/sh2/sh2dasm.cpp | 6 +----- 3 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src/devices/cpu/sh2') 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]); } -- cgit v1.2.3-70-g09d2