src/mess/machine/nec765.c
| r6031 | r6032 | |
| 173 | 173 | |
| 174 | 174 | if (!fdc->intf->get_image) |
| 175 | 175 | { |
| 176 | | if (fdc->intf->floppy_drive_tags[fdc->drive]!=NULL) { |
| 177 | | image = devtag_get_device(device->machine,fdc->intf->floppy_drive_tags[fdc->drive]); |
| 176 | if (fdc->intf->floppy_drive_tags[fdc->drive] != NULL) |
| 177 | { |
| 178 | if (device->owner != NULL) |
| 179 | image = device_find_child_by_tag(device->owner, fdc->intf->floppy_drive_tags[fdc->drive]); |
| 180 | else |
| 181 | image = devtag_get_device(device->machine, fdc->intf->floppy_drive_tags[fdc->drive]); |
| 178 | 182 | } |
| 179 | 183 | } |
| 180 | 184 | else |
| r6031 | r6032 | |
| 2212 | 2216 | a_drive_is_ready = 0; |
| 2213 | 2217 | for (i = 0; i < 4; i++) |
| 2214 | 2218 | { |
| 2215 | | if (fdc->intf->floppy_drive_tags[i]!=NULL) { |
| 2216 | | if (image_exists(devtag_get_device(device->machine,fdc->intf->floppy_drive_tags[i]))) { |
| 2219 | if (fdc->intf->floppy_drive_tags[i]!=NULL) |
| 2220 | { |
| 2221 | const device_config *img; |
| 2222 | |
| 2223 | if (device->owner != NULL) |
| 2224 | img = device_find_child_by_tag(device->owner, fdc->intf->floppy_drive_tags[i]); |
| 2225 | else |
| 2226 | img = devtag_get_device(device->machine, fdc->intf->floppy_drive_tags[i]); |
| 2227 | |
| 2228 | if (image_exists(img)) |
| 2229 | { |
| 2217 | 2230 | a_drive_is_ready = 1; |
| 2218 | 2231 | break; |
| 2219 | 2232 | } |
| r6031 | r6032 | |
| 2332 | 2345 | int i; |
| 2333 | 2346 | nec765_t *fdc = get_safe_token(device); |
| 2334 | 2347 | for (i = 0; i < 4; i++) { |
| 2335 | | if (fdc->intf->floppy_drive_tags[i]!=NULL) { |
| 2336 | | const device_config *img = devtag_get_device(device->machine,fdc->intf->floppy_drive_tags[i]); |
| 2348 | if (fdc->intf->floppy_drive_tags[i]!=NULL) |
| 2349 | { |
| 2350 | const device_config *img; |
| 2351 | |
| 2352 | if (device->owner != NULL) |
| 2353 | img = device_find_child_by_tag(device->owner, fdc->intf->floppy_drive_tags[i]); |
| 2354 | else |
| 2355 | img = devtag_get_device(device->machine, fdc->intf->floppy_drive_tags[i]); |
| 2356 | |
| 2337 | 2357 | floppy_drive_set_controller(img, device); |
| 2338 | 2358 | floppy_drive_set_ready_state_change_callback(img, nec765_set_ready_change_callback); |
| 2339 | 2359 | } |