Previous 15994 Revisions Next

r10089 Tuesday 18th January, 2011 at 10:30:24 UTC by Miodrag Milanović
Flagged options that should not be imported from parent drivers ini and cleared them on loading (bios and ramsize for now)
[src/emu]emuopts.c mame.c
[src/lib/util]options.c options.h

src/emu/emuopts.c
r10088r10089
155155
156156   /* misc options */
157157   { NULL,                          NULL,        OPTION_HEADER,     "CORE MISC OPTIONS" },
158   { "bios",                        NULL,        0,                 "select the system BIOS to use" },
158   { "bios",                        NULL,        OPTION_DRIVER_ONLY,"select the system BIOS to use" },
159159   { "cheat;c",                     "0",         OPTION_BOOLEAN,    "enable cheat subsystem" },
160160   { "skip_gameinfo",               "0",         OPTION_BOOLEAN,    "skip displaying the information screen at startup" },
161161   { "uifont",                   "default",   0,                 "specify a font to use" },
162   { "ramsize;ram",            NULL,           0,            "size of RAM (if supported by driver)" },
162   { "ramsize;ram",                 NULL,       OPTION_DRIVER_ONLY,"size of RAM (if supported by driver)" },
163163
164164   /* image device options */
165165   { OPTION_ADDED_DEVICE_OPTIONS,    "0",        OPTION_BOOLEAN | OPTION_INTERNAL,   "image device-specific options have been added" },
src/emu/mame.c
r10088r10089
554554         parse_ini_file(options, gparent->name, OPTION_PRIORITY_GPARENT_INI);
555555      if (parent != NULL)
556556         parse_ini_file(options, parent->name, OPTION_PRIORITY_PARENT_INI);
557     
558      options_revert_driver_only(options, OPTION_PRIORITY_CMDLINE);
559     
557560      parse_ini_file(options, driver->name, OPTION_PRIORITY_DRIVER_INI);
558561   }
559562}
src/lib/util/options.h
r10088r10089
6060#define OPTION_HEADER            0x0008         /* text-only header */
6161#define OPTION_INTERNAL            0x0010         /* option is internal-only */
6262#define OPTION_REPEATS            0x0020         /* unadorned option repeats */
63#define OPTION_DRIVER_ONLY         0x0040         /* remove value if found in lower levels */
6364
6465/* option priorities */
6566#define OPTION_PRIORITY_DEFAULT      0            /* defaults are at 0 priority */
r10088r10089
138139/* revert options at or below a certain priority back to their defaults */
139140void options_revert(core_options *opts, int priority);
140141
142/* revert options that are marked as driver only */
143void options_revert_driver_only(core_options *opts, int priority);
144
141145/* copy one collection of options into another */
142146int options_copy(core_options *dest_opts, core_options *src_opts);
143147
src/lib/util/options.c
r10088r10089
250250      }
251251}
252252
253/*-------------------------------------------------
254    options_revert_driver_only - revert options
255    that are marked as driver only and are under
256   priority level
257-------------------------------------------------*/
253258
259void options_revert_driver_only(core_options *opts, int priority)
260{
261   options_data *data;
262
263   /* iterate over options and revert to defaults if below the given priority */
264   for (data = opts->datalist; data != NULL; data = data->next)
265      if ((data->flags & OPTION_DRIVER_ONLY) && (data->priority < priority)) {
266         astring_cpy(data->data, data->defdata);
267         data->priority = OPTION_PRIORITY_DEFAULT;
268      }
269}
270
254271/*-------------------------------------------------
255272    options_copy - copy options from one core_options
256273    to another

Previous 15994 Revisions Next


© 1998-2018 The MESS Team