Ejemplo n.º 1
0
void real_main (int argc, TCHAR **argv)
{
	show_version_full ();
	restart_program = 1;

	fetch_configurationpath (restart_config, sizeof (restart_config) / sizeof (TCHAR));
	_tcscat (restart_config, OPTIONSFILENAME);
	default_config = 1;

// -------- FIXME
	keyboard_settrans ();
#ifdef CATWEASEL
	catweasel_init ();
#endif

	while (restart_program) {
		int ret;
		changed_prefs = currprefs;
		ret = real_main2 (argc, argv);
		if (ret == 0 && quit_to_gui)
			restart_program = 1;
		leave_program ();
		quit_program = 0;
	}
	zfile_exit ();
}
Ejemplo n.º 2
0
void do_leave_program (void)
{
    graphics_leave ();
    close_joystick ();
    close_sound ();
    dump_counts ();
    zfile_exit ();
#ifdef USE_SDL
    SDL_Quit ();
#endif
    memory_cleanup ();
}
Ejemplo n.º 3
0
void do_leave_program (void)
{
#ifdef USE_SDL
  if(current_screenshot != NULL)
    SDL_FreeSurface(current_screenshot);
#endif
    graphics_leave ();
    close_joystick ();
    close_sound ();
    zfile_exit ();
#ifdef USE_SDL
    SDL_Quit ();
#endif
    memory_cleanup ();
}
Ejemplo n.º 4
0
Archivo: main.c Proyecto: bernds/UAE
void do_leave_program (void)
{
    graphics_leave ();
    inputdevice_close ();
    close_sound ();
    dump_counts ();
    serial_exit ();
    zfile_exit ();
    if (! no_gui)
	gui_exit ();
#ifdef USE_SDL
    SDL_Quit ();
#endif
    expansion_cleanup ();
    memory_cleanup ();
}
Ejemplo n.º 5
0
void real_main (int argc, TCHAR **argv)
{
	restart_program = 1;

	fetch_configurationpath (restart_config, sizeof (restart_config) / sizeof (TCHAR));
	_tcscat (restart_config, OPTIONSFILENAME);
	default_config = 1;

	while (restart_program) {
		int ret;
		changed_prefs = currprefs;
		ret = real_main2 (argc, argv);
		if (ret == 0 && quit_to_gui)
			restart_program = 1;
		leave_program ();
		quit_program = 0;
	}
	zfile_exit ();
}
Ejemplo n.º 6
0
void real_main (int argc, char **argv)
{
 //ric   show_version ();

    restart_program = 1;

    strcpy (restart_config, "");
#ifdef _WIN32
    sprintf (restart_config, "%sConfigurations\\", start_path);
#endif
    strcat (restart_config, OPTIONSFILENAME);

    while (restart_program) {
	changed_prefs = currprefs;
	real_main2 (argc, argv);
        leave_program ();
	quit_program = 0;
    }
    zfile_exit ();
}
Ejemplo n.º 7
0
void real_main (int argc, TCHAR **argv)
{
	show_version_full ();
	restart_program = 1;

	fetch_configurationpath (restart_config, sizeof (restart_config) / sizeof (TCHAR));
	_tcscat (restart_config, OPTIONSFILENAME);
	default_config = 1;

#ifdef NATMEM_OFFSET
	preinit_shm ();
#endif

	write_log (_T("Enumerating display devices.. \n"));
	enumeratedisplays ();
	write_log (_T("Sorting devices and modes..\n"));
	sortdisplays ();
//	write_log (_T("Display buffer mode = %d\n"), ddforceram);
//	enumerate_sound_devices ();
	write_log (_T("done\n"));

	keyboard_settrans ();
#ifdef CATWEASEL
	catweasel_init ();
#endif
#ifdef PARALLEL_PORT
	paraport_mask = paraport_init ();
#endif
	while (restart_program) {
		int ret;
		changed_prefs = currprefs;
		ret = real_main2 (argc, argv);
		if (ret == 0 && quit_to_gui)
			restart_program = 1;
		leave_program ();
		quit_program = 0;
	}
	zfile_exit ();
}
Ejemplo n.º 8
0
/*
 * Here's where all the action takes place!
 */
