Added Offset to GD-Rom 0x11 & 0x12

This commit is contained in:
Angelo Salese 2013-08-18 12:14:09 +00:00
parent c0fc551ede
commit 129ed15156
3 changed files with 10 additions and 14 deletions

View File

@ -119,12 +119,14 @@ void gdrom_device::ExecCommand( int *transferLength )
command[2], command[3], command[2], command[3],
command[4], command[5]); command[4], command[5]);
// if (SCSILengthFromUINT8( &command[ 4 ] ) < 32) return -1; // if (SCSILengthFromUINT8( &command[ 4 ] ) < 32) return -1;
*transferLength = 32; //SCSILengthFromUINT8( &command[ 4 ] ); transferOffset = command[2];
*transferLength = SCSILengthFromUINT8( &command[ 4 ] );
break; break;
case 0x12: // INQUIRY case 0x12: // INQUIRY
logerror("GDROM: REQUEST SENSE\n"); logerror("GDROM: REQUEST SENSE\n");
SetPhase( SCSI_PHASE_DATAIN ); SetPhase( SCSI_PHASE_DATAIN );
transferOffset = command[2];
*transferLength = SCSILengthFromUINT8( &command[ 4 ] ); *transferLength = SCSILengthFromUINT8( &command[ 4 ] );
break; break;
@ -460,20 +462,12 @@ void gdrom_device::ReadData( UINT8 *data, int dataLength )
case 0x11: // REQ_MODE case 0x11: // REQ_MODE
printf("REQ_MODE: dataLength %d\n", dataLength); printf("REQ_MODE: dataLength %d\n", dataLength);
memcpy(data, &GDROM_Cmd11_Reply[0], (dataLength >= 32) ? 32 : dataLength); memcpy(data, &GDROM_Cmd11_Reply[transferOffset], (dataLength >= 32-transferOffset) ? 32-transferOffset : dataLength);
break; break;
case 0x12: // INQUIRY case 0x12: // INQUIRY
memset( data, 0, dataLength ); //memset( data, 0, dataLength );
data[0] = 0x05; // device is present, device is CD/DVD (MMC-3) memcpy(data, &GDROM_Cmd11_Reply[transferOffset], (dataLength >= 32-transferOffset) ? 32-transferOffset : dataLength);
data[1] = 0x80; // media is removable
data[2] = 0x05; // device complies with SPC-3 standard
data[3] = 0x02; // response data format = SPC-3 standard
// some Konami games freak out if this isn't "Sony", so we'll lie
// this is the actual drive on my Nagano '98 board
strcpy((char *)&data[8], "Sony");
strcpy((char *)&data[16], "CDU-76S");
strcpy((char *)&data[32], "1.0");
break; break;
case 0x25: // READ CAPACITY case 0x25: // READ CAPACITY

View File

@ -43,6 +43,7 @@ private:
UINT32 play_err_flag; UINT32 play_err_flag;
UINT32 read_type; // for command 0x30 only UINT32 read_type; // for command 0x30 only
UINT32 data_select; // for command 0x30 only UINT32 data_select; // for command 0x30 only
UINT32 transferOffset;
cdrom_file *cdrom; cdrom_file *cdrom;
optional_device<cdda_device> m_cdda; optional_device<cdda_device> m_cdda;
bool is_file; bool is_file;

View File

@ -63,8 +63,9 @@
#define ATAPI_REG_MAX 24 #define ATAPI_REG_MAX 24
#define ATAPI_XFER_PIO 0x00 #define ATAPI_XFER_PIO 0x00
#define ATAPI_XFER_PIO_FLOW 0x08 #define ATAPI_XFER_PIO_FLOW 0x08
#define ATAPI_XFER_SINGLE_DMA 0x10
#define ATAPI_XFER_MULTI_DMA 0x20 #define ATAPI_XFER_MULTI_DMA 0x20
#define ATAPI_XFER_ULTRA_DMA 0x40 #define ATAPI_XFER_ULTRA_DMA 0x40