src/mess/mess.c
| r7242 | r7243 | |
| 61 | 61 | |
| 62 | 62 | if ((image_name != NULL) && (image_name[0] != '\0')) |
| 63 | 63 | { |
| 64 | int result = INIT_FAIL; |
| 65 | |
| 66 | /* try to load this image */ |
| 67 | result = image_load(image, image_name); |
| 68 | |
| 69 | /* did the image load fail? */ |
| 70 | if (result) |
| 71 | { |
| 72 | /* retrieve image error message */ |
| 73 | const char *image_err = image_error(image); |
| 74 | |
| 75 | /* unload all images */ |
| 76 | image_unload_all(machine); |
| 77 | |
| 78 | /* FIXME: image_name is always empty in this message because of the image_unload_all() call */ |
| 79 | fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s\n", |
| 80 | info.name, |
| 81 | osd_basename((char *) image_name), |
| 82 | image_err); |
| 83 | } |
| 64 | 84 | } |
| 65 | 85 | else |
| 66 | 86 | { |
| r7242 | r7243 | |
| 95 | 115 | { |
| 96 | 116 | if (is_image_device(device)) |
| 97 | 117 | { |
| 98 | | const char *image_name; |
| 99 | | int result = INIT_FAIL; |
| 100 | | image_device_info info; |
| 101 | | |
| 102 | | /* get the device info */ |
| 103 | | info = image_device_getinfo(machine->config, device); |
| 104 | | |
| 105 | | /* is an image specified for this image */ |
| 106 | | image_name = mess_get_device_option(&info); |
| 107 | | |
| 108 | | if ((image_name != NULL) && (image_name[0] != '\0')) |
| 109 | | { |
| 110 | | /* try to load this image */ |
| 111 | | result = image_load(device, image_name); |
| 112 | | |
| 113 | | /* did the image load fail? */ |
| 114 | | if (result) |
| 115 | | { |
| 116 | | /* retrieve image error message */ |
| 117 | | const char *image_err = image_error(device); |
| 118 | | |
| 119 | | /* unload all images */ |
| 120 | | image_unload_all(machine); |
| 121 | | |
| 122 | | /* FIXME: image_name is always empty in this message because of the image_unload_all() call */ |
| 123 | | fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s\n", |
| 124 | | info.name, |
| 125 | | osd_basename((char *) image_name), |
| 126 | | image_err); |
| 127 | | } |
| 128 | | } |
| 129 | | |
| 130 | 118 | image_finish_load(device); |
| 131 | 119 | } |
| 132 | 120 | } |