Previous 15994 Revisions Next

r10073 Monday 17th January, 2011 at 15:40:07 UTC by Miodrag Milanović
Fixed some long standing issues with image device config
[src/emu]emuopts.c machine.c mame.c
[src/lib/util]options.c options.h

src/emu/emuopts.c
r10072r10073
256256      /* add the option */
257257      memset(entry, 0, sizeof(entry));
258258      entry[0].name = dev_full_name;
259      options_add_entries(opts, entry);
259      options_add_entries(opts, entry, TRUE);
260260
261261      index++;
262262   }
src/emu/machine.c
r10072r10073
231231
232232running_machine::~running_machine()
233233{
234   // clear flag for added devices
235   options_set_bool(&m_options, OPTION_ADDED_DEVICE_OPTIONS, FALSE, OPTION_PRIORITY_CMDLINE);
236234}
237235
238236
src/emu/mame.c
r10072r10073
214214      global_free(machine);
215215      global_free(config);
216216      global_machine = NULL;
217      if (firstrun) {
218         // clear flag for added devices
219         options_set_bool(options, OPTION_ADDED_DEVICE_OPTIONS, FALSE, OPTION_PRIORITY_CMDLINE);
220      }
217221
218222      // reset the options
219223      mame_opts = NULL;
r10072r10073
565569   mame_file *file;
566570
567571   /* update game name so depending callback options could be added */
568   if (priority==OPTION_PRIORITY_DRIVER_INI) {
572   if (priority==OPTION_PRIORITY_DRIVER_INI || priority==OPTION_PRIORITY_SOURCE_INI) {
569573      options_force_option_callback(options, OPTION_GAMENAME, name, priority);
570574   }
571575
src/lib/util/options.h
r10072r10073
151151/* add a set of entries to an options collection */
152152int options_add_entries(core_options *opts, const options_entry *entrylist);
153153
154/* add a set of entries to an options collection, and force recreation if true */
155int options_add_entries(core_options *opts, const options_entry *entrylist, int force);
156
154157/* set the default value for a particular option entry */
155158int options_set_option_default_value(core_options *opts, const char *name, const char *defvalue);
156159
src/lib/util/options.c
r10072r10073
309309    current options sets
310310-------------------------------------------------*/
311311
312int options_add_entries(core_options *opts, const options_entry *entrylist)
312int options_add_entries(core_options *opts, const options_entry *entrylist, int force)
313313{
314314   /* loop over entries until we hit a NULL name */
315315   for ( ; entrylist->name != NULL || (entrylist->flags & OPTION_HEADER); entrylist++)
r10072r10073
333333            match = find_entry_data(opts, astring_c(data->links[i].name), FALSE);
334334
335335      /* if so, throw away this entry and replace the data */
336      if (match != NULL)
336      if ((force == FALSE) && (match != NULL))
337337      {
338338         /* free what we've allocated so far */
339339         for (i = 0; i < ARRAY_LENGTH(data->links); i++)
r10072r10073
384384   return TRUE;
385385}
386386
387int options_add_entries(core_options *opts, const options_entry *entrylist)
388{
389   return options_add_entries(opts,entrylist,FALSE);
390}
387391
388392/*-------------------------------------------------
389393    options_set_option_default_value - change the

Previous 15994 Revisions Next


© 1998-2018 The MESS Team