Implemented ATAPI and SCSI SEEK (6) command.

This commit is contained in:
OBattler
2016-12-29 20:49:01 +01:00
parent 03ee24cc6c
commit a0b7d55312
3 changed files with 20 additions and 2 deletions

View File

@@ -2692,8 +2692,16 @@ atapi_out:
idecallback[ide_board]=50*IDE_TIME;
break;
case GPCMD_SEEK_6:
case GPCMD_SEEK:
pos=(idebufferb[3]<<16)|(idebufferb[4]<<8)|idebufferb[5];
if (idebufferb[0] == GPCMD_SEEK_6)
{
pos=(idebufferb[2]<<8)|idebufferb[3];
}
else
{
pos=(idebufferb[2]<<24)|(idebufferb[3]<<16)|(idebufferb[4]<<8)|idebufferb[5];
}
cdrom->seek(pos);
ide->packetstatus = ATAPI_STATUS_COMPLETE;
idecallback[ide_board]=50*IDE_TIME;

View File

@@ -14,6 +14,7 @@
#define GPCMD_TEST_UNIT_READY 0x00
#define GPCMD_REQUEST_SENSE 0x03
#define GPCMD_READ_6 0x08
#define GPCMD_SEEK_6 0x0B
#define GPCMD_INQUIRY 0x12
#define GPCMD_MODE_SELECT_6 0x15
#define GPCMD_MODE_SENSE_6 0x1a

View File

@@ -31,6 +31,7 @@ uint8_t SCSICommandTable[0x100] =
[GPCMD_PREVENT_REMOVAL] = CHECK_READY,
[GPCMD_READ_CDROM_CAPACITY] = CHECK_READY,
[GPCMD_READ_10] = CHECK_READY,
[GPCMD_SEEK_6] = CHECK_READY | NONDATA,
[GPCMD_SEEK] = CHECK_READY | NONDATA,
[GPCMD_READ_SUBCHANNEL] = CHECK_READY,
[GPCMD_READ_TOC_PMA_ATIP] = CHECK_READY | ALLOW_UA, /* Read TOC - can get through UNIT_ATTENTION, per VIDE-CDD.SYS
@@ -921,8 +922,16 @@ void SCSICDROM_Command(uint8_t id, uint8_t lun, uint8_t *cdb)
SCSIDMAResetPosition(id);
break;
case GPCMD_SEEK6:
case GPCMD_SEEK:
SCSIDevices[id].lba_pos = (cdb[3]<<16)|(cdb[4]<<8)|cdb[5];
if (cbd[0] == GPCMD_SEEK6)
{
SCSIDevices[id].lba_pos = (cdb[2]<<8)|cdb[3];
}
else
{
SCSIDevices[id].lba_pos = (cdb[2]<<24)|(cdb[3]<<16)|(cdb[4]<<8)|cdb[5];
}
cdrom->seek(SCSIDevices[id].lba_pos);
SCSIPhase = SCSI_PHASE_STATUS;