diff options
Diffstat (limited to 'src/emu/imagedev/flopdrv.c')
-rw-r--r-- | src/emu/imagedev/flopdrv.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/emu/imagedev/flopdrv.c b/src/emu/imagedev/flopdrv.c index 36e772216d0..19282aab650 100644 --- a/src/emu/imagedev/flopdrv.c +++ b/src/emu/imagedev/flopdrv.c @@ -57,7 +57,7 @@ struct _floppy_drive int drive_id; int active; - const floppy_config *config; + const floppy_interface *config; /* flags */ int flags; @@ -127,13 +127,6 @@ INLINE floppy_drive *get_safe_token(device_t *device) return (floppy_drive *) downcast<legacy_device_base *>(device)->token(); } -INLINE const inline_floppy_config *get_config_dev(const device_t *device) -{ - assert(device != NULL); - assert( device->type() == FLOPPY || device->type() == FLOPPY_APPLE || device->type() == FLOPPY_SONY); - return (const inline_floppy_config *)downcast<const legacy_device_base *>(device)->inline_config(); -} - floppy_image *flopimg_get_image(device_t *image) { return get_safe_token(image)->floppy; @@ -224,7 +217,7 @@ static void floppy_drive_init(device_t *img) pDrive->index_timer = img->machine().scheduler().timer_alloc(FUNC(floppy_drive_index_callback), (void *) img); pDrive->idx = 0; - floppy_drive_set_geometry(img, ((floppy_config*)img->static_config())->floppy_type); + floppy_drive_set_geometry(img, ((floppy_interface*)img->static_config())->floppy_type); /* initialise id index - not so important */ pDrive->id_index = 0; @@ -572,7 +565,7 @@ void floppy_drive_set_controller(device_t *img, device_t *controller) DEVICE_START( floppy ) { floppy_drive *floppy = get_safe_token( device ); - floppy->config = (const floppy_config*)device->static_config(); + floppy->config = (const floppy_interface*)device->static_config(); floppy_drive_init(device); floppy->drive_id = floppy_get_drive(device); @@ -614,7 +607,7 @@ static int internal_floppy_device_load(device_image_interface *image, int create flopimg = get_safe_token( &image->device() ); /* figure out the floppy options */ - floppy_options = ((floppy_config*)image->device().static_config())->formats; + floppy_options = ((floppy_interface*)image->device().static_config())->formats; if (image->has_been_created()) { @@ -973,7 +966,7 @@ DEVICE_GET_INFO(floppy) { /* --- the following bits of info are returned as 64-bit signed integers --- */ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(floppy_drive); break; - case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(inline_floppy_config); break; + case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; case DEVINFO_INT_IMAGE_TYPE: info->i = IO_FLOPPY; break; case DEVINFO_INT_IMAGE_READABLE: info->i = 1; break; case DEVINFO_INT_IMAGE_WRITEABLE: info->i = 1; break; @@ -982,7 +975,7 @@ DEVICE_GET_INFO(floppy) int cnt = 0; if ( device && device->static_config() ) { - const struct FloppyFormat *floppy_options = ((floppy_config*)device->static_config())->formats; + const struct FloppyFormat *floppy_options = ((floppy_interface*)device->static_config())->formats; int i; for ( i = 0; floppy_options[i].construct; i++ ) { if(floppy_options[i].param_guidelines) cnt++; @@ -1001,8 +994,8 @@ DEVICE_GET_INFO(floppy) if (device->type() == FLOPPY_APPLE) { info->f = NULL; } else { - if ( device && downcast<const legacy_image_device_base *>(device)->inline_config() && get_config_dev(device)->device_displayinfo) { - info->f = (genf *) get_config_dev(device)->device_displayinfo; + if ( device && downcast<const legacy_image_device_base *>(device)->static_config() && ((floppy_interface*)(device))->device_displayinfo) { + info->f = (genf *) ((floppy_interface*)(device))->device_displayinfo; } else { info->f = NULL; } @@ -1012,7 +1005,7 @@ DEVICE_GET_INFO(floppy) case DEVINFO_PTR_IMAGE_CREATE_OPTGUIDE: info->p = (void *)floppy_option_guide; break; case DEVINFO_INT_IMAGE_CREATE_OPTCOUNT: { - const struct FloppyFormat *floppy_options = ((floppy_config*)device->static_config())->formats; + const struct FloppyFormat *floppy_options = ((floppy_interface*)device->static_config())->formats; int count; for (count = 0; floppy_options[count].construct; count++) ; @@ -1027,7 +1020,7 @@ DEVICE_GET_INFO(floppy) case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: if ( device && device->static_config() ) { - const struct FloppyFormat *floppy_options = ((floppy_config*)device->static_config())->formats; + const struct FloppyFormat *floppy_options = ((floppy_interface*)device->static_config())->formats; int i; /* set up a temporary string */ info->s[0] = '\0'; @@ -1036,16 +1029,16 @@ DEVICE_GET_INFO(floppy) } break; case DEVINFO_STR_IMAGE_INTERFACE: - if ( device && device->static_config() && ((floppy_config *)device->static_config())->interface) + if ( device && device->static_config() && ((floppy_interface *)device->static_config())->interface) { - strcpy(info->s, ((floppy_config *)device->static_config())->interface ); + strcpy(info->s, ((floppy_interface *)device->static_config())->interface ); } break; default: { if ( device && device->static_config() ) { - const struct FloppyFormat *floppy_options = ((floppy_config*)device->static_config())->formats; + const struct FloppyFormat *floppy_options = ((floppy_interface*)device->static_config())->formats; if ((state >= DEVINFO_PTR_IMAGE_CREATE_OPTSPEC) && (state < DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + DEVINFO_IMAGE_CREATE_OPTMAX)) { info->p = (void *) floppy_options[state - DEVINFO_PTR_IMAGE_CREATE_OPTSPEC].param_guidelines; } else if ((state >= DEVINFO_STR_IMAGE_CREATE_OPTNAME) && (state < DEVINFO_STR_IMAGE_CREATE_OPTNAME + DEVINFO_IMAGE_CREATE_OPTMAX)) { |