static void parse_cmdline (int argc, char **argv) { int i; for (i = 1; i < argc; i++) { if (strcmp (argv[i], "-cfgparam") == 0) { if (i + 1 < argc) i++; } else if (strncmp (argv[i], "-config=", 8) == 0) { #ifdef FILESYS free_mountinfo (currprefs.mountinfo); currprefs.mountinfo = alloc_mountinfo (); #endif if (cfgfile_load (&currprefs, argv[i] + 8, 0)) strcpy (optionsfile, argv[i] + 8); } /* Check for new-style "-f xxx" argument, where xxx is config-file */ else if (strcmp (argv[i], "-f") == 0) { if (i + 1 == argc) { write_log ("Missing argument for '-f' option.\n"); } else { #ifdef FILESYS free_mountinfo (currprefs.mountinfo); currprefs.mountinfo = alloc_mountinfo (); #endif if (cfgfile_load (&currprefs, argv[++i], 0)) strcpy (optionsfile, argv[i]); } } else if (strcmp (argv[i], "-s") == 0) { if (i + 1 == argc) write_log ("Missing argument for '-s' option.\n"); else cfgfile_parse_line (&currprefs, argv[++i], 0); } else if (strcmp (argv[i], "-h") == 0 || strcmp (argv[i], "-help") == 0) { usage (); exit (0); } else if (strcmp (argv[i], "-version") == 0) { show_version_full (); exit (0); } else if (strcmp (argv[i], "-scsilog") == 0) { log_scsi = 1; } else { if (argv[i][0] == '-' && argv[i][1] != '\0') { const char *arg = argv[i] + 2; int extra_arg = *arg == '\0'; if (extra_arg) arg = i + 1 < argc ? argv[i + 1] : 0; if (parse_cmdline_option (&currprefs, argv[i][1], (char*)arg) && extra_arg) i++; } } } }
void default_prefs_uae (struct uae_prefs *p) { p->chipset_mask = CSMASK_ECS_AGNUS; p->cpu_level = M68000; p->fastmem_size = 0x00000000; p->z3fastmem_size = 0x00000000; p->gfxmem_size = 0x00000000; p->mountinfo = alloc_mountinfo (); }
void default_prefs_uae (struct uae_prefs *p) { p->chipset_mask = CSMASK_ECS_AGNUS; p->cpu_level = M68000; p->fastmem_size = 0x00000000; #if !( defined(PANDORA) || defined(ANDROIDSDL) ) p->z3fastmem_size = 0x00000000; p->gfxmem_size = 0x00000000; #endif p->mountinfo = alloc_mountinfo (); }
void discard_prefs (struct uae_prefs *p, int type) { struct strlist **ps = &p->all_lines; while (*ps) { struct strlist *s = *ps; *ps = s->next; free (s->value); free (s->option); free (s); } #ifdef FILESYS filesys_cleanup (); free_mountinfo (p->mountinfo); p->mountinfo = alloc_mountinfo (); #endif }
static void real_main2 (int argc, char **argv) { #if defined (NATMEM_OFFSET) && defined( _WIN32 ) && !defined( NO_WIN32_EXCEPTION_HANDLER ) extern int EvalException ( LPEXCEPTION_POINTERS blah, int n_except ); __try #endif { if (! graphics_setup ()) { exit (1); } if (restart_config[0]) { #ifdef FILESYS free_mountinfo (currprefs.mountinfo); currprefs.mountinfo = alloc_mountinfo (); #endif default_prefs (&currprefs, 0); fix_options (); } #ifdef NATMEM_OFFSET init_shm (); #endif #ifdef FILESYS rtarea_init (); hardfile_install (); #endif if (restart_config[0]) parse_cmdline_and_init_file (argc, argv); else currprefs = changed_prefs; uae_inithrtimer (); sleep_test (); machdep_init (); if (! setup_sound ()) { write_log ("Sound driver unavailable: Sound output disabled\n"); currprefs.produce_sound = 0; } inputdevice_init (); changed_prefs = currprefs; no_gui = ! currprefs.start_gui; if (restart_program == 2) no_gui = 1; else if (restart_program == 3) no_gui = 0; if (! no_gui) { int err = gui_init (); struct uaedev_mount_info *mi = currprefs.mountinfo; currprefs = changed_prefs; currprefs.mountinfo = mi; if (err == -1) { write_log ("Failed to initialize the GUI\n"); if (restart_program == 3) { restart_program = 0; return; } } else if (err == -2) { restart_program = 0; return; } } restart_program = 0; #ifdef JIT if (!(( currprefs.cpu_level >= 2 ) && ( currprefs.address_space_24 == 0 ) && ( currprefs.cachesize ))) canbang = 0; #endif #ifdef _WIN32 logging_init(); /* Yes, we call this twice - the first case handles when the user has loaded a config using the cmd-line. This case handles loads through the GUI. */ #endif fix_options (); changed_prefs = currprefs; #ifdef SAVESTATE savestate_init (); #endif #ifdef SCSIEMU scsidev_install (); #endif #ifdef AUTOCONFIG /* Install resident module to get 8MB chipmem, if requested */ rtarea_setup (); #endif keybuf_init (); /* Must come after init_joystick */ #ifdef AUTOCONFIG expansion_init (); #endif memory_init (); memory_reset (); #ifdef FILESYS filesys_install (); #endif #ifdef AUTOCONFIG bsdlib_install (); emulib_install (); uaeexe_install (); native2amiga_install (); #endif if (custom_init ()) { /* Must come after memory_init */ #ifdef SERIAL_PORT serial_init (); #endif DISK_init (); reset_frame_rate_hack (); init_m68k(); /* must come after reset_frame_rate_hack (); */ gui_update (); if (graphics_init ()) { #ifdef DEBUGGER setup_brkhandler (); if (currprefs.start_debugger && debuggable ()) activate_debugger (); #endif #ifdef WIN32 #ifdef FILESYS filesys_init (); /* New function, to do 'add_filesys_unit()' calls at start-up */ #endif #endif if (sound_available && currprefs.produce_sound > 1 && ! init_audio ()) { write_log ("Sound driver unavailable: Sound output disabled\n"); currprefs.produce_sound = 0; } start_program (); } } } #if defined (NATMEM_OFFSET) && defined( _WIN32 ) && !defined( NO_WIN32_EXCEPTION_HANDLER ) __except( EvalException( GetExceptionInformation(), GetExceptionCode() ) ) { // EvalException does the good stuff... } #endif }
void default_prefs (struct uae_prefs *p) { strcpy (p->description, "UAE default configuration"); p->start_gui = 1; p->start_debugger = 0; p->unknown_lines = 0; /* Note to porters: please don't change any of these options! UAE is supposed * to behave identically on all platforms if possible. */ p->illegal_mem = 0; p->use_serial = 0; p->serial_demand = 0; p->parallel_demand = 0; p->jport0 = JSEM_MICE; p->jport1 = JSEM_JOYS; p->keyboard_lang = KBD_LANG_US; p->emul_accuracy = 2; p->test_drawing_speed = 0; p->produce_sound = 3; p->sound_stereo = 0; p->sound_stereo_separation = 7; p->sound_mixed_stereo_delay = 0; p->sound_freq = DEFAULT_SOUND_FREQ; p->sound_maxbsiz = DEFAULT_SOUND_MAXB; p->sound_interpol = 2; p->sound_filter = FILTER_SOUND_OFF; p->sound_filter_type = FILTER_SOUND_TYPE_A500; p->gfx_framerate = 1; p->gfx_w.width = 800; p->gfx_w.height = 600; p->gfx_w.lores = 0; p->gfx_w.linedbl = 2; p->gfx_w.correct_aspect = 0; p->gfx_w.xcenter = 0; p->gfx_w.ycenter = 0; p->gfx_f = p->gfx_w; p->gfx_w.leds_on_screen = 0; p->gfx_f.leds_on_screen = 1; p->gfx_afullscreen = 0; p->gfx_pfullscreen = 0; p->color_mode = 0; p->x11_use_low_bandwidth = 0; p->x11_use_mitshm = 0; p->x11_hide_cursor = 1; p->svga_no_linear = 0; p->curses_reverse_video = 0; p->win32_middle_mouse = 0; p->win32_logfile = 0; p->win32_iconified_nospeed = 0; p->win32_iconified_nosound = 0; p->win32_no_overlay = 0; p->immediate_blits = 0; p->collision_level = 1; p->chipset_mask = CSMASK_ECS_AGNUS; p->cs_rtc = 2; p->cs_a1000ram = 0; p->cs_fatgaryrev = -1; p->cs_ramseyrev = -1; p->cs_ide = 0; strcpy (p->df[0], "df0.adf"); strcpy (p->df[1], "df1.adf"); strcpy (p->df[2], "df2.adf"); strcpy (p->df[3], "df3.adf"); strcpy (p->romfile, "kick.rom"); strcpy (p->keyfile, ""); strcpy (p->prtname, DEFPRTNAME); p->rom_crc32 = 0; strcpy (p->path_rom, "./"); strcpy (p->path_floppy, "./"); strcpy (p->path_hardfile, "./"); strcpy (p->prtname, ""); strcpy (p->sername, ""); p->nr_floppies = 2; p->dfxtype[0] = DRV_35_DD; p->dfxtype[1] = DRV_35_DD; p->dfxtype[2] = DRV_NONE; p->dfxtype[3] = DRV_NONE; p->m68k_speed = 0; p->cpu_model = 68020; p->fpu_model = 0; p->address_space_24 = 0; p->fastmem_size = 0x00000000; p->mbresmem_low_size = 0x00000000; p->mbresmem_high_size = 0x00000000; p->z3fastmem_size = 0x00000000; p->chipmem_size = 0x00200000; p->bogomem_size = 0x00000000; p->gfxmem_size = 0x00000000; p->mountinfo = alloc_mountinfo (); inputdevice_default_prefs (p); p->bootrom = 1; }