int floppy_get_drive_by_type(device_t *image,int ftype) { int i,drive =0; for (i=0;i<4;i++) { device_t *disk = floppy_get_device(image->machine(),i); if (floppy_get_drive_type(disk)==ftype) { if (image==disk) { return drive; } drive++; } } return drive; }
device_t *floppy_get_device_by_type(running_machine &machine,int ftype,int drive) { int i; int cnt = 0; for (i=0;i<4;i++) { device_t *disk = floppy_get_device(machine,i); if (floppy_get_drive_type(disk)==ftype) { if (cnt==drive) { return disk; } cnt++; } } return NULL; }
device_t *apple525_get_device_by_type(device_t *device, int ftype, int drive) { int i; int cnt = 0; for (i=0;i<4;i++) { device_t *disk = apple525_get_subdevice(device, i); if (floppy_get_drive_type(disk)==ftype) { if (cnt==drive) { return disk; } cnt++; } } return NULL; }