void real_main (int argc, char **argv)
{
    show_version ();

#if defined (NATMEM_OFFSET)
    if (NATMEM_OFFSET == 0 && sizeof (void*) < 8) {
      write_log ("NATMEM_OFFSET is 0; I hope you used 'uae-preloader' to load me, or else ...\n");
    }
#endif

#ifdef FILESYS
    currprefs.mountinfo = changed_prefs.mountinfo = &options_mountinfo;
#endif
    restart_program = 1;
#ifdef _WIN32
    sprintf (restart_config, "%sConfigurations\\", start_path);
#endif
    strcat (restart_config, OPTIONSFILENAME);

    /* Initial state is stopped */
    uae_target_state = UAE_STATE_STOPPED;

    while (uae_target_state != UAE_STATE_QUITTING) {
	int want_gui;

	set_state (uae_target_state);

	do_preinit_machine (argc, argv);

	/* Should we open the GUI? TODO: This mess needs to go away */
	want_gui = currprefs.start_gui;
	if (restart_program == 2)
	    want_gui = 0;
	else if (restart_program == 3)
	    want_gui = 1;

	changed_prefs = currprefs;


	if (want_gui) {
	    /* Handle GUI at start-up */
	    int err = gui_open ();

	    if (err >= 0) {
		do {
		    gui_handle_events ();

		    uae_msleep (10);

		} while (!uae_state_change_pending ());
	    } else if (err == - 1) {
		if (restart_program == 3) {
		    restart_program = 0;
		    uae_quit ();
		}
	    } else
		uae_quit ();

	    currprefs = changed_prefs;
	    fix_options ();
	    inputdevice_init ();
	}

	restart_program = 0;

	if (uae_target_state == UAE_STATE_QUITTING)
	    break;

	uae_target_state = UAE_STATE_COLD_START;

	/* Start emulator proper. */
	if (!do_init_machine ())
	    break;

	while (uae_target_state != UAE_STATE_QUITTING && uae_target_state != UAE_STATE_STOPPED) {
	    /* Reset */
	    set_state (uae_target_state);
	    do_reset_machine (uae_state == UAE_STATE_COLD_START);

	    /* Running */
	    uae_target_state = UAE_STATE_RUNNING;

	    /*
	     * Main Loop
	     */
	    do {
		set_state (uae_target_state);

		/* Run emulator. */
		do_run_machine ();

		if (uae_target_state == UAE_STATE_PAUSED) {
		    /* Paused */
		    set_state (uae_target_state);

		    audio_pause ();

		    /* While UAE is paused we have to handle
		     * input events, etc. ourselves.
		     */
		    do {
			gui_handle_events ();
			handle_events ();

			/* Manually pump input device */
			inputdevicefunc_keyboard.read ();
			inputdevicefunc_mouse.read ();
			inputdevicefunc_joystick.read ();
			inputdevice_handle_inputcode ();

			/* Don't busy wait. */
			uae_msleep (10);

		    } while (!uae_state_change_pending ());

		    audio_resume ();
		}

	    } while (uae_target_state == UAE_STATE_RUNNING);

	    /*
	     * End of Main Loop
	     *
	     * We're no longer running or paused.
	     */

	    set_inhibit_frame (IHF_QUIT_PROGRAM);

#ifdef FILESYS
	    /* Ensure any cached changes to virtual filesystem are flushed before
	     * resetting or exitting. */
	    filesys_prepare_reset ();
#endif

	} /* while (!QUITTING && !STOPPED) */

	do_exit_machine ();

	/* TODO: This stuff is a hack. What we need to do is
	 * check whether a config GUI is available. If not,
	 * then quit.
	 */
	restart_program = 3;
    }
    zfile_exit ();
}