diff options
author | 2016-11-17 19:47:55 -0500 | |
---|---|---|
committer | 2016-11-17 19:47:55 -0500 | |
commit | 0e2ca126efe45b4745268855f976f96791d7d064 (patch) | |
tree | 777ce51f95680b96dd45921f2c103ca51d22c7fd /src/devices/cpu | |
parent | 1a9cdb5c7ab8895d168d55d6dfe1540917c8d9d3 (diff) |
Changed the sharc disassembler to use 'std::ostream &' internally
Diffstat (limited to 'src/devices/cpu')
-rw-r--r-- | src/devices/cpu/sharc/sharcdsm.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/devices/cpu/sharc/sharcdsm.cpp b/src/devices/cpu/sharc/sharcdsm.cpp index c0786f02ccd..1d99ab16f31 100644 --- a/src/devices/cpu/sharc/sharcdsm.cpp +++ b/src/devices/cpu/sharc/sharcdsm.cpp @@ -1176,7 +1176,7 @@ static void build_dasm_table(void) } } -static uint32_t sharc_dasm_one(char *buffer, offs_t pc, uint64_t opcode) +static uint32_t sharc_dasm_one(std::ostream &stream, offs_t pc, uint64_t opcode) { #define DEFAULT_DASM_WIDTH (64) @@ -1198,14 +1198,24 @@ static uint32_t sharc_dasm_one(char *buffer, offs_t pc, uint64_t opcode) flags = (*sharcdasm_table[op])(pc, opcode); - for (i=0; i < DEFAULT_DASM_WIDTH; i++) + for (i=0; i < DEFAULT_DASM_WIDTH && dasm_buffer[i]; i++) { - buffer[i] = dasm_buffer[i]; + stream << dasm_buffer[i]; } return flags; } +static uint32_t sharc_dasm_one(char *buffer, offs_t pc, uint64_t opcode) +{ + std::ostringstream stream; + uint32_t result = sharc_dasm_one(stream, pc, opcode); + std::string stream_str = stream.str(); + strcpy(buffer, stream_str.c_str()); + return result; +} + + CPU_DISASSEMBLE( sharc ) { uint64_t op; |