Previous 15994 Revisions Next

r11520 Thursday 12th May, 2011 at 14:43:13 UTC by Miodrag Milanović
There is no difference in handling ide hard drives and other hard drives (no whatsnew)
[src/emu/imagedev]harddriv.c harddriv.h
[src/mess/machine/ti99]ti99_hd.c

src/emu/imagedev/harddriv.c
r11519r11520
7979INLINE dev_harddisk_t *get_safe_token(device_t *device)
8080{
8181   assert( device != NULL );
82   assert( ( device->type() == HARDDISK ) ||
83           ( device->type() == IDE_HARDDISK ) );
82   assert( device->type() == HARDDISK);
8483   return (dev_harddisk_t *) downcast<legacy_device_base *>(device)->token();
8584}
8685
r11519r11520
311310   }
312311}
313312
314
315static 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
336static 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
362static 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
385DEVICE_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
403313DEFINE_LEGACY_IMAGE_DEVICE(HARDDISK, hd);
404DEFINE_LEGACY_IMAGE_DEVICE(IDE_HARDDISK, ide);
src/emu/imagedev/harddriv.h
r11519r11520
1313#include "harddisk.h"
1414
1515DECLARE_LEGACY_IMAGE_DEVICE(HARDDISK, hd);
16DECLARE_LEGACY_IMAGE_DEVICE(IDE_HARDDISK, ide);
1716
1817#define MCFG_HARDDISK_ADD(_tag) \
1918   MCFG_DEVICE_ADD(_tag, HARDDISK, 0) \
2019
21#define MCFG_IDE_HARDDISK_ADD(_tag) \
22   MCFG_DEVICE_ADD(_tag, IDE_HARDDISK, 0) \
23
2420hard_disk_file *hd_get_hard_disk_file(device_t *device);
2521chd_file *hd_get_chd_file(device_t *device);
2622
src/mess/machine/ti99/ti99_hd.c
r11519r11520
509509MACHINE_CONFIG_END
510510
511511MACHINE_CONFIG_FRAGMENT( idehd )
512   MCFG_DEVICE_ADD( "drive", IDE_HARDDISK, 0 )
512   MCFG_DEVICE_ADD( "drive", HARDDISK, 0 )
513513MACHINE_CONFIG_END
514514
515515static const char DEVTEMPLATE_SOURCE[] = __FILE__;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team