src/emu/imagedev/harddriv.c
| r11519 | r11520 | |
| 79 | 79 | INLINE dev_harddisk_t *get_safe_token(device_t *device) |
| 80 | 80 | { |
| 81 | 81 | assert( device != NULL ); |
| 82 | | assert( ( device->type() == HARDDISK ) || |
| 83 | | ( device->type() == IDE_HARDDISK ) ); |
| 82 | assert( device->type() == HARDDISK); |
| 84 | 83 | return (dev_harddisk_t *) downcast<legacy_device_base *>(device)->token(); |
| 85 | 84 | } |
| 86 | 85 | |
| r11519 | r11520 | |
| 311 | 310 | } |
| 312 | 311 | } |
| 313 | 312 | |
| 314 | | |
| 315 | | static DEVICE_START(ide) |
| 316 | | { |
| 317 | | /* old code from idedrive.c */ |
| 318 | | #ifdef UNUSED_FUNCTION |
| 319 | | int which_bus, which_address; |
| 320 | | struct ide_interface *intf; |
| 321 | | device_start_func parent_init; |
| 322 | | |
| 323 | | /* get the basics */ |
| 324 | | ide_get_params(device, &which_bus, &which_address, &intf, &parent_init, NULL, NULL); |
| 325 | | |
| 326 | | /* call the parent init function */ |
| 327 | | parent_init(device); |
| 328 | | |
| 329 | | /* configure IDE */ |
| 330 | | /* FIXME IDE */ |
| 331 | | /* ide_controller_init_custom(which_bus, intf, NULL); */ |
| 332 | | #endif |
| 333 | | } |
| 334 | | |
| 335 | | |
| 336 | | static DEVICE_IMAGE_LOAD(ide) |
| 337 | | { |
| 338 | | /* old code from idedrive.c */ |
| 339 | | #ifdef UNUSED_FUNCTION |
| 340 | | int result, which_bus, which_address; |
| 341 | | struct ide_interface *intf; |
| 342 | | device_image_load_func parent_load; |
| 343 | | |
| 344 | | /* get the basics */ |
| 345 | | ide_get_params(image, &which_bus, &which_address, &intf, NULL, &parent_load, NULL); |
| 346 | | |
| 347 | | /* call the parent load function */ |
| 348 | | result = parent_load(image); |
| 349 | | if (result != IMAGE_INIT_PASS) |
| 350 | | return result; |
| 351 | | |
| 352 | | /* configure IDE */ |
| 353 | | /* FIXME IDE */ |
| 354 | | /* ide_controller_init_custom(which_bus, intf, hd_get_chd_file(image)); */ |
| 355 | | /* ide_controller_reset(which_bus); */ |
| 356 | | return IMAGE_INIT_PASS; |
| 357 | | #endif |
| 358 | | return device_load_hd( image ); |
| 359 | | } |
| 360 | | |
| 361 | | |
| 362 | | static DEVICE_IMAGE_UNLOAD(ide) |
| 363 | | { |
| 364 | | /* old code from idedrive.c */ |
| 365 | | #ifdef UNUSED_FUNCTION |
| 366 | | int which_bus, which_address; |
| 367 | | struct ide_interface *intf; |
| 368 | | device_image_unload_func parent_unload; |
| 369 | | |
| 370 | | /* get the basics */ |
| 371 | | ide_get_params(image, &which_bus, &which_address, &intf, NULL, NULL, &parent_unload); |
| 372 | | |
| 373 | | /* call the parent unload function */ |
| 374 | | parent_unload(image); |
| 375 | | |
| 376 | | /* configure IDE */ |
| 377 | | /* FIXME IDE */ |
| 378 | | /* ide_controller_init_custom(which_bus, intf, NULL); */ |
| 379 | | /* ide_controller_reset(which_bus); */ |
| 380 | | #endif |
| 381 | | device_unload_hd( image ); |
| 382 | | } |
| 383 | | |
| 384 | | |
| 385 | | DEVICE_GET_INFO(ide) |
| 386 | | { |
| 387 | | switch( state ) |
| 388 | | { |
| 389 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 390 | | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(ide); break; |
| 391 | | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME(ide); break; |
| 392 | | case DEVINFO_FCT_IMAGE_UNLOAD: info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(ide); break; |
| 393 | | |
| 394 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 395 | | case DEVINFO_STR_NAME: strcpy(info->s, "IDE harddisk"); break; |
| 396 | | case DEVINFO_STR_IMAGE_INSTANCE_NAME: strcpy(info->s, "ideharddrive"); break; |
| 397 | | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: strcpy(info->s, "idehd"); break; |
| 398 | | |
| 399 | | default: DEVICE_GET_INFO_CALL( hd ); break; |
| 400 | | } |
| 401 | | } |
| 402 | | |
| 403 | 313 | DEFINE_LEGACY_IMAGE_DEVICE(HARDDISK, hd); |
| 404 | | DEFINE_LEGACY_IMAGE_DEVICE(IDE_HARDDISK, ide); |