summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/apexc
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/apexc
parent5eefcfdb684b94cbe41d41a7dcfd8b712bf86c6a (diff)
Changed disassembler infrastructure to not use char buffers internally
Diffstat (limited to 'src/devices/cpu/apexc')
-rw-r--r--src/devices/cpu/apexc/apexc.cpp4
-rw-r--r--src/devices/cpu/apexc/apexc.h2
-rw-r--r--src/devices/cpu/apexc/apexcdsm.cpp13
3 files changed, 4 insertions, 15 deletions
diff --git a/src/devices/cpu/apexc/apexc.cpp b/src/devices/cpu/apexc/apexc.cpp
index 4e8f0cca659..fa1014230fd 100644
--- a/src/devices/cpu/apexc/apexc.cpp
+++ b/src/devices/cpu/apexc/apexc.cpp
@@ -848,8 +848,8 @@ void apexc_cpu_device::execute_run()
}
-offs_t apexc_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t apexc_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
{
extern CPU_DISASSEMBLE( apexc );
- return CPU_DISASSEMBLE_NAME(apexc)(this, buffer, pc, oprom, opram, options);
+ return CPU_DISASSEMBLE_NAME(apexc)(this, stream, pc, oprom, opram, options);
}
diff --git a/src/devices/cpu/apexc/apexc.h b/src/devices/cpu/apexc/apexc.h
index eefff1e7c73..28aba6a5b52 100644
--- a/src/devices/cpu/apexc/apexc.h
+++ b/src/devices/cpu/apexc/apexc.h
@@ -42,7 +42,7 @@ protected:
// device_disasm_interface overrides
virtual uint32_t disasm_min_opcode_bytes() const override { return 4; }
virtual uint32_t disasm_max_opcode_bytes() const override { return 4; }
- 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;
inline uint32_t apexc_readmem(uint32_t address) { return m_program->read_dword((address)<<2); }
inline void apexc_writemem(uint32_t address, uint32_t data) { m_program->write_dword((address)<<2, (data)); }
diff --git a/src/devices/cpu/apexc/apexcdsm.cpp b/src/devices/cpu/apexc/apexcdsm.cpp
index 6113ef2e137..e3626a40af9 100644
--- a/src/devices/cpu/apexc/apexcdsm.cpp
+++ b/src/devices/cpu/apexc/apexcdsm.cpp
@@ -83,7 +83,7 @@ static const instr_desc instructions[16] =
{ "A", store }, { "S", swap }
};
-static offs_t internal_disasm_apexc(cpu_device *device, std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options)
+CPU_DISASSEMBLE(apexc)
{
uint32_t instruction; /* 32-bit machine instruction */
int x, y, function, c6, vector; /* instruction fields */
@@ -179,16 +179,5 @@ static offs_t internal_disasm_apexc(cpu_device *device, std::ostream &stream, of
/* print Y address */
util::stream_format(stream, "%03X(%02d/%02d)", y<<2, (y >> 5) & 0x1f, y & 0x1f); /* 7 chars */
-
return 4;
}
-
-
-CPU_DISASSEMBLE(apexc)
-{
- std::ostringstream stream;
- offs_t result = internal_disasm_apexc(device, stream, pc, oprom, opram, options);
- std::string stream_str = stream.str();
- strcpy(buffer, stream_str.c_str());
- return result;
-}