void cpunum_write_byte(int cpunum, offs_t address, UINT8 data) { VERIFY_CPUNUM(cpunum_write_byte); cpuintrf_push_context(cpunum); program_write_byte(address, data); cpuintrf_pop_context(); }
void cpunum_set_opbase(int cpunum, unsigned val) { VERIFY_CPUNUM(cpunum_set_opbase); cpuintrf_push_context(cpunum); memory_set_opbase(val); cpuintrf_pop_context(); }
UINT64 cpu_gettotalcycles64(int cpunum) { VERIFY_CPUNUM(0, cpu_gettotalcycles); if (cpunum == cpu_getexecutingcpu()) return cpu[cpunum].totalcycles + cycles_currently_ran(); else return cpu[cpunum].totalcycles; }
void cpunum_reset(int cpunum) { VERIFY_CPUNUM(cpunum_reset); cpuintrf_push_context(cpunum); memory_set_opbase(0); (*cpu[cpunum].intf.reset)(); cpuintrf_pop_context(); }
const char *cpunum_dump_reg(int cpunum, int regnum) { const char *result; VERIFY_CPUNUM("", cpunum_dump_reg); cpuintrf_push_context(cpunum); result = (*cpu[cpunum].intf.cpu_info)(NULL, CPU_INFO_REG + regnum); cpuintrf_pop_context(); return result; }
const char *cpunum_flags(int cpunum) { const char *result; VERIFY_CPUNUM("", cpunum_flags); cpuintrf_push_context(cpunum); result = (*cpu[cpunum].intf.cpu_info)(NULL, CPU_INFO_FLAGS); cpuintrf_pop_context(); return result; }
unsigned cpunum_dasm(int cpunum, char *buffer, unsigned pc) { unsigned result; VERIFY_CPUNUM(1, cpunum_dasm); cpuintrf_push_context(cpunum); result = internal_dasm(cpunum, buffer, pc); cpuintrf_pop_context(); return result; }
unsigned cpunum_get_reg(int cpunum, int regnum) { unsigned result; VERIFY_CPUNUM(0, cpunum_get_reg); cpuintrf_push_context(cpunum); result = (*cpu[cpunum].intf.get_reg)(regnum); cpuintrf_pop_context(); return result; }
const void *cpunum_get_cycle_table(int cpunum, int which) { const void *result; VERIFY_CPUNUM(NULL, cpunum_get_cycle_table); cpuintrf_push_context(cpunum); result = (*cpu[cpunum].intf.get_cycle_table)(which); cpuintrf_pop_context(); return result; }
data8_t cpunum_read_byte(int cpunum, offs_t address) { int result; VERIFY_CPUNUM(0, cpunum_read_byte); cpuintrf_push_context(cpunum); result = (*cpu[cpunum].intf.memory_read)(address); cpuintrf_pop_context(); return result; }
unsigned cpunum_dasm(int cpunum, char *buffer, unsigned pc) { unsigned result; VERIFY_CPUNUM(1, cpunum_dasm); cpuintrf_push_context(cpunum); result = (*cpu[cpunum].intf.cpu_dasm)(buffer, pc); cpuintrf_pop_context(); return result; }
offs_t cpunum_dasm_new(int cpunum, char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes) { unsigned result; VERIFY_CPUNUM(cpunum_dasm_new); cpuintrf_push_context(cpunum); result = activecpu_dasm_new(buffer, pc, oprom, opram, bytes); 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; }
void cpunum_set_info_ptr(int cpunum, UINT32 state, void *data) { union cpuinfo info; VERIFY_CPUNUM(cpunum_set_info_ptr); info.p = data; cpuintrf_push_context(cpunum); (*cpu[cpunum].intf.set_info)(state, &info); cpuintrf_pop_context(); }
const char *cpunum_dump_state(int cpunum) { static char buffer[1024+1]; VERIFY_CPUNUM("", cpunum_dump_state); cpuintrf_push_context(cpunum); strcpy(buffer, activecpu_dump_state()); cpuintrf_pop_context(); return buffer; }
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; }
void cpunum_set_info_fct(int cpunum, UINT32 state, genf *data) { cpuinfo info; VERIFY_CPUNUM(cpunum_set_info_ptr); info.f = data; cpuintrf_push_context(cpunum); (*cpu[cpunum].intf.set_info)(state, &info); cpuintrf_pop_context(); }
UINT8 cpunum_read_byte(int cpunum, offs_t address) { int result; VERIFY_CPUNUM(cpunum_read_byte); cpuintrf_push_context(cpunum); result = program_read_byte(address); cpuintrf_pop_context(); return result; }
void cpunum_set_info_int(int cpunum, UINT32 state, INT64 data) { cpuinfo info; VERIFY_CPUNUM(cpunum_set_info_int); info.i = data; cpuintrf_push_context(cpunum); (*cpu[cpunum].intf.set_info)(state, &info); cpuintrf_pop_context(); }
const char *cpunum_get_info_string(int cpunum, UINT32 state) { cpuinfo info; VERIFY_CPUNUM(cpunum_get_info_string); cpuintrf_push_context(cpunum); info.s = cpuintrf_temp_str(); (*cpu[cpunum].intf.get_info)(state, &info); cpuintrf_pop_context(); return info.s; }
genf *cpunum_get_info_fct(int cpunum, UINT32 state) { cpuinfo info; VERIFY_CPUNUM(cpunum_get_info_fct); cpuintrf_push_context(cpunum); info.f = NULL; (*cpu[cpunum].intf.get_info)(state, &info); cpuintrf_pop_context(); return info.f; }
void *cpunum_get_info_ptr(int cpunum, UINT32 state) { cpuinfo info; VERIFY_CPUNUM(cpunum_get_info_ptr); cpuintrf_push_context(cpunum); info.p = NULL; (*cpu[cpunum].intf.get_info)(state, &info); cpuintrf_pop_context(); return info.p; }
INT64 cpunum_get_info_int(int cpunum, UINT32 state) { cpuinfo info; VERIFY_CPUNUM(cpunum_get_info_int); cpuintrf_push_context(cpunum); info.i = 0; (*cpu[cpunum].intf.get_info)(state, &info); cpuintrf_pop_context(); return info.i; }
int cpunum_execute(int cpunum, int cycles) { int ran; VERIFY_CPUNUM(cpunum_execute); cpuintrf_push_context(cpunum); executingcpu = cpunum; memory_set_opbase(activecpu_get_physical_pc_byte()); ran = (*cpu[cpunum].intf.execute)(cycles); executingcpu = -1; cpuintrf_pop_context(); return ran; }
offs_t cpunum_get_pc_byte(int cpunum) { offs_t base, pc; int shift; VERIFY_CPUNUM(0, cpunum_get_pc_byte); shift = cpu[cpunum].intf.address_shift; base = cpu[cpunum].intf.pgm_memory_base; cpuintrf_push_context(cpunum); pc = (*cpu[cpunum].intf.get_reg)(REG_PC); cpuintrf_pop_context(); return base + ((shift < 0) ? (pc << -shift) : (pc >> shift)); }
double cpunum_get_localtime(int cpunum) { double result; VERIFY_CPUNUM(0, cpunum_get_localtime); /* if we're active, add in the time from the current slice */ result = cpu[cpunum].localtime; if (cpunum == cpu_getexecutingcpu()) { int cycles = cycles_currently_ran(); result += TIME_IN_CYCLES(cycles, cpunum); } return result; }
offs_t cpunum_get_physical_pc_byte(int cpunum) { offs_t pc; int shift; VERIFY_CPUNUM(cpunum_get_physical_pc_byte); shift = cpu[cpunum].intf.address_shift; cpuintrf_push_context(cpunum); pc = activecpu_get_info_int(CPUINFO_INT_PC); if (shift < 0) pc <<= -shift; else pc >>= shift; if (cpu[activecpu].intf.translate) (*cpu[activecpu].intf.translate)(ADDRESS_SPACE_PROGRAM, &pc); cpuintrf_pop_context(); return pc; }
double cpunum_get_clockscale(int cpunum) { VERIFY_CPUNUM(1.0, cpunum_get_clockscale); return cpu[cpunum].clockscale; }
void *cpunum_get_context_ptr(int cpunum) { VERIFY_CPUNUM(cpunum_get_context_ptr); return (cpu_active_context[cpu[cpunum].family] == cpunum) ? NULL : cpu[cpunum].context; }
int cpunum_is_suspended(int cpunum, int reason) { VERIFY_CPUNUM(0, cpunum_suspend); return ((cpu[cpunum].nextsuspend & reason) != 0); }