src/emu/emuopts.c
| r10088 | r10089 | |
| 155 | 155 | |
| 156 | 156 | /* misc options */ |
| 157 | 157 | { 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" }, |
| 159 | 159 | { "cheat;c", "0", OPTION_BOOLEAN, "enable cheat subsystem" }, |
| 160 | 160 | { "skip_gameinfo", "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" }, |
| 161 | 161 | { "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)" }, |
| 163 | 163 | |
| 164 | 164 | /* image device options */ |
| 165 | 165 | { OPTION_ADDED_DEVICE_OPTIONS, "0", OPTION_BOOLEAN | OPTION_INTERNAL, "image device-specific options have been added" }, |
src/lib/util/options.h
| r10088 | r10089 | |
| 60 | 60 | #define OPTION_HEADER 0x0008 /* text-only header */ |
| 61 | 61 | #define OPTION_INTERNAL 0x0010 /* option is internal-only */ |
| 62 | 62 | #define OPTION_REPEATS 0x0020 /* unadorned option repeats */ |
| 63 | #define OPTION_DRIVER_ONLY 0x0040 /* remove value if found in lower levels */ |
| 63 | 64 | |
| 64 | 65 | /* option priorities */ |
| 65 | 66 | #define OPTION_PRIORITY_DEFAULT 0 /* defaults are at 0 priority */ |
| r10088 | r10089 | |
| 138 | 139 | /* revert options at or below a certain priority back to their defaults */ |
| 139 | 140 | void options_revert(core_options *opts, int priority); |
| 140 | 141 | |
| 142 | /* revert options that are marked as driver only */ |
| 143 | void options_revert_driver_only(core_options *opts, int priority); |
| 144 | |
| 141 | 145 | /* copy one collection of options into another */ |
| 142 | 146 | int options_copy(core_options *dest_opts, core_options *src_opts); |
| 143 | 147 | |
src/lib/util/options.c
| r10088 | r10089 | |
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | /*------------------------------------------------- |
| 254 | options_revert_driver_only - revert options |
| 255 | that are marked as driver only and are under |
| 256 | priority level |
| 257 | -------------------------------------------------*/ |
| 253 | 258 | |
| 259 | void 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 | |
| 254 | 271 | /*------------------------------------------------- |
| 255 | 272 | options_copy - copy options from one core_options |
| 256 | 273 | to another |