Fixed a compile-breaking error.

This commit is contained in:
OBattler
2017-01-21 01:58:48 +01:00
parent 45183ea026
commit 4486926b6d
2 changed files with 19 additions and 11 deletions

View File

@@ -1612,11 +1612,11 @@ static void BuslogicSenseBufferFree(BuslogicRequests_t *BuslogicRequests, int Co
uint8_t temp_sense[256]; uint8_t temp_sense[256];
cdrom_request_sense_for_scsi(cdrom_id, temp_sense, SenseLength);
if (SenseLength && Copy) if (SenseLength && Copy)
{ {
uint32_t SenseBufferAddress; uint32_t SenseBufferAddress;
cdrom_request_sense_for_scsi(cdrom_id, temp_sense, SenseLength);
/*The sense address, in 32-bit mode, is located in the Sense Pointer of the CCB, but in /*The sense address, in 32-bit mode, is located in the Sense Pointer of the CCB, but in
24-bit mode, it is located at the end of the Command Descriptor Block. */ 24-bit mode, it is located at the end of the Command Descriptor Block. */

View File

@@ -1551,6 +1551,20 @@ void cdrom_reset(uint8_t id)
cdrom[id].unit_attention = 0; cdrom[id].unit_attention = 0;
} }
void cdrom_playing_completed(uint8_t id)
{
cdrom[id].prev_status = cdrom[id].cd_status;
cdrom[id].cd_status = cdrom_drives[id].handler->status(id);
if (((cdrom[id].prev_status == CD_STATUS_PLAYING) || (cdrom[id].prev_status == CD_STATUS_PAUSED)) && ((cdrom[id].cd_status != CD_STATUS_PLAYING) && (cdrom[id].cd_status != CD_STATUS_PAUSED)))
{
return 1;
}
else
{
return 0;
}
}
void cdrom_request_sense(uint8_t id, uint8_t *buffer, uint8_t alloc_length) void cdrom_request_sense(uint8_t id, uint8_t *buffer, uint8_t alloc_length)
{ {
/*Will return 18 bytes of 0*/ /*Will return 18 bytes of 0*/
@@ -1562,7 +1576,7 @@ void cdrom_request_sense(uint8_t id, uint8_t *buffer, uint8_t alloc_length)
buffer[0] = 0x70; buffer[0] = 0x70;
if ((cdrom_sense_key > 0) && ((cdrom[id].cd_status < CD_STATUS_PLAYING) || (cdrom[id].cd_status == CD_STATUS_STOPPED)) && cdrom[id].completed) if ((cdrom_sense_key > 0) && ((cdrom[id].cd_status < CD_STATUS_PLAYING) || (cdrom[id].cd_status == CD_STATUS_STOPPED)) && cdrom_playing_completed(id))
{ {
buffer[2]=SENSE_ILLEGAL_REQUEST; buffer[2]=SENSE_ILLEGAL_REQUEST;
buffer[12]=ASC_AUDIO_PLAY_OPERATION; buffer[12]=ASC_AUDIO_PLAY_OPERATION;
@@ -1702,15 +1716,9 @@ void cdrom_command(uint8_t id, uint8_t *cdb)
return; return;
} }
cdrom[id].prev_status = cdrom[id].cd_status; if (cdb[0] != GPCMD_REQUEST_SENSE)
cdrom[id].cd_status = cdrom_drives[id].handler->status(id);
if (((cdrom[id].prev_status == CD_STATUS_PLAYING) || (cdrom[id].prev_status == CD_STATUS_PAUSED)) && ((cdrom[id].cd_status != CD_STATUS_PLAYING) && (cdrom[id].cd_status != CD_STATUS_PAUSED)))
{ {
completed = 1; completed = cdrom_playing_completed(id);
}
else
{
completed = 0;
} }
switch (cdb[0]) switch (cdb[0])