--- uae/src/main.c 2018/04/24 16:44:45 1.1.1.6 +++ uae/src/main.c 2018/04/24 16:56:35 1.1.1.12 @@ -21,7 +21,6 @@ #include "memory.h" #include "custom.h" #include "serial.h" -#include "readcpu.h" #include "newcpu.h" #include "disk.h" #include "debug.h" @@ -37,7 +36,8 @@ #include "picasso96.h" #include "bsdsocket.h" #include "uaeexe.h" -#include "getopt.h" +#include "native2amiga.h" +#include "scsidev.h" long int version = 256*65536L*UAEMAJOR + 65536L*UAEMINOR + UAESUBREV; @@ -47,6 +47,8 @@ int no_gui = 0; int joystickpresent = 0; int cloanto_rom = 0; +struct gui_info gui_data; + char warning_buffer[256]; char optionsfile[256]; @@ -96,7 +98,6 @@ void default_prefs (struct uae_prefs *p) 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->framerate = 1; p->illegal_mem = 0; p->no_xhair = 0; p->use_serial = 0; @@ -116,7 +117,9 @@ void default_prefs (struct uae_prefs *p) p->sound_freq = DEFAULT_SOUND_FREQ; p->sound_minbsiz = DEFAULT_SOUND_MINB; p->sound_maxbsiz = DEFAULT_SOUND_MAXB; + p->sound_interpol = 0; + p->gfx_framerate = 1; p->gfx_width = 800; p->gfx_height = 600; p->gfx_lores = 0; @@ -132,8 +135,20 @@ void default_prefs (struct uae_prefs *p) 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_sound_style = 0; + p->win32_sound_tweak = 0; + p->win32_logfile = 0; + p->win32_iconified_nospeed = 0; + p->win32_iconified_nosound = 0; + p->immediate_blits = 0; p->blits_32bit_enabled = 0; + p->collision_level = 1; strcpy (p->df[0], "df0.adf"); strcpy (p->df[1], "df1.adf"); @@ -148,7 +163,7 @@ void default_prefs (struct uae_prefs *p) strcpy (p->path_floppy, "./"); strcpy (p->path_hardfile, "./"); - p->m68k_speed = 4; + p->m68k_speed = 0; p->cpu_level = 2; p->cpu_compatible = 0; p->address_space_24 = 0; @@ -160,6 +175,8 @@ void default_prefs (struct uae_prefs *p) p->bogomem_size = 0x00000000; p->gfxmem_size = 0x00000000; + p->nr_floppies = 4; + p->mountinfo = alloc_mountinfo (); } @@ -245,12 +262,25 @@ static void fix_options (void) currprefs.z3fastmem_size = 0; err = 1; } - if (currprefs.cpu_level < 2 && currprefs.gfxmem_size > 0) { - fprintf (stderr, "Picasso96 can't be used with a 68000/68010 emulation. It\n" + if (currprefs.gfxmem_size > 0 && (currprefs.cpu_level < 2 || currprefs.address_space_24)) { + fprintf (stderr, "Picasso96 can't be used with a 68000/68010 or 68EC020 emulation. It\n" "requires a 68020 emulation. Turning off Picasso96.\n"); currprefs.gfxmem_size = 0; err = 1; } +#ifndef BSDSOCKET_SUPPORTED + if (currprefs.socket_emu) { + fprintf (stderr, "Compile-time option of BSDSOCKET_SUPPORTED was not enabled. You can't use bsd-socket emulation.\n"); + currprefs.socket_emu = 0; + err = 1; + } +#endif + + if (currprefs.nr_floppies < 1 || currprefs.nr_floppies > 4) { + fprintf (stderr, "Invalid number of floppies. Using 4.\n"); + currprefs.nr_floppies = 4; + err = 1; + } if (err) fprintf (stderr, "Please use \"uae -h\" to get usage information.\n"); @@ -296,29 +326,33 @@ void usage (void) void parse_cmdline (int argc, char **argv) { - char *param_string; - int longind = 0, last_longind = -1, result, i = 0; - struct option longopts[] = - { - { "help", 0, 0, 'h' }, - { "file", 0, 0, 'f' }, - { 0, 0, 0, 0 } - }; - - while ((result = getopt_long (argc, argv, "s:f:h", longopts, &longind)) != EOF) { - switch (result) { - case 's': - cfgfile_parse_line (&currprefs, optarg, 0); - break; - case 'f': - cfgfile_load (&currprefs, optarg); - break; - - case 'h': - default: + int i; + for (i = 1; i < argc; i++) { + if (strncmp (argv[i], "-config=", 8) == 0) + cfgfile_load (&currprefs, 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) + fprintf (stderr, "Missing argument for '-f' option.\n"); + else + cfgfile_load (&currprefs, argv[++i]); + } else if (strcmp (argv[i], "-s") == 0) { + if (i + 1 == argc) + fprintf (stderr, "Missing argument for '-s' option.\n"); + else + cfgfile_parse_line (&currprefs, argv[++i]); + } else if (strcmp (argv[i], "-h") == 0 || strcmp (argv[i], "-help") == 0) { usage (); exit (0); - break; + } 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 (argv[i][1], arg) && extra_arg) + i++; + } } } } @@ -380,6 +414,8 @@ void reset_all_systems (void) bsdlib_reset (); filesys_reset (); filesys_start_threads (); + scsidev_reset (); + scsidev_start_threads (); } /* Okay, this stuff looks strange, but it is here to encourage people who @@ -433,6 +469,7 @@ void real_main (int argc, char **argv) rtarea_init (); hardfile_install (); + scsidev_install (); parse_cmdline_and_init_file (argc, argv); @@ -473,6 +510,7 @@ void real_main (int argc, char **argv) gfxlib_install (); emulib_install (); uaeexe_install (); + native2amiga_install (); custom_init (); /* Must come after memory_init */ serial_init ();