offs_t cpunum_dasm(int cpunum, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) { unsigned result; VERIFY_CPUNUM(cpunum_dasm); cpuintrf_push_context(cpunum); result = activecpu_dasm(buffer, pc, oprom, opram); cpuintrf_pop_context(); return result; }
offs_t cpunum_dasm(int cpunum, char *buffer, unsigned pc) { unsigned result; VERIFY_CPUNUM(cpunum_dasm); cpuintrf_push_context(cpunum); result = activecpu_dasm(buffer, pc); cpuintrf_pop_context(); return result; }
const char *activecpu_dump_state(void) { static char buffer[1024+1]; unsigned addr_width = (activecpu_address_bits() + 3) / 4; char *dst = buffer; const char *src; const INT8 *regs; int width; VERIFY_ACTIVECPU("", activecpu_dump_state); dst += sprintf(dst, "CPU #%d [%s]\n", activecpu, activecpu_name()); width = 0; regs = (INT8 *)activecpu_reg_layout(); while (*regs) { if (*regs == -1) { dst += sprintf(dst, "\n"); width = 0; } else { src = activecpu_dump_reg(*regs); if (*src) { if (width + strlen(src) + 1 >= 80) { dst += sprintf(dst, "\n"); width = 0; } dst += sprintf(dst, "%s ", src); width += strlen(src) + 1; } } regs++; } dst += sprintf(dst, "\n%0*X: ", addr_width, activecpu_get_pc()); activecpu_dasm(dst, activecpu_get_pc()); strcat(dst, "\n\n"); return buffer; }