Added new flag for options OPTION_DRIVER_ONLY, and marked bios and ramsize as such, since they do not need to be loaded from parent drivers since those are quite driver dependent (no whatsnew)
This commit is contained in:
parent
db4f44350b
commit
f3ac110d76
@ -155,11 +155,11 @@ const options_entry mame_core_options[] =
|
||||
|
||||
/* misc options */
|
||||
{ NULL, NULL, OPTION_HEADER, "CORE MISC OPTIONS" },
|
||||
{ "bios", NULL, 0, "select the system BIOS to use" },
|
||||
{ "bios", NULL, OPTION_DRIVER_ONLY,"select the system BIOS to use" },
|
||||
{ "cheat;c", "0", OPTION_BOOLEAN, "enable cheat subsystem" },
|
||||
{ "skip_gameinfo", "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" },
|
||||
{ "uifont", "default", 0, "specify a font to use" },
|
||||
{ "ramsize;ram", NULL, 0, "size of RAM (if supported by driver)" },
|
||||
{ "ramsize;ram", NULL, OPTION_DRIVER_ONLY,"size of RAM (if supported by driver)" },
|
||||
|
||||
/* image device options */
|
||||
{ OPTION_ADDED_DEVICE_OPTIONS, "0", OPTION_BOOLEAN | OPTION_INTERNAL, "image device-specific options have been added" },
|
||||
|
@ -554,6 +554,9 @@ void mame_parse_ini_files(core_options *options, const game_driver *driver)
|
||||
parse_ini_file(options, gparent->name, OPTION_PRIORITY_GPARENT_INI);
|
||||
if (parent != NULL)
|
||||
parse_ini_file(options, parent->name, OPTION_PRIORITY_PARENT_INI);
|
||||
|
||||
options_revert_driver_only(options, OPTION_PRIORITY_CMDLINE);
|
||||
|
||||
parse_ini_file(options, driver->name, OPTION_PRIORITY_DRIVER_INI);
|
||||
}
|
||||
}
|
||||
|
@ -250,6 +250,23 @@ void options_revert(core_options *opts, int priority)
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
options_revert_driver_only - revert options
|
||||
that are marked as driver only and are under
|
||||
priority level
|
||||
-------------------------------------------------*/
|
||||
|
||||
void options_revert_driver_only(core_options *opts, int priority)
|
||||
{
|
||||
options_data *data;
|
||||
|
||||
/* iterate over options and revert to defaults if below the given priority */
|
||||
for (data = opts->datalist; data != NULL; data = data->next)
|
||||
if ((data->flags & OPTION_DRIVER_ONLY) && (data->priority < priority)) {
|
||||
astring_cpy(data->data, data->defdata);
|
||||
data->priority = OPTION_PRIORITY_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
options_copy - copy options from one core_options
|
||||
|
@ -60,6 +60,7 @@
|
||||
#define OPTION_HEADER 0x0008 /* text-only header */
|
||||
#define OPTION_INTERNAL 0x0010 /* option is internal-only */
|
||||
#define OPTION_REPEATS 0x0020 /* unadorned option repeats */
|
||||
#define OPTION_DRIVER_ONLY 0x0040 /* remove value if found in lower levels */
|
||||
|
||||
/* option priorities */
|
||||
#define OPTION_PRIORITY_DEFAULT 0 /* defaults are at 0 priority */
|
||||
@ -138,6 +139,9 @@ void options_set_output_callback(core_options *opts, options_message msgtype, vo
|
||||
/* revert options at or below a certain priority back to their defaults */
|
||||
void options_revert(core_options *opts, int priority);
|
||||
|
||||
/* revert options that are marked as driver only */
|
||||
void options_revert_driver_only(core_options *opts, int priority);
|
||||
|
||||
/* copy one collection of options into another */
|
||||
int options_copy(core_options *dest_opts, core_options *src_opts);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user