src/emu/mame.c
| r10069 | r10070 | |
| 516 | 516 | /* if we have a valid game driver, parse game-specific INI files */ |
| 517 | 517 | if (driver != NULL && driver != &GAME_NAME(empty)) |
| 518 | 518 | { |
| 519 | | #ifndef MESS |
| 520 | 519 | const game_driver *parent = driver_get_clone(driver); |
| 521 | 520 | const game_driver *gparent = (parent != NULL) ? driver_get_clone(parent) : NULL; |
| 522 | 521 | |
| r10069 | r10070 | |
| 551 | 550 | parse_ini_file(options, gparent->name, OPTION_PRIORITY_GPARENT_INI); |
| 552 | 551 | if (parent != NULL) |
| 553 | 552 | parse_ini_file(options, parent->name, OPTION_PRIORITY_PARENT_INI); |
| 554 | | #endif /* MESS */ |
| 555 | 553 | parse_ini_file(options, driver->name, OPTION_PRIORITY_DRIVER_INI); |
| 556 | 554 | } |
| 557 | 555 | } |
src/lib/util/options.c
| r10069 | r10070 | |
| 733 | 733 | |
| 734 | 734 | |
| 735 | 735 | /*------------------------------------------------- |
| 736 | options_get_string_priority - return data |
| 737 | formatted as a string if priority is equal |
| 738 | or better |
| 739 | -------------------------------------------------*/ |
| 740 | |
| 741 | const char *options_get_string_priority(core_options *opts, const char *name, int priority) |
| 742 | { |
| 743 | options_data *data = find_entry_data(opts, name, FALSE); |
| 744 | const char *value = ""; |
| 745 | |
| 746 | /* error if not found */ |
| 747 | if (data == NULL) |
| 748 | message(opts, OPTMSG_ERROR, "Unexpected option %s queried\n", name); |
| 749 | |
| 750 | /* copy if non-NULL */ |
| 751 | else { |
| 752 | if (data->priority!=OPTION_PRIORITY_DEFAULT) { |
| 753 | if (priority > data->priority) return value; |
| 754 | } |
| 755 | value = astring_c(data->data); |
| 756 | } |
| 757 | |
| 758 | return value; |
| 759 | } |
| 760 | |
| 761 | |
| 762 | /*------------------------------------------------- |
| 736 | 763 | options_get_bool - return data formatted as |
| 737 | 764 | a boolean |
| 738 | 765 | -------------------------------------------------*/ |
| r10069 | r10070 | |
| 1078 | 1105 | } |
| 1079 | 1106 | break; |
| 1080 | 1107 | } |
| 1081 | | |
| 1108 | |
| 1082 | 1109 | /* ignore if we don't have priority */ |
| 1083 | | if (priority < data->priority) |
| 1110 | if (priority < data->priority) { |
| 1084 | 1111 | return; |
| 1085 | | |
| 1112 | } |
| 1086 | 1113 | /* allocate a copy of the data */ |
| 1087 | 1114 | astring_cpych(data->data, datastart, dataend + 1 - datastart); |
| 1088 | 1115 | data->priority = priority; |