summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/imagedev/flopdrv.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2011-04-27 05:11:18 +0000
committer Aaron Giles <aaron@aarongiles.com>2011-04-27 05:11:18 +0000
commit919913f118760c0ca41ab63512bd5c106f6fd840 (patch)
treecd6c115c8e9c5280ac4bd16eabfe69c7341151c2 /src/emu/imagedev/flopdrv.c
parent84f2c31f7d6f6c667427b1d60c83e6dc9f420d60 (diff)
Collapsed device_config and device_t into one class. Updated all
existing modern devices and the legacy wrappers to work in this environment. This in general greatly simplifies writing a modern device. [Aaron Giles] General notes: * some more cleanup probably needs to happen behind this change, but I needed to get it in before the next device modernization or import from MESS :) * new template function device_creator which automatically defines the static function that creates the device; use this instead of creating a static_alloc_device_config function * added device_stop() method which is called at around the time the previous device_t's destructor was called; if you auto_free anything, do it here because the machine is gone when the destructor is called * changed the static_set_* calls to pass a device_t & instead of a device_config * * for many devices, the static config structure member names over- lapped the device's names for devcb_* functions; in these cases the members in the interface were renamed to have a _cb suffix * changed the driver_enumerator to only cache 100 machine_configs because caching them all took a ton of memory; fortunately this implementation detail is completely hidden behind the driver_enumerator interface * got rid of the macros for creating derived classes; doing it manually is now clean enough that it isn't worth hiding the details in a macro
Diffstat (limited to 'src/emu/imagedev/flopdrv.c')
-rw-r--r--src/emu/imagedev/flopdrv.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/emu/imagedev/flopdrv.c b/src/emu/imagedev/flopdrv.c
index 43e7cb83221..264255bddc6 100644
--- a/src/emu/imagedev/flopdrv.c
+++ b/src/emu/imagedev/flopdrv.c
@@ -127,11 +127,11 @@ 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_config *device)
+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_config_base *>(device)->inline_config();
+ return (const inline_floppy_config *)downcast<const legacy_device_base *>(device)->inline_config();
}
floppy_image *flopimg_get_image(device_t *image)
@@ -224,7 +224,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->baseconfig().static_config())->floppy_type);
+ floppy_drive_set_geometry(img, ((floppy_config*)img->static_config())->floppy_type);
/* initialise id index - not so important */
pDrive->id_index = 0;
@@ -572,7 +572,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->baseconfig().static_config();
+ floppy->config = (const floppy_config*)device->static_config();
floppy_drive_init(device);
floppy->drive_id = floppy_get_drive(device);
@@ -614,7 +614,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().baseconfig().static_config())->formats;
+ floppy_options = ((floppy_config*)image->device().static_config())->formats;
if (image->has_been_created())
{
@@ -995,7 +995,7 @@ DEVICE_GET_INFO(floppy)
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<const legacy_image_device_config_base *>(device)->inline_config() && get_config_dev(device)->device_displayinfo) {
+ 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;
} else {
info->f = NULL;