void real_main (int argc, char **argv) { #ifdef USE_SDL SDL_Init (SDL_INIT_VIDEO | SDL_INIT_JOYSTICK #if !defined(NO_SOUND) && !defined(GP2X) | SDL_INIT_AUDIO #endif ); #endif getcwd(launchDir,250); /* PocketUAE prefs */ default_prefs_uae (&currprefs); default_prefs(); #ifdef GP2X gp2x_init(argc, argv); #endif // Set everthing to default and clear HD settings SetDefaultMenuSettings(1); loadconfig (1); if (! graphics_setup ()) { exit (1); } rtarea_init (); hardfile_install(); if (! setup_sound ()) { write_log ("Sound driver unavailable: Sound output disabled\n"); produce_sound = 0; } init_joystick (); int err = gui_init (); if (err == -1) { write_log ("Failed to initialize the GUI\n"); } else if (err == -2) { exit (0); } if (sound_available && produce_sound > 1 && ! init_audio ()) { write_log ("Sound driver unavailable: Sound output disabled\n"); produce_sound = 0; } /* Install resident module to get 8MB chipmem, if requested */ rtarea_setup (); keybuf_init (); /* Must come after init_joystick */ #ifdef USE_AUTOCONFIG expansion_init (); #endif memory_init (); filesys_install (); native2amiga_install (); custom_init (); /* Must come after memory_init */ DISK_init (); m68k_init(0); gui_update (); #ifdef GP2X switch_to_hw_sdl(1); #endif { start_program (); } leave_program (); }
void real_main (int argc, char **argv) { int numb; char pattern[100]; char txt[100]; #ifdef USE_SDL SDL_Init (SDL_INIT_VIDEO | SDL_INIT_JOYSTICK #if !defined(NO_SOUND) && !defined(GP2X) | SDL_INIT_AUDIO #endif ); #endif // Initialize timebase g_uae_epoch = read_processor_time(); syncbase = 1000000; // Microseconds //------------------------------------------ //just safe the game conf file for later use //------------------------------------------ if (argc > 1) { if (strlen(argv[1]) < 255) { strcpy(uae4all_game_conf_file0, argv[1]); strcpy(uae4all_game_conf_file1, argv[1]); strcpy(uae4all_game_conf_file2, argv[1]); strcpy(uae4all_game_conf_file3, argv[1]); strcpy(uae4all_game_conf_file4, argv[1]); strcpy(uae4all_game_conf_file5, argv[1]); strcpy(uae4all_game_conf_file6, argv[1]); strcpy(uae4all_game_conf_file7, argv[1]); getNumber(uae4all_game_conf_file0, "disk 1 of %", &numb); strcpy(pattern, "disk %"); sprintf(txt, " of %d", numb); strcat(pattern, txt); replaceNumber(uae4all_game_conf_file1, pattern, '2'); strcpy(pattern, "disk %"); sprintf(txt, " of %d", numb); strcat(pattern, txt); replaceNumber(uae4all_game_conf_file2, pattern, '3'); strcpy(pattern, "disk %"); sprintf(txt, " of %d", numb); strcat(pattern, txt); replaceNumber(uae4all_game_conf_file3, pattern, '4'); strcpy(pattern, "disk %"); sprintf(txt, " of %d", numb); strcat(pattern, txt); replaceNumber(uae4all_game_conf_file4, pattern, '5'); strcpy(pattern, "disk %"); sprintf(txt, " of %d", numb); strcat(pattern, txt); replaceNumber(uae4all_game_conf_file5, pattern, '6'); strcpy(pattern, "disk %"); sprintf(txt, " of %d", numb); strcat(pattern, txt); replaceNumber(uae4all_game_conf_file6, pattern, '7'); strcpy(pattern, "disk %"); sprintf(txt, " of %d", numb); strcat(pattern, txt); replaceNumber(uae4all_game_conf_file7, pattern, '8'); } } getcwd(launchDir,250); /* PocketUAE prefs */ default_prefs_uae (&currprefs); default_prefs(); #ifdef GP2X gp2x_init(argc, argv); #endif // Set everthing to default and clear HD settings SetDefaultMenuSettings(1); loadconfig (1); if (! graphics_setup ()) { exit (1); } rtarea_init (); hardfile_install(); if (! setup_sound ()) { write_log ("Sound driver unavailable: Sound output disabled\n"); produce_sound = 0; } init_joystick (); int err = gui_init (); if (err == -1) { write_log ("Failed to initialize the GUI\n"); } else if (err == -2) { exit (0); } if (sound_available && produce_sound > 1 && ! init_audio ()) { write_log ("Sound driver unavailable: Sound output disabled\n"); produce_sound = 0; } /* Install resident module to get 8MB chipmem, if requested */ rtarea_setup (); keybuf_init (); /* Must come after init_joystick */ #ifdef USE_AUTOCONFIG expansion_init (); #endif memory_init (); filesys_install (); native2amiga_install (); custom_init (); /* Must come after memory_init */ DISK_init (); m68k_init(0); gui_update (); #ifdef GP2X switch_to_hw_sdl(1); #endif { start_program (); } leave_program (); }