Previous 15994 Revisions Next

r2660 Sunday 18th May, 2008 at 19:17:51 UTC by Wilbert Pol
[PC_HDC] SENSE command fixes. The hard disk emulation now works under ibm5160; but fdisk will see 2 hard drives when only one is mounted in the ibm5150 driver.
[src/mess/machine]pc_hdc.c

src/mess/machine/pc_hdc.c
r2659r2660
478478   int n = param;
479479   int set_error_info = 1;
480480   int old_error = error[n];         /* Previous error data is needed for CMD_SENSE */
481   int old_csb = csb[n];
482481   UINT8 cmd;
483482   const char *command_name;
484483
r2659r2660
500499   switch (cmd)
501500   {
502501      case CMD_TESTREADY:
503         set_error_info = 0;
504         test_ready(n);
502         /*
503          * Commenting out these 2 lines below make the hard disk controller work
504          * under the ibm5160 drivers. But this does make one hard disk show up
505          * twice in the ibm5150 driver. This is something that will need to be
506          * fixed with time.
507          */
508//         set_error_info = 0;
509//         test_ready(n);
505510            break;
506511      case CMD_SENSE:
507         error[n] = old_error;
508         csb[n] = old_csb;
509512         /* Perform error code translation. This may need to be expanded in the future. */
510         buffer[data_cnt++] = ( error[n] & 0xC0 ) | ( ( error[n] & 0x04 ) ? 0x04 : 0x00 ) ;
513         buffer[data_cnt++] = ( old_error & 0xC0 ) | ( ( old_error & 0x04 ) ? 0x04 : 0x00 ) ;
511514         buffer[data_cnt++] = (drv << 5) | head[idx];
512515         buffer[data_cnt++] = ((cylinder[idx] >> 2) & 0xc0) | sector[idx];
513516         buffer[data_cnt++] = cylinder[idx] & 0xff;
r2659r2660
515518         break;
516519      case CMD_RECALIBRATE:
517520         get_chsn(n);
518         test_ready(n);
519         set_error_info = 0;
520521            break;
521522
522523      case CMD_FORMATDRV:

Previous 15994 Revisions Next


© 1998-2018 The MESS Team