Previous 15994 Revisions Next

r13195 Wednesday 9th November, 2011 at 10:30:46 UTC by Miodrag Milanović
Change order of parsing in emu_options, so first all slot devices are set and then image devices.
Also update lib/util/options.c so now parsing is not stopped on first unknown parameter, this way order of options in command line is not important for dynamic options (no whatsnew)
[src/emu]emuopts.c
[src/lib/util]options.c

src/emu/emuopts.c
r13194r13195
337337bool emu_options::parse_slot_devices(int argc, char *argv[], astring &error_string, const char *name, const char *value)
338338{
339339   remove_device_options();
340   add_device_options(true);
341340   if (name && exists(name)) {
342341      set_value(name, value, OPTION_PRIORITY_CMDLINE, error_string);
343342   }
r13194r13195
345344   bool result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
346345   while (add_slot_options(isfirst)) {
347346      result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
348      add_device_options(false);
349347      if (name && exists(name)) {
350348         set_value(name, value, OPTION_PRIORITY_CMDLINE, error_string);
351349      }
352350      isfirst = false;
353351   }
352   add_device_options(true);
354353   result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
355354   return result;
356355}
r13194r13195
470469      assert(!error);
471470      // remove any existing device options
472471      remove_device_options();
473      // then add the options
474      add_device_options(true);
475472
476473      bool isfirst = true;
477474      while (add_slot_options(isfirst)) {
478         add_device_options(false);
479475         isfirst = false;
480476      }
477      // then add the options
478      add_device_options(true);
481479   }
482480}
483481
src/lib/util/options.c
r13194r13195
346346
347347   // iterate through arguments
348348   int unadorned_index = 0;
349   bool retVal = true;
349350   for (int arg = 1; arg < argc; arg++)
350351   {
351352      // determine the entry name to search for
r13194r13195
358359      if (curentry == NULL)
359360      {
360361         error_string.catprintf("Error: unknown option: %s\n", curarg);
361         return false;
362         retVal = false;
363         if (!is_unadorned) arg++;
364         continue;
362365      }
363366
364367      // process commands first
r13194r13195
391394      // set the new data
392395      validate_and_set_data(*curentry, newdata, priority, error_string);
393396   }
394   return true;
397   return retVal;
395398}
396399
397400

Previous 15994 Revisions Next


© 1998-2018 The MESS Team