Previous 15994 Revisions Next

r8193 Monday 31st May, 2010 at 22:19:13 UTC by R. Belmont
[TI99] Don't crash with new IDE semantics.
[src/emu/machine]idectrl.c

src/emu/machine/idectrl.c
r8192r8193
19121912   if (!ide->disk)
19131913   {
19141914      ide->handle = mess_hd_get_chd_file( device->machine->device( "harddisk" ) );   // should be config->master
1915      ide->disk = mess_hd_get_hard_disk_file( device->machine->device( "harddisk" ) );   // should be config->master
19161915
1917      if (ide->disk != NULL)
1916      if (ide->handle)
19181917      {
1919         const hard_disk_info *hdinfo;
1918         ide->disk = mess_hd_get_hard_disk_file( device->machine->device( "harddisk" ) );   // should be config->master
19201919
1921         hdinfo = hard_disk_get_info(ide->disk);
1922         if (hdinfo->sectorbytes == IDE_DISK_SECTOR_SIZE)
1920         if (ide->disk != NULL)
19231921         {
1924            ide->num_cylinders = hdinfo->cylinders;
1925            ide->num_sectors = hdinfo->sectors;
1926            ide->num_heads = hdinfo->heads;
1927            if (PRINTF_IDE_COMMANDS) printf("CHS: %d %d %d\n", ide->num_cylinders, ide->num_heads, ide->num_sectors);
1922            const hard_disk_info *hdinfo;
1923
1924            hdinfo = hard_disk_get_info(ide->disk);
1925            if (hdinfo->sectorbytes == IDE_DISK_SECTOR_SIZE)
1926            {
1927               ide->num_cylinders = hdinfo->cylinders;
1928               ide->num_sectors = hdinfo->sectors;
1929               ide->num_heads = hdinfo->heads;
1930               if (PRINTF_IDE_COMMANDS) printf("CHS: %d %d %d\n", ide->num_cylinders, ide->num_heads, ide->num_sectors);
1931            }
1932
1933            /* build the features page */
1934            ide_build_features(ide);
19281935         }
1929
1930         /* build the features page */
1931         ide_build_features(ide);
19321936      }
19331937   }
19341938#endif

Previous 15994 Revisions Next


© 1998-2018 The MESS Team