trunk/src/lib/util/options.c
| r21273 | r21274 | |
| 512 | 512 | // otherwise, output entries for all non-command items |
| 513 | 513 | else if (!curentry->is_command()) |
| 514 | 514 | { |
| 515 | | // look up counterpart in diff, if diff is specified |
| 516 | | if (diff == NULL || strcmp(value, diff->value(name)) != 0) |
| 515 | if ( !curentry->is_internal() ) |
| 517 | 516 | { |
| 518 | | // output header, if we have one |
| 519 | | if (last_header != NULL) |
| 517 | // look up counterpart in diff, if diff is specified |
| 518 | if (diff == NULL || strcmp(value, diff->value(name)) != 0) |
| 520 | 519 | { |
| 521 | | if (num_valid_headers++) |
| 522 | | buffer.catprintf("\n"); |
| 523 | | buffer.catprintf("#\n# %s\n#\n", last_header); |
| 524 | | last_header = NULL; |
| 525 | | } |
| 520 | // output header, if we have one |
| 521 | if (last_header != NULL) |
| 522 | { |
| 523 | if (num_valid_headers++) |
| 524 | buffer.catprintf("\n"); |
| 525 | buffer.catprintf("#\n# %s\n#\n", last_header); |
| 526 | last_header = NULL; |
| 527 | } |
| 526 | 528 | |
| 527 | | // and finally output the data, skip if unadorned |
| 528 | | if (!is_unadorned) |
| 529 | | { |
| 530 | | if (strchr(value, ' ') != NULL) |
| 531 | | buffer.catprintf("%-25s \"%s\"\n", name, value); |
| 532 | | else |
| 533 | | buffer.catprintf("%-25s %s\n", name, value); |
| 529 | // and finally output the data, skip if unadorned |
| 530 | if (!is_unadorned) |
| 531 | { |
| 532 | if (strchr(value, ' ') != NULL) |
| 533 | buffer.catprintf("%-25s \"%s\"\n", name, value); |
| 534 | else |
| 535 | buffer.catprintf("%-25s %s\n", name, value); |
| 536 | } |
| 534 | 537 | } |
| 535 | 538 | } |
| 536 | 539 | } |
trunk/src/lib/util/options.h
| r21273 | r21274 | |
| 70 | 70 | const int OPTION_PRIORITY_HIGH = 150; // high priority |
| 71 | 71 | const int OPTION_PRIORITY_MAXIMUM = 255; // maximum priority |
| 72 | 72 | |
| 73 | const UINT32 OPTION_FLAG_INTERNAL = 0x40000000; |
| 73 | 74 | |
| 74 | 75 | |
| 75 | 76 | //************************************************************************** |
| r21273 | r21274 | |
| 114 | 115 | UINT32 flags() const { return m_flags; } |
| 115 | 116 | bool is_header() const { return type() == OPTION_HEADER; } |
| 116 | 117 | bool is_command() const { return type() == OPTION_COMMAND; } |
| 118 | bool is_internal() const { return m_flags & OPTION_FLAG_INTERNAL; } |
| 117 | 119 | bool has_range() const { return (m_minimum && m_maximum); } |
| 118 | 120 | int priority() const { return m_priority; } |
| 119 | 121 | |
trunk/src/emu/emuopts.c
| r21273 | r21274 | |
| 236 | 236 | for (const device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next()) |
| 237 | 237 | { |
| 238 | 238 | if (slot->fixed()) continue; |
| 239 | bool all_internal = slot->all_internal(); |
| 239 | 240 | // first device? add the header as to be pretty |
| 240 | 241 | if (first && isfirst) |
| 241 | 242 | { |
| r21273 | r21274 | |
| 252 | 253 | // add the option |
| 253 | 254 | entry[0].name = slot->device().tag() + 1; |
| 254 | 255 | entry[0].description = NULL; |
| 255 | | entry[0].flags = OPTION_STRING | OPTION_FLAG_DEVICE; |
| 256 | entry[0].flags = OPTION_STRING | OPTION_FLAG_DEVICE | all_internal ? OPTION_FLAG_INTERNAL : 0; |
| 256 | 257 | entry[0].defvalue = (slot->get_slot_interfaces() != NULL) ? slot->get_default_card() : NULL; |
| 257 | 258 | add_entries(entry, true); |
| 258 | 259 | |