mirror of
https://github.com/holub/mame
synced 2025-05-21 13:18:56 +03:00
scsihd updates
- Fixed parameter interpretation for READ(10) and READ(12) - Added WRITE(10)
This commit is contained in:
parent
f952539eff
commit
98800d5b98
@ -77,17 +77,27 @@ static int scsihd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
|
||||
|
||||
case 0x28: // READ(10)
|
||||
our_this->lba = command[2]<<24 | command[3]<<16 | command[4]<<8 | command[5];
|
||||
our_this->blocks = command[6]<<24 | command[7]<<16 | command[8]<<8 | command[9];
|
||||
our_this->blocks = SCSILengthFromUINT16( &command[7] );
|
||||
|
||||
logerror("SCSIHD: READ at LBA %x for %x blocks\n", our_this->lba, our_this->blocks);
|
||||
|
||||
SCSISetPhase( scsiInstance, SCSI_PHASE_DATAIN );
|
||||
return our_this->blocks * 512;
|
||||
|
||||
case 0xa8: // READ(12)
|
||||
case 0x2a: // WRITE (10)
|
||||
our_this->lba = command[2]<<24 | command[3]<<16 | command[4]<<8 | command[5];
|
||||
our_this->blocks = SCSILengthFromUINT16( &command[7] );
|
||||
|
||||
logerror("SCSIHD: WRITE to LBA %x for %x blocks\n", our_this->lba, our_this->blocks);
|
||||
|
||||
SCSISetPhase( scsiInstance, SCSI_PHASE_DATAOUT );
|
||||
|
||||
return our_this->blocks * 512;
|
||||
|
||||
case 0xa8: // READ(12)
|
||||
our_this->lba = command[2]<<24 | command[3]<<16 | command[4]<<8 | command[5];
|
||||
our_this->blocks = command[6]<<24 | command[7]<<16 | command[8]<<8 | command[9];
|
||||
|
||||
logerror("SCSIHD: READ at LBA %x for %x blocks\n", our_this->lba, our_this->blocks);
|
||||
|
||||
SCSISetPhase( scsiInstance, SCSI_PHASE_DATAIN );
|
||||
@ -238,12 +248,12 @@ static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
|
||||
our_this->disk = mess_hd_get_hard_disk_file( devtag_get_device( machine, diskregion ) );
|
||||
#else
|
||||
our_this->disk = hard_disk_open(get_disk_handle( machine, diskregion ));
|
||||
#endif
|
||||
|
||||
if (!our_this->disk)
|
||||
{
|
||||
logerror("SCSIHD: no HD found!\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void scsihd_delete_instance( SCSIInstance *scsiInstance )
|
||||
|
Loading…
Reference in New Issue
Block a user