/* * Reset emulator */ static void do_reset_machine (int hardreset) { #ifdef SAVESTATE if (savestate_state == STATE_RESTORE) restore_state (savestate_fname); else if (savestate_state == STATE_REWIND) savestate_rewind (); #endif /* following three lines must not be reordered or * fastram state restore breaks */ reset_all_systems (); customreset (); m68k_reset (); if (hardreset) { memset (chipmemory, 0, allocated_chipmem); write_log ("chipmem cleared\n"); } #ifdef SAVESTATE /* We may have been restoring state, but we're done now. */ if (savestate_state == STATE_RESTORE || savestate_state == STATE_REWIND) { map_overlay (1); fill_prefetch_slow (®s); /* compatibility with old state saves */ } savestate_restore_finish (); #endif fill_prefetch_slow (®s); if (currprefs.produce_sound == 0) eventtab[ev_audio].active = 0; handle_active_events (); inputdevice_updateconfig (&currprefs); }
void m68k_go (int may_quit) { gui_purge_events(); #if !defined(DREAMCAST) || defined(DEBUG_UAE4ALL) if (in_m68k_go || !may_quit) { #ifdef DEBUG_UAE4ALL puts("Bug! m68k_go is not reentrant.\n"); #endif return; } in_m68k_go++; #endif g_emulator.quit_program = RunStateReset; for (;;) { if (g_emulator.quit_program > RunStateNormal) { if (g_emulator.quit_program == RunStateExit) break; g_emulator.quit_program = RunStateNormal; g_emulator.reset_all_systems (); customreset (); check_prefs_changed_cpu (); sound_default_evtime (); /* We may have been restoring state, but we're done now. */ handle_active_events (); if (mispcflags) do_specialties (0); } m68k_run(); } #if !defined(DREAMCAST) || defined(DEBUG_UAE4ALL) in_m68k_go--; #endif #ifdef DEBUG_UAE4ALL puts("BYE?"); #endif }