Eliminated 'rsp_dasm_one(std::string &string,...' trampoline

This commit is contained in:
Nathan Woods 2016-11-20 18:22:31 -05:00
parent c31cbdc622
commit dca6901d80
4 changed files with 11 additions and 16 deletions

View File

@ -308,9 +308,10 @@ void rsp_device::unimplemented_opcode(uint32_t op)
{ {
if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{ {
std::string string; util::ovectorstream string;
rsp_dasm_one(string, m_ppc, op); rsp_dasm_one(string, m_ppc, op);
osd_printf_debug("%08X: %s\n", m_ppc, string.c_str()); string.put('\0');
osd_printf_debug("%08X: %s\n", m_ppc, &string.vec()[0]);
} }
#if SAVE_DISASM #if SAVE_DISASM
@ -734,12 +735,14 @@ void rsp_device::execute_run()
{ {
int i, l; int i, l;
static uint32_t prev_regs[32]; static uint32_t prev_regs[32];
std::string string;
util::ovectorstream string;
rsp_dasm_one(string, m_ppc, op); rsp_dasm_one(string, m_ppc, op);
string.put('\0');
fprintf(m_exec_output, "%08X: %s", m_ppc, string.c_str()); fprintf(m_exec_output, "%08X: %s", m_ppc, &string.vec()[0]);
l = string.length(); l = string.vec().size() - 1;
if (l < 36) if (l < 36)
{ {
for (i=l; i < 36; i++) for (i=l; i < 36; i++)

View File

@ -327,7 +327,6 @@ private:
extern const device_type RSP; extern const device_type RSP;
extern offs_t rsp_dasm_one(std::ostream &stream, offs_t pc, uint32_t op); extern offs_t rsp_dasm_one(std::ostream &stream, offs_t pc, uint32_t op);
extern offs_t rsp_dasm_one(std::string &string, offs_t pc, uint32_t op);
#endif /* __RSP_H__ */ #endif /* __RSP_H__ */

View File

@ -341,14 +341,6 @@ offs_t rsp_dasm_one(std::ostream &stream, offs_t pc, uint32_t op)
return 4 | flags | DASMFLAG_SUPPORTED; return 4 | flags | DASMFLAG_SUPPORTED;
} }
offs_t rsp_dasm_one(std::string &string, offs_t pc, uint32_t op)
{
std::ostringstream stream;
offs_t result = rsp_dasm_one(stream, pc, op);
string = stream.str();
return result;
}
/*****************************************************************************/ /*****************************************************************************/
CPU_DISASSEMBLE( rsp ) CPU_DISASSEMBLE( rsp )

View File

@ -1283,8 +1283,9 @@ void rsp_device::log_add_disasm_comment(drcuml_block *block, uint32_t pc, uint32
{ {
if (m_drcuml->logging()) if (m_drcuml->logging())
{ {
std::string buffer; util::ovectorstream buffer;
rsp_dasm_one(buffer, pc, op); rsp_dasm_one(buffer, pc, op);
block->append_comment("%08X: %s", pc, buffer.c_str()); // comment buffer.put('\0');
block->append_comment("%08X: %s", pc, &buffer.vec()[0]); // comment
} }
} }