diff --git a/src/emu/imagedev/cassette.c b/src/emu/imagedev/cassette.c index 735327c4f47..d288dd0af05 100644 --- a/src/emu/imagedev/cassette.c +++ b/src/emu/imagedev/cassette.c @@ -50,6 +50,12 @@ INLINE dev_cassette_t *get_safe_token(device_t *device) return (dev_cassette_t *) downcast(device)->token(); } +INLINE const inline_cassette_config *get_config_dev(const device_config *device) +{ + assert(device != NULL); + assert(device->type() == CASSETTE); + return (const inline_cassette_config *)downcast(device)->inline_config(); +} /********************************************************************* cassette IO @@ -410,7 +416,7 @@ DEVICE_GET_INFO(cassette) { /* --- the following bits of info are returned as 64-bit signed integers --- */ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(dev_cassette_t); break; - case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; + case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(inline_cassette_config); break; case DEVINFO_INT_IMAGE_TYPE: info->i = IO_CASSETTE; break; case DEVINFO_INT_IMAGE_READABLE: info->i = 1; break; case DEVINFO_INT_IMAGE_WRITEABLE: info->i = 1; break; @@ -422,6 +428,13 @@ DEVICE_GET_INFO(cassette) case DEVINFO_FCT_IMAGE_UNLOAD: info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(cassette); break; case DEVINFO_FCT_IMAGE_DISPLAY: info->f = (genf *) DEVICE_IMAGE_DISPLAY_NAME(cassette); break; case DEVINFO_FCT_IMAGE_SOFTLIST_LOAD: info->f = (genf *) DEVICE_IMAGE_SOFTLIST_LOAD_NAME(cassette); break; + case DEVINFO_FCT_IMAGE_DISPLAY_INFO: + if ( device && downcast(device)->inline_config() && get_config_dev(device)->device_displayinfo) { + info->f = (genf *) get_config_dev(device)->device_displayinfo; + } else { + info->f = NULL; + } + break; /* --- the following bits of info are returned as NULL-terminated strings --- */ case DEVINFO_STR_NAME: strcpy(info->s, "Cassette"); break; diff --git a/src/emu/imagedev/cassette.h b/src/emu/imagedev/cassette.h index 52a8ffd625d..ad07955ba15 100644 --- a/src/emu/imagedev/cassette.h +++ b/src/emu/imagedev/cassette.h @@ -49,6 +49,11 @@ struct cassette_config_t const char * interface; }; +typedef struct inline_cassette_config_t inline_cassette_config; +struct inline_cassette_config_t +{ + device_image_display_info_func device_displayinfo; +}; /*************************************************************************** FUNCTION PROTOTYPES @@ -80,6 +85,9 @@ DECLARE_LEGACY_IMAGE_DEVICE(CASSETTE, cassette); MCFG_DEVICE_MODIFY(_tag) \ MCFG_DEVICE_CONFIG(_config) +#define MCFG_CASSETTE_DISPLAY_INFO(_displayinfo) \ + MCFG_DEVICE_CONFIG_DATAPTR(inline_cassette_config, device_displayinfo, DEVICE_IMAGE_DISPLAY_INFO_NAME(_displayinfo)) + extern const cassette_config default_cassette_config; #endif /* CASSETTE_H */ diff --git a/src/emu/imagedev/flopdrv.c b/src/emu/imagedev/flopdrv.c index 70b019cd9ce..58cbd39fcc4 100644 --- a/src/emu/imagedev/flopdrv.c +++ b/src/emu/imagedev/flopdrv.c @@ -127,6 +127,13 @@ INLINE floppy_drive *get_safe_token(device_t *device) return (floppy_drive *) downcast(device)->token(); } +INLINE const inline_floppy_config *get_config_dev(const device_config *device) +{ + assert(device != NULL); + assert( device->type() == FLOPPY || device->type() == FLOPPY_APPLE || device->type() == FLOPPY_SONY); + return (const inline_floppy_config *)downcast(device)->inline_config(); +} + floppy_image *flopimg_get_image(device_t *image) { return get_safe_token(image)->floppy; @@ -963,7 +970,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 = 0; break; + case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(inline_floppy_config); 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; @@ -987,6 +994,14 @@ DEVICE_GET_INFO(floppy) case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME(floppy); break; case DEVINFO_FCT_IMAGE_UNLOAD: info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(floppy); break; case DEVINFO_FCT_IMAGE_SOFTLIST_LOAD: info->f = (genf *) DEVICE_IMAGE_SOFTLIST_LOAD_NAME(floppy); break; + case DEVINFO_FCT_IMAGE_DISPLAY_INFO: + if ( device && downcast(device)->inline_config() && get_config_dev(device)->device_displayinfo) { + info->f = (genf *) get_config_dev(device)->device_displayinfo; + } else { + info->f = NULL; + } + break; + case DEVINFO_PTR_IMAGE_CREATE_OPTGUIDE: info->p = (void *)floppy_option_guide; break; case DEVINFO_INT_IMAGE_CREATE_OPTCOUNT: { diff --git a/src/emu/imagedev/flopdrv.h b/src/emu/imagedev/flopdrv.h index d9c8f2203e6..7f9d8efb80f 100644 --- a/src/emu/imagedev/flopdrv.h +++ b/src/emu/imagedev/flopdrv.h @@ -55,6 +55,12 @@ struct floppy_type_t UINT8 max_density; }; +typedef struct inline_floppy_config_t inline_floppy_config; +struct inline_floppy_config_t +{ + device_image_display_info_func device_displayinfo; +}; + typedef struct floppy_config_t floppy_config; struct floppy_config_t { @@ -242,4 +248,23 @@ extern DEVICE_IMAGE_UNLOAD( floppy ); MCFG_DEVICE_REMOVE(FLOPPY_0) \ MCFG_DEVICE_REMOVE(FLOPPY_1) +#define MCFG_FLOPPY_DRIVE_DISPLAY_INFO(_displayinfo) \ + MCFG_DEVICE_CONFIG_DATAPTR(inline_floppy_config, device_displayinfo, DEVICE_IMAGE_DISPLAY_INFO_NAME(_displayinfo)) + +#define MCFG_FLOPPY_2_DRIVES_DISPLAY_INFO(_displayinfo) \ + MCFG_DEVICE_MODIFY(FLOPPY_0) \ + MCFG_DEVICE_CONFIG_DATAPTR(inline_floppy_config, device_displayinfo, DEVICE_IMAGE_DISPLAY_INFO_NAME(_displayinfo)) \ + MCFG_DEVICE_MODIFY(FLOPPY_1) \ + MCFG_DEVICE_CONFIG_DATAPTR(inline_floppy_config, device_displayinfo, DEVICE_IMAGE_DISPLAY_INFO_NAME(_displayinfo)) + +#define MCFG_FLOPPY_4_DRIVES_DISPLAY_INFO(_displayinfo) \ + MCFG_DEVICE_MODIFY(FLOPPY_0) \ + MCFG_DEVICE_CONFIG_DATAPTR(inline_floppy_config, device_displayinfo, DEVICE_IMAGE_DISPLAY_INFO_NAME(_displayinfo)) \ + MCFG_DEVICE_MODIFY(FLOPPY_1) \ + MCFG_DEVICE_CONFIG_DATAPTR(inline_floppy_config, device_displayinfo, DEVICE_IMAGE_DISPLAY_INFO_NAME(_displayinfo)) \ + MCFG_DEVICE_MODIFY(FLOPPY_2) \ + MCFG_DEVICE_CONFIG_DATAPTR(inline_floppy_config, device_displayinfo, DEVICE_IMAGE_DISPLAY_INFO_NAME(_displayinfo)) \ + MCFG_DEVICE_MODIFY(FLOPPY_3) \ + MCFG_DEVICE_CONFIG_DATAPTR(inline_floppy_config, device_displayinfo, DEVICE_IMAGE_DISPLAY_INFO_NAME(_displayinfo)) + #endif /* __FLOPDRV_H__ */