src/mess/image.c
| r5804 | r5805 | |
| 173 | 173 | |
| 174 | 174 | void image_init(running_machine *machine) |
| 175 | 175 | { |
| 176 | | int count, indx, format_count, i; |
| 176 | int count, indx, format_count, i,cnt; |
| 177 | 177 | const device_config *dev; |
| 178 | 178 | size_t private_size; |
| 179 | 179 | image_slot_data *slot; |
| r5804 | r5805 | |
| 226 | 226 | /* creation formats */ |
| 227 | 227 | format_count = device_get_info_int(slot->dev, DEVINFO_INT_IMAGE_CREATE_OPTCOUNT); |
| 228 | 228 | formatptr = &slot->formatlist; |
| 229 | cnt = 0; |
| 229 | 230 | for (i = 0; i < format_count; i++) |
| 230 | 231 | { |
| 231 | | /* allocate a new format */ |
| 232 | | format = auto_alloc_clear(machine, image_device_format); |
| 233 | | |
| 234 | | /* populate it */ |
| 235 | | format->index = i; |
| 236 | | format->name = auto_strdup(machine, device_get_info_string(slot->dev, DEVINFO_STR_IMAGE_CREATE_OPTNAME + i)); |
| 237 | | format->description = auto_strdup(machine, device_get_info_string(slot->dev, DEVINFO_STR_IMAGE_CREATE_OPTDESC + i)); |
| 238 | | format->extensions = auto_strdup(machine, device_get_info_string(slot->dev, DEVINFO_STR_IMAGE_CREATE_OPTEXTS + i)); |
| 239 | | format->optspec = device_get_info_ptr(slot->dev, DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i); |
| 240 | | |
| 241 | | /* and append it to the list */ |
| 242 | | *formatptr = format; |
| 243 | | formatptr = &format->next; |
| 232 | // only add if creatable |
| 233 | if (device_get_info_ptr(slot->dev, DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i)) { |
| 234 | /* allocate a new format */ |
| 235 | format = auto_alloc_clear(machine, image_device_format); |
| 236 | |
| 237 | /* populate it */ |
| 238 | format->index = cnt; |
| 239 | format->name = auto_strdup(machine, device_get_info_string(slot->dev, DEVINFO_STR_IMAGE_CREATE_OPTNAME + i)); |
| 240 | format->description = auto_strdup(machine, device_get_info_string(slot->dev, DEVINFO_STR_IMAGE_CREATE_OPTDESC + i)); |
| 241 | format->extensions = auto_strdup(machine, device_get_info_string(slot->dev, DEVINFO_STR_IMAGE_CREATE_OPTEXTS + i)); |
| 242 | format->optspec = device_get_info_ptr(slot->dev, DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i); |
| 243 | |
| 244 | /* and append it to the list */ |
| 245 | *formatptr = format; |
| 246 | formatptr = &format->next; |
| 247 | cnt++; |
| 248 | } |
| 244 | 249 | } |
| 245 | 250 | |
| 246 | 251 | indx++; |