src/mess/osd/winui/messui.c
| r2445 | r2446 | |
| 400 | 400 | |
| 401 | 401 | |
| 402 | 402 | |
| 403 | static int is_null_or_empty(const char *s) |
| 404 | { |
| 405 | return (s == NULL) || (s[0] == '\0'); |
| 406 | } |
| 407 | |
| 408 | |
| 409 | |
| 403 | 410 | // Places the specified image in the specified slot; nID = -1 means don't matter |
| 404 | 411 | static void MessSpecifyImage(int drvindex, const device_config *device, LPCSTR pszFilename) |
| 405 | 412 | { |
| r2445 | r2446 | |
| 423 | 430 | } |
| 424 | 431 | } |
| 425 | 432 | |
| 426 | | // still not found? find an image using the same file extension |
| 433 | // still not found? find an empty slot for which the device uses the |
| 434 | // same file extension |
| 427 | 435 | if (device == NULL) |
| 428 | 436 | { |
| 429 | 437 | const char *file_extension; |
| r2445 | r2446 | |
| 436 | 444 | { |
| 437 | 445 | for (device = image_device_first(config); device != NULL; device = image_device_next(device)) |
| 438 | 446 | { |
| 439 | | if (image_device_uses_file_extension(device, file_extension)) |
| 447 | s = GetSelectedSoftware(drvindex, config, device); |
| 448 | if (is_null_or_empty(s) && image_device_uses_file_extension(device, file_extension)) |
| 440 | 449 | break; |
| 441 | 450 | } |
| 442 | 451 | } |