void state_save_allow_registration(running_machine *machine, int allowed) { /* allow/deny registration */ machine->state_data->reg_allowed = allowed; if (!allowed) state_save_dump_registry(machine); }
static void cpu_pre_run(void) { int cpunum; logerror("Machine reset\n"); begin_resource_tracking(); /* read hi scores information from hiscore.dat */ hs_open(Machine->gamedrv->name); hs_init(); /* initialize the various timers (suspends all CPUs at startup) */ cpu_inittimers(); watchdog_counter = -1; /* reset sound chips */ sound_reset(); /* first pass over CPUs */ for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { /* enable all CPUs (except for audio CPUs if the sound is off) */ if (!(Machine->drv->cpu[cpunum].cpu_flags & CPU_AUDIO_CPU) || Machine->sample_rate != 0) cpunum_resume(cpunum, SUSPEND_ANY_REASON); else cpunum_suspend(cpunum, SUSPEND_REASON_DISABLE, 1); /* reset the interrupt state */ cpuint_reset_cpu(cpunum); /* reset the total number of cycles */ cpu[cpunum].totalcycles = 0; cpu[cpunum].localtime = 0; } vblank = 0; /* do this AFTER the above so machine_init() can use cpu_halt() to hold the */ /* execution of some CPUs, or disable interrupts */ if (Machine->drv->machine_init) (*Machine->drv->machine_init)(); /* now reset each CPU */ for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) cpunum_reset(cpunum, Machine->drv->cpu[cpunum].reset_param, cpu_irq_callbacks[cpunum]); /* reset the globals */ cpu_vblankreset(); current_frame = 0; state_save_dump_registry(); }