mirror of
https://github.com/holub/mame
synced 2025-06-25 22:04:15 +03:00
Changing the MIPS DRC to not use static char buffers when disassembling
This commit is contained in:
parent
7b8128fef5
commit
c65cdadcbf
@ -771,7 +771,6 @@ private:
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
unsigned dasmmips3(std::ostream &stream, unsigned pc, uint32_t op);
|
unsigned dasmmips3(std::ostream &stream, unsigned pc, uint32_t op);
|
||||||
unsigned dasmmips3(char *buffer, unsigned pc, uint32_t op);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __MIPS3_H__ */
|
#endif /* __MIPS3_H__ */
|
||||||
|
@ -3947,9 +3947,10 @@ void mips3_device::log_add_disasm_comment(drcuml_block *block, uint32_t pc, uint
|
|||||||
{
|
{
|
||||||
if (m_drcuml->logging())
|
if (m_drcuml->logging())
|
||||||
{
|
{
|
||||||
char buffer[100];
|
std::ostringstream stream;
|
||||||
dasmmips3(buffer, pc, op);
|
dasmmips3(stream, pc, op);
|
||||||
block->append_comment("%08X: %s", pc, buffer); // comment
|
const std::string stream_string = stream.str();
|
||||||
|
block->append_comment("%08X: %s", pc, stream_string.c_str()); // comment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4077,19 +4078,21 @@ void mips3_device::log_opcode_desc(drcuml_state *drcuml, const opcode_desc *desc
|
|||||||
/* output each descriptor */
|
/* output each descriptor */
|
||||||
for ( ; desclist != nullptr; desclist = desclist->next())
|
for ( ; desclist != nullptr; desclist = desclist->next())
|
||||||
{
|
{
|
||||||
char buffer[100];
|
std::ostringstream buffer;
|
||||||
|
|
||||||
/* disassemle the current instruction and output it to the log */
|
/* disassemle the current instruction and output it to the log */
|
||||||
if (drcuml->logging() || drcuml->logging_native())
|
if (drcuml->logging() || drcuml->logging_native())
|
||||||
{
|
{
|
||||||
if (desclist->flags & OPFLAG_VIRTUAL_NOOP)
|
if (desclist->flags & OPFLAG_VIRTUAL_NOOP)
|
||||||
strcpy(buffer, "<virtual nop>");
|
buffer << "<virtual nop>";
|
||||||
else
|
else
|
||||||
dasmmips3(buffer, desclist->pc, desclist->opptr.l[0]);
|
dasmmips3(buffer, desclist->pc, desclist->opptr.l[0]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
strcpy(buffer, "???");
|
buffer << "???";
|
||||||
drcuml->log_printf("%08X [%08X] t:%08X f:%s: %-30s", desclist->pc, desclist->physpc, desclist->targetpc, log_desc_flags_to_string(desclist->flags), buffer);
|
|
||||||
|
const std::string buffer_string = buffer.str();
|
||||||
|
drcuml->log_printf("%08X [%08X] t:%08X f:%s: %-30s", desclist->pc, desclist->physpc, desclist->targetpc, log_desc_flags_to_string(desclist->flags), buffer_string.c_str());
|
||||||
|
|
||||||
/* output register states */
|
/* output register states */
|
||||||
log_register_list(drcuml, "use", desclist->regin, nullptr);
|
log_register_list(drcuml, "use", desclist->regin, nullptr);
|
||||||
|
Loading…
Reference in New Issue
Block a user