Previous 199869 Revisions Next

r23744 Monday 17th June, 2013 at 09:37:37 UTC by Curt Coder
(MESS) corvushd: Fixed physical sector calculation. [Mike Naberezny]
[src/mess/machine]corvushd.c

trunk/src/mess/machine/corvushd.c
r23743r23744
5757//  TODO:
5858//      Implement READY line glitch after last byte of command (Disk System Tech Ref pp. 3)
5959//      Implement Read-after-Write (always happens on Rev B/H drives per Mass Storage GTI pp. 12)
60//      Implement Multiple physical drive support - Up to four
6160//      Implement Drive Illegal Addresses (seek past last sector)
6261//      Implement Switches on front of drive (LSI-11, MUX, Format, Reset)
6362//      Implement an inter-sector delay during the FORMAT command (format happens too quickly now)
r23743r23744
466465         case PREP_MODE_SELECT:
467466            c->recv_bytes = corvus_cmd[data][0].recv_bytes;
468467            c->xmit_bytes = corvus_cmd[data][0].xmit_bytes;
469            LOG(("parse_hdc_command: Single byte command recoginized: 0x%2.2x, to recv: %d, to xmit: %d\n", data,
468            LOG(("parse_hdc_command: Single byte command recognized: 0x%2.2x, to recv: %d, to xmit: %d\n", data,
470469               c->recv_bytes, c->xmit_bytes));
471470            break;
472471         //
r23743r23744
489488      //  case DELACTIVENUM_OMNI_CODE:
490489      //  case FINDACTIVE_CODE:
491490            c->awaiting_modifier = TRUE;
492            LOG(("parse_hdc_command: Double byte command recoginized: 0x%2.2x\n", data));
491            LOG(("parse_hdc_command: Double byte command recognized: 0x%2.2x\n", data));
493492            break;
494493
495494         default:                            // This is an INVALID command
r23743r23744
624623   LOG(("corvus_write_logical_sector: Writing based on DADR: 0x%6.6x, logical sector: 0x%5.5x, drive: %d\n",
625624      dadr->address_msn_and_drive << 16 | dadr->address_lsb << 8 | dadr->address_mid, sector, drv));
626625
626   // Set up the global corvus_hdc so c->tracks_per_cylinder and c->sectors_per_track are valid
627   corvus_hdc_file(machine, drv);
628
627629   //
628630   // Shift the logical sector address forward by the number of firmware cylinders (2) + the number of spare tracks (7)
629631   //
r23743r23744
722724   LOG(("corvus_read_logical_sector: Reading based on DADR: 0x%6.6x, logical sector: 0x%5.5x, drive: %d\n",
723725      dadr->address_msn_and_drive << 16 | dadr->address_lsb << 8 | dadr->address_mid, sector, drv));
724726
727   // Set up the global corvus_hdc so c->tracks_per_cylinder and c->sectors_per_track are valid
728   corvus_hdc_file(machine, drv);
729
725730   //
726731   // Shift the logical sector address forward by the number of firmware cylinders (2) + the number of spare tracks (7)
727732   //
r23743r23744
11211126   UINT8   status = 0;
11221127   UINT8   tbuffer[512];
11231128
1129   // Set up the global corvus_hdc so c->tracks_per_cylinder and c->sectors_per_track are valid
1130   corvus_hdc_file(machine, 0);
1131
11241132   max_sector = c->sectors_per_track * c->tracks_per_cylinder * c->cylinders_per_drive;
11251133
11261134   //
r23743r23744
11781186   if (!img->exists())
11791187      return NULL;
11801188
1181    // Pick up the Head/Cylinder/Sector info
1182    hard_disk_file *file = img->get_hard_disk_file();
1183      hard_disk_info *info = hard_disk_get_info(file);
1189   // Pick up the Head/Cylinder/Sector info
1190   hard_disk_file *file = img->get_hard_disk_file();
1191   hard_disk_info *info = hard_disk_get_info(file);
11841192   c->sectors_per_track = info->sectors;
11851193   c->tracks_per_cylinder = info->heads;
11861194   c->cylinders_per_drive = info->cylinders;
11871195
1188   LOG(("corvus_hdc_init: Attached to drive %u image: H:%d, C:%d, S:%d\n", id, info->heads, info->cylinders, info->sectors));
1196   LOG(("corvus_hdc_file: Attached to drive %u image: H:%d, C:%d, S:%d\n", id, info->heads, info->cylinders, info->sectors));
11891197
11901198   return file;
11911199}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team