src/emu/mame.c
| r10072 | r10073 | |
| 214 | 214 | global_free(machine); |
| 215 | 215 | global_free(config); |
| 216 | 216 | 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 | } |
| 217 | 221 | |
| 218 | 222 | // reset the options |
| 219 | 223 | mame_opts = NULL; |
| r10072 | r10073 | |
| 565 | 569 | mame_file *file; |
| 566 | 570 | |
| 567 | 571 | /* 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) { |
| 569 | 573 | options_force_option_callback(options, OPTION_GAMENAME, name, priority); |
| 570 | 574 | } |
| 571 | 575 | |
src/lib/util/options.h
| r10072 | r10073 | |
| 151 | 151 | /* add a set of entries to an options collection */ |
| 152 | 152 | int options_add_entries(core_options *opts, const options_entry *entrylist); |
| 153 | 153 | |
| 154 | /* add a set of entries to an options collection, and force recreation if true */ |
| 155 | int options_add_entries(core_options *opts, const options_entry *entrylist, int force); |
| 156 | |
| 154 | 157 | /* set the default value for a particular option entry */ |
| 155 | 158 | int options_set_option_default_value(core_options *opts, const char *name, const char *defvalue); |
| 156 | 159 | |
src/lib/util/options.c
| r10072 | r10073 | |
| 309 | 309 | current options sets |
| 310 | 310 | -------------------------------------------------*/ |
| 311 | 311 | |
| 312 | | int options_add_entries(core_options *opts, const options_entry *entrylist) |
| 312 | int options_add_entries(core_options *opts, const options_entry *entrylist, int force) |
| 313 | 313 | { |
| 314 | 314 | /* loop over entries until we hit a NULL name */ |
| 315 | 315 | for ( ; entrylist->name != NULL || (entrylist->flags & OPTION_HEADER); entrylist++) |
| r10072 | r10073 | |
| 333 | 333 | match = find_entry_data(opts, astring_c(data->links[i].name), FALSE); |
| 334 | 334 | |
| 335 | 335 | /* if so, throw away this entry and replace the data */ |
| 336 | | if (match != NULL) |
| 336 | if ((force == FALSE) && (match != NULL)) |
| 337 | 337 | { |
| 338 | 338 | /* free what we've allocated so far */ |
| 339 | 339 | for (i = 0; i < ARRAY_LENGTH(data->links); i++) |
| r10072 | r10073 | |
| 384 | 384 | return TRUE; |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | int options_add_entries(core_options *opts, const options_entry *entrylist) |
| 388 | { |
| 389 | return options_add_entries(opts,entrylist,FALSE); |
| 390 | } |
| 387 | 391 | |
| 388 | 392 | /*------------------------------------------------- |
| 389 | 393 | options_set_option_default_value - change the |