src/emu/emuopts.c
| r13194 | r13195 | |
| 337 | 337 | bool emu_options::parse_slot_devices(int argc, char *argv[], astring &error_string, const char *name, const char *value) |
| 338 | 338 | { |
| 339 | 339 | remove_device_options(); |
| 340 | | add_device_options(true); |
| 341 | 340 | if (name && exists(name)) { |
| 342 | 341 | set_value(name, value, OPTION_PRIORITY_CMDLINE, error_string); |
| 343 | 342 | } |
| r13194 | r13195 | |
| 345 | 344 | bool result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); |
| 346 | 345 | while (add_slot_options(isfirst)) { |
| 347 | 346 | result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); |
| 348 | | add_device_options(false); |
| 349 | 347 | if (name && exists(name)) { |
| 350 | 348 | set_value(name, value, OPTION_PRIORITY_CMDLINE, error_string); |
| 351 | 349 | } |
| 352 | 350 | isfirst = false; |
| 353 | 351 | } |
| 352 | add_device_options(true); |
| 354 | 353 | result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); |
| 355 | 354 | return result; |
| 356 | 355 | } |
| r13194 | r13195 | |
| 470 | 469 | assert(!error); |
| 471 | 470 | // remove any existing device options |
| 472 | 471 | remove_device_options(); |
| 473 | | // then add the options |
| 474 | | add_device_options(true); |
| 475 | 472 | |
| 476 | 473 | bool isfirst = true; |
| 477 | 474 | while (add_slot_options(isfirst)) { |
| 478 | | add_device_options(false); |
| 479 | 475 | isfirst = false; |
| 480 | 476 | } |
| 477 | // then add the options |
| 478 | add_device_options(true); |
| 481 | 479 | } |
| 482 | 480 | } |
| 483 | 481 | |
src/lib/util/options.c
| r13194 | r13195 | |
| 346 | 346 | |
| 347 | 347 | // iterate through arguments |
| 348 | 348 | int unadorned_index = 0; |
| 349 | bool retVal = true; |
| 349 | 350 | for (int arg = 1; arg < argc; arg++) |
| 350 | 351 | { |
| 351 | 352 | // determine the entry name to search for |
| r13194 | r13195 | |
| 358 | 359 | if (curentry == NULL) |
| 359 | 360 | { |
| 360 | 361 | error_string.catprintf("Error: unknown option: %s\n", curarg); |
| 361 | | return false; |
| 362 | retVal = false; |
| 363 | if (!is_unadorned) arg++; |
| 364 | continue; |
| 362 | 365 | } |
| 363 | 366 | |
| 364 | 367 | // process commands first |
| r13194 | r13195 | |
| 391 | 394 | // set the new data |
| 392 | 395 | validate_and_set_data(*curentry, newdata, priority, error_string); |
| 393 | 396 | } |
| 394 | | return true; |
| 397 | return retVal; |
| 395 | 398 | } |
| 396 | 399 | |
| 397 | 400 | |