src/mess/devices/sonydriv.c
| r2256 | r2257 | |
| 37 | 37 | *********************************************************************/ |
| 38 | 38 | |
| 39 | 39 | #include "driver.h" |
| 40 | #include "deprecat.h" |
| 40 | 41 | #include "sonydriv.h" |
| 41 | 42 | #include "formats/ap_dsk35.h" |
| 42 | 43 | #include "flopdrv.h" |
| r2256 | r2257 | |
| 121 | 122 | floppy *f; |
| 122 | 123 | |
| 123 | 124 | f = &sony_floppy[floppy_select]; |
| 124 | | cur_image = image_from_devtag_and_index("sonydriv", floppy_select); |
| 125 | cur_image = image_from_devtag_and_index(Machine, "sonydriv", floppy_select); |
| 125 | 126 | |
| 126 | 127 | track_size = floppy_get_track_size(flopimg_get_image(cur_image), f->head, floppy_drive_get_current_track(cur_image)); |
| 127 | 128 | new_data = image_realloc(cur_image, f->loadedtrack_data, track_size); |
| r2256 | r2257 | |
| 145 | 146 | int len; |
| 146 | 147 | |
| 147 | 148 | f = &sony_floppy[floppy_select]; |
| 148 | | cur_image = image_from_devtag_and_index("sonydriv", floppy_select); |
| 149 | cur_image = image_from_devtag_and_index(Machine, "sonydriv", floppy_select); |
| 149 | 150 | |
| 150 | 151 | if (f->loadedtrack_dirty) |
| 151 | 152 | { |
| r2256 | r2257 | |
| 167 | 168 | return 0xFF; /* right ??? */ |
| 168 | 169 | |
| 169 | 170 | f = &sony_floppy[sony_floppy_select]; |
| 170 | | cur_image = image_from_devtag_and_index("sonydriv", sony_floppy_select); |
| 171 | cur_image = image_from_devtag_and_index(Machine, "sonydriv", sony_floppy_select); |
| 171 | 172 | if (!image_exists(cur_image)) |
| 172 | 173 | return 0xFF; |
| 173 | 174 | |
| r2256 | r2257 | |
| 186 | 187 | floppy *f; |
| 187 | 188 | |
| 188 | 189 | f = &sony_floppy[sony_floppy_select]; |
| 189 | | cur_image = image_from_devtag_and_index("sonydriv", sony_floppy_select); |
| 190 | cur_image = image_from_devtag_and_index(Machine, "sonydriv", sony_floppy_select); |
| 190 | 191 | if (!image_exists(cur_image)) |
| 191 | 192 | return; |
| 192 | 193 | |
| r2256 | r2257 | |
| 269 | 270 | if ((! sony_enable2()) && sony_floppy_enable) |
| 270 | 271 | { |
| 271 | 272 | f = &sony_floppy[sony_floppy_select]; |
| 272 | | cur_image = image_from_devtag_and_index("sonydriv", sony_floppy_select); |
| 273 | cur_image = image_from_devtag_and_index(Machine, "sonydriv", sony_floppy_select); |
| 273 | 274 | if (!image_exists(cur_image)) |
| 274 | 275 | cur_image = NULL; |
| 275 | 276 | |
| r2256 | r2257 | |
| 380 | 381 | if (sony_floppy_enable) |
| 381 | 382 | { |
| 382 | 383 | f = &sony_floppy[sony_floppy_select]; |
| 383 | | cur_image = image_from_devtag_and_index("sonydriv", sony_floppy_select); |
| 384 | cur_image = image_from_devtag_and_index(Machine, "sonydriv", sony_floppy_select); |
| 384 | 385 | if (!image_exists(cur_image)) |
| 385 | 386 | cur_image = NULL; |
| 386 | 387 | |
src/mess/devices/appldriv.c
| r2256 | r2257 | |
| 156 | 156 | { |
| 157 | 157 | if (apple525_enable_mask & (1 << i)) |
| 158 | 158 | { |
| 159 | | image = image_from_devtag_and_index(APPLE525TAG, i); |
| 159 | image = image_from_devtag_and_index(Machine, APPLE525TAG, i); |
| 160 | 160 | if (image) |
| 161 | 161 | apple525_disk_set_lines(image, lines); |
| 162 | 162 | } |
| r2256 | r2257 | |
| 227 | 227 | for (i = 0; i < count; i++) |
| 228 | 228 | { |
| 229 | 229 | if (apple525_enable_mask & (1 << i)) |
| 230 | | return image_from_devtag_and_index(APPLE525TAG, i); |
| 230 | return image_from_devtag_and_index(machine, APPLE525TAG, i); |
| 231 | 231 | } |
| 232 | 232 | return NULL; |
| 233 | 233 | } |
| r2256 | r2257 | |
| 264 | 264 | { |
| 265 | 265 | if (apple525_enable_mask & (1 << i)) |
| 266 | 266 | { |
| 267 | | image = image_from_devtag_and_index(APPLE525TAG, i); |
| 267 | image = image_from_devtag_and_index(Machine, APPLE525TAG, i); |
| 268 | 268 | if (image && !image_is_writable(image)) |
| 269 | 269 | result = 1; |
| 270 | 270 | } |
src/mess/device.c
| r2256 | r2257 | |
| 644 | 644 | |
| 645 | 645 | |
| 646 | 646 | |
| 647 | | const device_config *image_from_devtag_and_index(const char *devtag, int id) |
| 647 | const device_config *image_from_devtag_and_index(running_machine *machine, const char *devtag, int id) |
| 648 | 648 | { |
| 649 | 649 | const device_config *image = NULL; |
| 650 | 650 | const device_config *dev; |
| 651 | 651 | const struct IODevice *iodev; |
| 652 | 652 | |
| 653 | | for (dev = device_list_first(Machine->config->devicelist, MESS_DEVICE); dev != NULL; dev = device_list_next(dev, MESS_DEVICE)) |
| 653 | for (dev = device_list_first(machine->config->devicelist, MESS_DEVICE); dev != NULL; dev = device_list_next(dev, MESS_DEVICE)) |
| 654 | 654 | { |
| 655 | 655 | iodev = mess_device_from_core_device(dev); |
| 656 | 656 | if ((iodev->tag != NULL) && !strcmp(iodev->tag, devtag) && (iodev->index_in_device == id)) |
src/mess/device.h
| r2256 | r2257 | |
| 298 | 298 | /* deprecated device access functions */ |
| 299 | 299 | int image_index_in_device(const device_config *device); |
| 300 | 300 | const device_config *image_from_device(const struct IODevice *iodev); |
| 301 | | const device_config *image_from_devtag_and_index(const char *devtag, int id); |
| 301 | const device_config *image_from_devtag_and_index(running_machine *machine, const char *devtag, int id); |
| 302 | 302 | |
| 303 | 303 | /* deprecated device access functions that assume one device of any given type */ |
| 304 | 304 | iodevice_t image_devtype(const device_config *device); |