Previous 15994 Revisions Next

r8568 Wednesday 21st July, 2010 at 12:58:23 UTC by Miodrag Milanović
Fix issue of mounting images by starting MESS without selecting driver, it also made problem when driver is changed during runtime using menus.
[src/emu]mame.c
[src/lib/util]options.c options.h

src/emu/mame.c
r8567r8568
565565   if (filerr != FILERR_NONE)
566566      return FALSE;
567567
568   /* update game name so depending callback options could be added */
569   options_force_option_callback(options, OPTION_GAMENAME, name, OPTION_PRIORITY_CMDLINE);
570   
568571   /* parse the file and close it */
569572   mame_printf_verbose("Parsing %s.ini\n", name);
570573   options_parse_ini_file(options, mame_core_file(file), priority);
src/lib/util/options.h
r8567r8568
164164/* parse option data from a command line */
165165int options_parse_command_line(core_options *opts, int argc, char **argv, int priority);
166166
167/*  set option value and execute callback call */
168int options_force_option_callback(core_options *opts, const char *optionname, const char *newval, int priority);
169
167170/* parse option data from an INI file */
168171int options_parse_ini_file(core_options *opts, core_file *inifile, int priority);
169172
src/lib/util/options.c
r8567r8568
495495
496496
497497/*-------------------------------------------------
498    options_force_option_callback - set option value
499   and execute callback call
500-------------------------------------------------*/
501
502int options_force_option_callback(core_options *opts, const char *optionname, const char *newval, int priority)
503{
504   options_data *data = find_entry_data(opts, optionname, TRUE);
505   if (data == NULL)
506   {
507      message(opts, OPTMSG_ERROR, "Error: unknown option: %s\n", optionname);
508      return 1;
509   }
510
511   /* invoke callback, if present */
512   if (data->callback != NULL)
513      (*data->callback)(opts, newval);
514
515   /* allocate a new copy of data for this */
516   update_data(opts, data, newval, priority);   
517   return 0;
518}
519
520
521/*-------------------------------------------------
498522    options_parse_ini_file - parse a series
499523    of entries in an INI file
500524-------------------------------------------------*/

Previous 15994 Revisions Next


© 1998-2018 The MESS Team